Flutter Clean Architecture - Learn By A Project | Full Beginner's Tutorial

  Рет қаралды 194,706

Flutter Guys

Flutter Guys

Күн бұрын

DO YOU HAVE ANY QUESTION ? JOIN THE COMMUNITY
🤝 Discord
☑️ / discord
📄Architecture is very important in developing an application. Architecture can be likened to a floor plan that describes how the flow in an application project. The main purpose of implementing the architecture is the separation of concern (SoC). So, it will be easier if we can work by focusing on one thing at a time.
In the context of Flutter, clean architecture will help us to separate code for business logic with code related to platforms such as UI, state management, and external data sources. In addition, the code that we write can be easier to test (testable) independently.
🌐Reference :
🔗 / flutter-clean-architec...
🔗 / flutter-clean-architec...
🔗 / flutter-clean-architec...
📁Source Code
🔗 github.com/mahdinazmi/Flutter...
⚡ SUBSCRIBE HERE⚡
🔗 cutt.ly/2XkZz0X
🌐Social Media
🔗 Linkedin: / mahdinazmi
🔗 GitHub: github.com/mahdinazmi
🔗 Twitter: / flutterguys1
⏳ TIMESTAMPS :
00:00 Intro
03:44 Add Packages & Create Folders Structure
06:33 Define Entities Classes
09:05 Create Repository Classes & Models
11:27 Make Request To API Using Retrofit
14:40 Use Cases
17:54 Create Bloc
21:16 Dependency Injection
24:32 Display News
29:20 Local Database
33:39 Add Database Methods To Layers
36:45 Save & Remove Article From Database
#flutter #fluttertutorial #fluttercourse

Пікірлер: 288
@flutterguys
@flutterguys 6 ай бұрын
🌐 JOIN TO TELEGRAM COMMUNITY 🔗 t.me/flutterguysgp
@david_junior
@david_junior 5 ай бұрын
It is so helpful that you show the errors you encounter and how to solve them. Makes a big difference, thanks.
@sarawanak
@sarawanak 9 ай бұрын
Go to video for one who wants to learn Clean Architecture with a real world example. Definitely a good watch & bookmark for me for Future references. Thanks a lot for the valuable content. I had to pause and watch to understand, the content is very intense.
@mrkesu
@mrkesu 3 ай бұрын
Great video, exactly what I needed to start this new "clean code" journey and also thanks for providing a link to that three-part series of articles in the description. I definitely need to follow up by reading them too since I struggled a bit with following the fast paced monotone computer generated voice.
@minseokjeong1881
@minseokjeong1881 10 ай бұрын
Recently I'm thought about what is good architecture for flutter project. And I met this channel and this Clean Architecture is blowing my mind. This video has concrete example so I can learn the folder structure and concepts of clean architecture. Thanks you from bottom of my hearts❤. From S.Korea as Flutter position developer.
@flutterguys
@flutterguys 10 ай бұрын
Great to hear!
@nunosilva2658
@nunosilva2658 Жыл бұрын
Great video! Well explained and following KISS principle. I would love to get more in depth videos and something that is not quite out there yet (at least an updated version), something like an authentication feature using OAuth or Firebase Auth alongside a simple routing system that redirects you the right presentation page depending if you are signed in or not in the meanwhile taking advantage of deep link. I think this makes a lot of sense since we are using a Clean Architecture approach to Flutter, in this way we may create an App that is multi-platform compatible and highly scalable and maintainable.
@theabhi19890
@theabhi19890 3 ай бұрын
Complete the whole course, excellent work @Flutter Guys. More power to you.
@timurakhtyamov3364
@timurakhtyamov3364 Жыл бұрын
Very nice and complete explanation, thanks a lot! Looking forward for similar videos on other topics!
@flutterguys
@flutterguys Жыл бұрын
✌❤
@aouadicharaf1038
@aouadicharaf1038 Жыл бұрын
Can't wait for more ❤❤❤
@muhammadissasabbagh1540
@muhammadissasabbagh1540 5 ай бұрын
Best clean arch explaining , thanks a lot🥳
@jackvessalius7913
@jackvessalius7913 8 ай бұрын
@flutterguys in 28:32 you manually edit the ".g.dart" file, what happen if i re-run "flutter pub run build_runner" again?will the manual modification gets replace by generated code again?
@manirahmanzadeh7812
@manirahmanzadeh7812 7 ай бұрын
Learned a lot. Thanks!
@user-bf3xl1hh6o
@user-bf3xl1hh6o 10 ай бұрын
If you have multiple features for an app, would you not want to put the app database class and its generated floor code in the core package? Having it in the news feature package would make sense if that feature was going to be standalone module but Im not familiar with how that works in flutter and Im assuming thats not the case here.
@JorgeRmrzO
@JorgeRmrzO Ай бұрын
love the fireship format
@david_junior
@david_junior 5 ай бұрын
Thank you so much, I am learning a lot from your videos. Subscribed!
@flutterguys
@flutterguys 5 ай бұрын
Happy to hear that!
@ghulammurtaza7959
@ghulammurtaza7959 Жыл бұрын
This series is awesome ❤
@flutterguys
@flutterguys Жыл бұрын
I am glad ❤️
@NoName-rp6cx
@NoName-rp6cx 10 ай бұрын
Бро просто сделал титаническую работу. Спасибо
@grazielafelixdeveloper6778
@grazielafelixdeveloper6778 5 ай бұрын
Thank you very much for the content 💙😊
@emwagner
@emwagner 10 ай бұрын
When I have written in MVC, I've usually had another project called Domain.Shared as well as Domain. Is this a good idea for a Flutter project? What about class inheritance? As an example. A BaseEntity to hold/contain shared properties between entity classes?
@phuongtran-qh5kq
@phuongtran-qh5kq 10 ай бұрын
Sir you just earned a new subscriber
@yusufelyldrm4456
@yusufelyldrm4456 11 ай бұрын
simple explanation, great video. Im looking forward for new videos keep going man
@flutterguys
@flutterguys 11 ай бұрын
Appreciate it!
@yashdesai8623
@yashdesai8623 Жыл бұрын
Very Informative 😉🤞
@flutterguys
@flutterguys Жыл бұрын
Glad you think so!
@souemon7386
@souemon7386 Жыл бұрын
Thank you for thi type of content. i was looking for it for many days
@flutterguys
@flutterguys Жыл бұрын
Glad you like it!
@souemon7386
@souemon7386 Жыл бұрын
@@flutterguys can I use any alternative of retrofit?
@AkshyaKumar-b4w
@AkshyaKumar-b4w 15 күн бұрын
Bro your way of teaching and advance level of code is excellent ..
@flutterguys
@flutterguys 14 күн бұрын
Glad to hear that
@weaponx3373
@weaponx3373 4 ай бұрын
Thanks for the video, learned a lot about new dependencies and code pattern
@flutterguys
@flutterguys 3 ай бұрын
Great to hear!
@farahfrija6863
@farahfrija6863 4 ай бұрын
hello ! is there any extention to give a folder icon like in the case of your vs thank you
@dylanroman7738
@dylanroman7738 11 ай бұрын
The video I should have seen before starting the application I’m working on xD
@ovlyagulyyev
@ovlyagulyyev 11 ай бұрын
Thank you for giving me that "Eureka!" moments
@flutterguys
@flutterguys 11 ай бұрын
Our pleasure!
@Quicky121
@Quicky121 Жыл бұрын
I have some concern about the ArticleState at 19:02 . Is safe using bang operator on 'props' method? I mean, both parameters are nullable so if we have the data the error will be null and I expect that there will be a crash. No?
@sanjiz7280
@sanjiz7280 7 ай бұрын
Thanks man ❤
@user-lw2yn4zb6x
@user-lw2yn4zb6x 9 ай бұрын
What a great video, thanks alot !!
@flutterguys
@flutterguys 9 ай бұрын
Glad it helped!
@hoanghuynh918
@hoanghuynh918 3 ай бұрын
i watched more than 10 times, thanks a lot, i gonna be a master Flutter like u Flutter Guy.
@flutterguys
@flutterguys 3 ай бұрын
✨❤️
@Manishkumar-wt9tf
@Manishkumar-wt9tf Ай бұрын
It is out of box for me also, we need years of experience to understand this video, i guess.
@dgodiegomartins
@dgodiegomartins 11 ай бұрын
Tks, great content, i've learned a lot with your videos. Just one point. I dont like to my domain depend on dio package. Dio is a infrastructure concern
@McLouQ
@McLouQ Жыл бұрын
Hello, many thanks for content! Any recomendation how to pass different combinations of query parameter/s, header/s and body to use cases? First API endpoint (use case) requires Id(query) and entity(body), second endpoint requires Id(query) and userId(header) for example. Should I create special params entity for all use case inputs?
@IINOCON
@IINOCON 8 ай бұрын
This worries me a lot too. Have you found the answer to the question?
@nahomd9797
@nahomd9797 7 ай бұрын
Thanks for the detailed explanation on the architecture....can you show how to cache remote responses to local Database too....
@harshmangal6576
@harshmangal6576 4 ай бұрын
Nice work done buddy nice explanation as per industry standards
@flutterguys
@flutterguys 3 ай бұрын
Thanks a ton
@AshishPatel1992
@AshishPatel1992 Жыл бұрын
Amazing video! But few concepts goes beyond my head. Can you provide few learning resources that I can use to follow to have better understanding of the architecture. I would appreciate your headsup on this! :)
@flutterguys
@flutterguys 11 ай бұрын
Search on Github or Medium
@hiskel_kelemework
@hiskel_kelemework 10 ай бұрын
great video! one question, is it safe updating generated files by hand ? what happens when you rerun the build command ? will your manual updates not be overriden ?
@HashemRC
@HashemRC 10 ай бұрын
You should not modify generated files, as they will be overwritten next time with the build runner called.
@user-sp1th9pg6h
@user-sp1th9pg6h 7 ай бұрын
Nice video but you should not have done those explicit correction on generated file in minutes 28:00 , there was a work around. I believe that was missed in this video. It is as follows: since the response from api is not a json array but json object; we need to parse that json object. This can be achieved by following three simple steps in their respective file: Step no 1: In article.dart file inside folder models ######## add another class named ArticleResponseModel like below and ArticleModel as before: class ArticleResponseModel { List articles; ArticleResponseModel({required this.articles}); factory ArticleResponseModel.fromJson(Map articleResponseData) { return ArticleResponseModel( articles: ((articleResponseData['articles'] ?? []) as List) .map((dynamic article) => ArticleModel.fromJson(article)) .toList()); } } class ArticleModel extends ArticleEntity { const ArticleModel({ int? id, String? author, String? title, String? description, String? url, String? urlToImage, String? publishedAt, String? content, }) : super( id: id, author: author, title: title, description: description, url: url, urlToImage: urlToImage, publishedAt: publishedAt, content: content, ); factory ArticleModel.fromJson(Map articleModelData) { return ArticleModel( author: articleModelData['author'] ?? "", title: articleModelData['title'] ?? "", description: articleModelData['description'] ?? "", url: articleModelData['url'] ?? "", urlToImage: articleModelData['urlToImage'] ?? "", publishedAt: articleModelData['publishedAt'] ?? "", content: articleModelData['content'] ?? "", ); } } Step no 2: And news_api_service.dart, new get method function looks like below ######## @GET('/top-headlines') Future getNewsArticles({ @Query("apiKey") String ? apiKey, @Query("country") String ? country, @Query("category") String ? category, }); Step no 3: Change ArticleRepositoryImpl as below: ######## class ArticleRepositoryImpl implements ArticleRepository { final NewsApiService _newsApiService; ArticleRepositoryImpl(this._newsApiService); @override Future getNewsArticle() async { try { final httpResponse = await _newsApiService.getNewsArticles( apiKey: newsAPIKey, country: countryQuery, category: categoryQuery); if (httpResponse.response.statusCode == HttpStatus.ok) { // here you need to return httpResponse.data.articles instead of httpResponse.data return DataSuccess(httpResponse.data.articles); } else { return DataFailed(DioError( error: httpResponse.response.statusMessage, response: httpResponse.response, type: DioErrorType.badResponse, requestOptions: httpResponse.response.requestOptions)); } } on DioError catch (err) { return DataFailed(err); } } } easy peasy lemon squeezy
@OCTsecond
@OCTsecond 7 ай бұрын
thank you
@adhityakusumadinatha3411
@adhityakusumadinatha3411 7 ай бұрын
Thank you 🙏
@funnyexperiment2657
@funnyexperiment2657 Жыл бұрын
Greate video
@flutterguys
@flutterguys Жыл бұрын
Thanks!
@emanishregmi
@emanishregmi 4 ай бұрын
Then where should I set my user token value for dio options headers?
@DRKDQL
@DRKDQL Жыл бұрын
Hey guys, just wanted to ask if the data from two different features can interact with each other? Im making my first app and similar to your news example, I want a Songs list and a Chords list. All data will be fetched from a local DB (one Songs table, one Chords table). Each entity/model contains a list of chords (List of entity/model). So if I wanted to edit a chord, the change needs to be reflected in each entity/model. So I'm a bit confused as to how I can achieve this. Great video btw!
@flutterguys
@flutterguys Жыл бұрын
There is no problem, you are defining two separate entities. When you edit the chord, I don't think you need to edit the song as well!
@DRKDQL
@DRKDQL Жыл бұрын
@@flutterguys Appreciate the response! Yeah was more so a confusion on how each feature has to have the architectural folders. In that way, how can one feature access data from another? I have decided to use feature folders within the architectural folders for now. Will see how it goes. Thanks heaps!
@mahdiabedzadeh
@mahdiabedzadeh Жыл бұрын
Best
@yousefashraf1209
@yousefashraf1209 10 ай бұрын
Thank you very much for sharing this knowledge 🙏💚. I wanted to ask if I had many models, entities, and api services. Every time I run "build_runner build," will I have to edit all the api services to work properly the same way we did it in this video?
@platonalphorov5326
@platonalphorov5326 9 ай бұрын
To edit the codegen is a very strange decision. You should create something like ArticleResponseModel, with fields statusCode, totalResults and articles(the list of all articles). And put articles into DataSuccess ''return DataSuccess(res.data.articles);''.
@vlad1slove1
@vlad1slove1 11 ай бұрын
great work and cool video!) it whould be very interesting to see the same topic in some depth: pagination. how to handle state when we have pagination in items list? and what if we need save all content, not only selected by user, for displaying when there are no conection?
@flutterguys
@flutterguys 11 ай бұрын
Great suggestion!
@programingtales7514
@programingtales7514 Жыл бұрын
Amazing thanks ❤
@flutterguys
@flutterguys Жыл бұрын
You're welcome 😊
@happycat6836
@happycat6836 5 ай бұрын
i encounter a problem took me few hours to figure it out, ArticleModel constructor name params should be super.title, if it is String ? title, all ArticleModel we get from factory, their attibute all Null
@the_akash_khandagale
@the_akash_khandagale Жыл бұрын
very crisp & clear explanation .. Just wanted to ask can we use the bloc's cubit instead of old bloc state management method
@onyemaanthony
@onyemaanthony 11 ай бұрын
yes you can use any state management of your choice
@ka61er
@ka61er 11 ай бұрын
@@onyemaanthony can i ask you ? which is the best for state management right now ?
@onyemaanthony
@onyemaanthony 11 ай бұрын
Well there is nothing as best state management it depends on the project your working on and also a lot of use cases I will say as a flutter developer make sure your confortable working with bloc and provider as the are the most popular in the community
@batuhankuru9999
@batuhankuru9999 Жыл бұрын
As we didn't use the fromjson method but it didn't pose a problem why?
@AmitThakur-eg8kb
@AmitThakur-eg8kb 10 ай бұрын
Hello, can you tell how to pass bloc reference from one screen to others.
@dnsl5384
@dnsl5384 7 ай бұрын
what is the difference between this architecture, MVP, MVC, or MVVM and which is better
@thenightguy6816
@thenightguy6816 11 ай бұрын
The folder structure is a bit complex, but a great video nonetheless. I would much like to see a cleaner implementation without relying on multiple dependencies. A question, at this moment, i was working on a hobby project of mysql node js api which i could call using retrofit. Flutter Bloc has went through a lot of updates. If Possible Please do an indepth video on Hydrated Bloc pattern and Retrofit CRUD Requests Would love to see your take on that.
@ka61er
@ka61er 11 ай бұрын
no bro, this structure is very popular and easiest in mobile to understand and maintain
@oduyhung215
@oduyhung215 8 ай бұрын
@@ka61er i have a question that what would we do if two features need to call the same endpoint? we will create 2 repository for each feature with the same code ?
@syedibrahim1361
@syedibrahim1361 4 ай бұрын
Hi I have one question why repo abstraction is in domain layer why it is not in data layer? can you please explain in comment.
@ShivamVerma-zc4zi
@ShivamVerma-zc4zi 5 ай бұрын
best❤
@oaiwjebdlla
@oaiwjebdlla Ай бұрын
Hey, why ingredient model doesn't pass parameters to super class? Thanks
@sajidAli-sz4kn
@sajidAli-sz4kn Жыл бұрын
btw i like your videos. i am actually one of your older subscriber
@flutterguys
@flutterguys Жыл бұрын
@CharlesSteinmetz1
@CharlesSteinmetz1 Жыл бұрын
Very good content, thank you! I would have a question regarding entities and models.. isn't there an easier way of doing that without writing a model that looks almost the same as the entity besides the annotations? It looks like a lot of duplicated work especially when changing the entities/modes...
@flutterguys
@flutterguys Жыл бұрын
You can delete the entity, but this is against the clean architecture, on the other hand, because the entity is in the domain layer and the domain layer is independent and should not be subject to external changes. We cannot use entity in the data layer because we may make changes in the database or api at any moment, which will lead to changes in the entity and domain layer, which is contrary to clean architecture.
@elijahonduso
@elijahonduso 10 ай бұрын
@@flutterguys Still this explanation isn't quite clear because ArticleModel is extending the ArticleEntity. What does this mean if for some reasons, we change the articlesModel to add or remove or modify fields? We'll be forced to also update the entity. Instead of extending, I prefer separate data mappers for this. What do you think?
@devisagosto
@devisagosto 7 ай бұрын
@flutterguys can you reply please? I'm interested
@sinazp8422
@sinazp8422 8 ай бұрын
hi, after searching whole internet i found this wonderful tutorial about clean architecture, but i am little confuse about the difference of mvvm, mvc and mvi architecture vs clean architecture, somewhere in stackoverflow i read that mvvm and.... only use in presentation layer and we can use them even in clean architecture , so here in this project what kind of architecture are you using in presentation layer? and can you explain about it? thank you ❤
@shipooprincess670
@shipooprincess670 5 ай бұрын
MVVM solves issues from MVC. MVVM structure follows clean architecture.
@sivsovanpanhavorn6296
@sivsovanpanhavorn6296 3 ай бұрын
this is the first clean one ever and advance
@Anilkumar-ec8sj
@Anilkumar-ec8sj 10 ай бұрын
why not hive? retrofit really need dio can do most of the work ?
@maxc9432
@maxc9432 11 ай бұрын
Hi, great video. May I know what extension are you using for the folder icon?
@hitesh2293
@hitesh2293 10 ай бұрын
I think its Material Icons extension
@nunajah
@nunajah Жыл бұрын
This awesome! Create another project pls 🎉
@flutterguys
@flutterguys Жыл бұрын
@raressimon9271
@raressimon9271 4 ай бұрын
ok but if we want to make a post for register?
@PrateekAher
@PrateekAher 7 ай бұрын
None of the statements in initializeDependencies() method are asynchronous. Why is the function itself asynchronous?
@kapilpoudel8452
@kapilpoudel8452 8 ай бұрын
Too fast for begineer so great video but will back later after become good at flutter !! make a medium pace videos so that it would be beginner friendly too !
@arturfilar905
@arturfilar905 8 ай бұрын
In Create Repository Classes and Models video you make the Data model extend the Domain Entity which creates a dependency on Domain Layer from Data layer. Isn't it an antipattern? Well maybe it's not, since the Data layer should be swappable and the Domain layer contains only bussiness logic that should not have any frameworks and specific implementations/technologies.
@lalitmujalde3072
@lalitmujalde3072 6 ай бұрын
I'm getting the exception in the "article!urltoimage!" in the article_tile.dart file as -> "no host specified in the URL ". how to resolve this??
@urinbayeeva24
@urinbayeeva24 Ай бұрын
hi what about other methods post put delete?
@ArturoMartinez-uz5sw
@ArturoMartinez-uz5sw 10 ай бұрын
its better have data/domain/presentation as main layers, and then add by module like data/auth/..., that repeat on each feature all the auth/domain/data... layers, having many directories make it complex to read.. simple its better always
@ranjankiran2269
@ranjankiran2269 Жыл бұрын
Hey really nice video 👍, i had one question, so what if two different features share the same state, like they depend on a reactive state, where would you put it? Should it be in the data section but it won't be from a data source but just some shared state, how do you handle this.
@flutterguys
@flutterguys Жыл бұрын
If you can give an example
@ranjankiran2269
@ranjankiran2269 Жыл бұрын
we have two pages, and on one page we have a switch, and the other page will show some text based on the current value of the switch on the other page. we have two pages each with their own application login, but this switch is one that is shared.
@mehediehteshum3741
@mehediehteshum3741 Ай бұрын
Great video! Thanks for the content... I have one confusion... Could @flutterguys or someone please explain this to me?... Since the presentation layer (bloc, state, widgets, etc.) and the data layer repo implementation (for saving articles locally) depend on the ArticleEntity (the domain entity), then how does this clean architecture make layers independent from each other or at least the domain layer decoupled from the other layers? TIA
@lethilian
@lethilian 11 ай бұрын
Firstly, thanks for the video. Great explanations with great content. I have two questions. 1. Is it a good practise extending dataModel from entity? I think they should be seperate totally and we can use a mapper class for entity->model or model->entity transformations. 2. Is using methods like _buildAppBar and _buildBody legal? I agree with you, the code looks organized but I think flutter doesn't recommend doing this due to performance issues. What do you think?
@flutterguys
@flutterguys 11 ай бұрын
Extends is a easy way you can create a "toEntity" method. And maybe to entity is better in complex projects. Because extending is a kind of dependency. You are right. To be honest, I have no information about your second question and I have to research.
@meek6836
@meek6836 11 ай бұрын
For 2nd, Yes it's recomended to use stateless/stateful widgets instead of function widgets. A Function widget is called every time when a state changes while a Widget may not change as flutter is optimised for widgets.
@asian1nvasion
@asian1nvasion 11 ай бұрын
Hi, I'm new to the BloC pattern and Flutter so please excuse my ignorant question about the 'Create BloC' section. I looked up BloC examples online and they all seem to involve the use of StreamController in some shape or form. How come in this tutorial, only the emit is used? And thanks for the great video. Subscribed!
@flutterguys
@flutterguys 11 ай бұрын
What did they use stream controller for? What was their goal?
@dgodiegomartins
@dgodiegomartins 11 ай бұрын
Hi, If you are going to implement the pattern bloc, we used to work with streamcontroller to control the stream flow, but in this video we are using the bloc library (not only the pattern) that encapsulate this for us.
@kenoisplaying5279
@kenoisplaying5279 5 ай бұрын
I don't know if this is a good approach for big projects I mean in the example you have it is a small app and you have a huge folder structure what would happen with medium-big projects?
@blumiden
@blumiden 4 ай бұрын
I feal like that this approach is not following the KISS principle, because of many introduced shallow "modules", just passing the data
@DyecksRF
@DyecksRF 10 ай бұрын
Please put subtitles on your videos. Today with AIs it is so simple and easy! This way, people from all over the world can see your videos.
@yknmalayalam
@yknmalayalam 7 ай бұрын
Subscribed
@edwinfcapidos
@edwinfcapidos 8 ай бұрын
This could have been better if you made a bootcamp style. I will gladly watch a 24 hour version of it.
@akliatharia
@akliatharia 11 ай бұрын
thnx, please a clean aechitecture project with Hive and bloc
@user-mv4fs3qn1c
@user-mv4fs3qn1c 9 ай бұрын
thanks
@Wilson_Merpati_Jaya
@Wilson_Merpati_Jaya 10 ай бұрын
great tutorial. in minutes 28:00 i tried my code and got I/flutter null. please advice. thanks
@jemjem8902
@jemjem8902 6 ай бұрын
Same, did you fix it?
@jemjem8902
@jemjem8902 6 ай бұрын
I tried logging the data I get from the API, it's null. When I try it in postman, like same query params, it works
@prince-sonawane
@prince-sonawane Жыл бұрын
Great content! and I have a question in terms of scalability. as for now we only have 1 api to deal with and the sl is full of content. what if the api count goes for like 50? how to handle it in clean architecture?
@flutterguys
@flutterguys Жыл бұрын
I think we can create multiple sl instance, I don't know exactly I have to research about it.
@jackvessalius7913
@jackvessalius7913 8 ай бұрын
Registered those api's in NewsApiService class if it only has one baseUrl, the tricky part if you follow this tutorial if you had 50 api's you're likely dealing with many models and entities which is cumbersome
@pmpjim
@pmpjim 11 ай бұрын
It's not really clean, the folder structure actually makes me confused :), but it's still a great video, thanks for sharing!
@adipati27ma
@adipati27ma 3 ай бұрын
Great videos! but I have question, why after I remove the saved article, it's UI didn't re-render...? (removed article didn't disappeared) I have to go back to the prev page, then go again to Saved Articles page to get the UI changing (removed article has disappeared)
@adipati27ma
@adipati27ma 3 ай бұрын
And if I built it into release .apk, the news didn't load (the application just layout with no data).. please answer if you have some insight
@flutterguys
@flutterguys 3 ай бұрын
You have to internet permission in AndroidManifest to work in release mode
@flutterguys
@flutterguys 3 ай бұрын
Please check with source code or clone project from Github
@adipati27ma
@adipati27ma 3 ай бұрын
@@flutterguys Ohh okay thanks for your reply! appreciate it, I'll check it right away
@irvingprojectdev
@irvingprojectdev 11 ай бұрын
Great tutorial bro. Sory but I got a problem when get imageUrl _TypeError (Null check operator used on a null value) in article_tile.dart would you help this error, thanks
@dtechb
@dtechb 11 ай бұрын
Confirm if you passed urlToImage in ArticleModel class to super
@javad_hei3840
@javad_hei3840 2 ай бұрын
عالی پسر
@flutterguys
@flutterguys 2 ай бұрын
Ghorboonet ❤️✌️
@sajidAli-sz4kn
@sajidAli-sz4kn Жыл бұрын
Hey! I need you help. I really like this clean architecture kind of programming because it will be more professional to use this instead of direct and hard coded practices. the problem is it is very hard to me. how can i learn it because of the complex kind of programming. how did you learn it and what was of help. Thank you
@flutterguys
@flutterguys Жыл бұрын
When I was learning, I thought it was complicated, but it is not at all. I found the source code of a simple project and tried to find the connection of the files with each other and this way I could learn. I taught exactly the method I learned in the video, so watch the video and then check the source code.
@sajidAli-sz4kn
@sajidAli-sz4kn Жыл бұрын
@@flutterguys I am gonna build the app myself with you. Thanks for replying. Have a great day!
@ehudpinhas8873
@ehudpinhas8873 11 ай бұрын
Thank you for this great explanation Can you please share the updated repo? the repo in the link is not updated Best Regards,
@flutterguys
@flutterguys 11 ай бұрын
Already shared , check description.
@ehudpinhas8873
@ehudpinhas8873 11 ай бұрын
@@flutterguys Thanks now I see the updated code Best Regards,
@martinmajewski
@martinmajewski 5 ай бұрын
Putting the abstract "usecase" class file into the core folder seems arbitrary. It is an essential part of the domain layer and should be located there, next to the use case implementations. When you put it into "core," you have a hard link between the domain and core layer, which makes the domain layer not independent of the other layers!
@adianblabla
@adianblabla 7 ай бұрын
I think it's a bad arhitecture to have different blocs for remote/local. IMO you should have the remote/local repositories which are interchangable, based on network connection. It more simple/clean/maintable and reduce the boilerplate comes with having diffeent blocs for remote/local.
@omkarp9943
@omkarp9943 9 ай бұрын
At first, I thought the video was playing at 1.5x speed😐 Btw...thanks for this video!!
@herlambangkurniawan6027
@herlambangkurniawan6027 Жыл бұрын
I got this error at 12:50 "The type 'HttpResponse' is declared with 0 type parameters, but 1 type arguments were given.Try adjusting the number of type arguments to match the number of type parameters." Anyone know how to solve it ?
@flutterguys
@flutterguys 11 ай бұрын
Check source code.
@herlambangkurniawan6027
@herlambangkurniawan6027 11 ай бұрын
@@flutterguys Thanks for your reply and by the way I have already solve this problem a few days ago 😁😁
@umitylmaz6481
@umitylmaz6481 11 ай бұрын
@@herlambangkurniawan6027 how you solved this error?
@jorgeflorescarlos8537
@jorgeflorescarlos8537 9 ай бұрын
@@herlambangkurniawan6027 How did you solve it?
@naveennirban
@naveennirban 9 ай бұрын
@@jorgeflorescarlos8537Import HttpResponse from dio instead of dart:io
@mahdiabedzadeh
@mahdiabedzadeh Жыл бұрын
waiting for your new videos
@armenuhimkrtchyan3551
@armenuhimkrtchyan3551 6 ай бұрын
Hi all, I have an issue, ArticleModel data is null, the request is done well, response comes, but model data null? Please help, what can cause that problem?
@lalitmujalde3072
@lalitmujalde3072 6 ай бұрын
change your article model constructor like this const ArticleModel({ int? id, String? author, String? title, String? description, String? url, String? urlToImage, String? publishedAt, String? content, }) : super( id: id, author: author, title: title, description: description, url: url, urlToImage: urlToImage, publishedAt: publishedAt, content: content, ); I Hope it will solve your problem ..
@armenuhimkrtchyan3551
@armenuhimkrtchyan3551 6 ай бұрын
@@lalitmujalde3072 Thanks, now text data comes but images data still not coming.
@kyawthet-naing
@kyawthet-naing Жыл бұрын
really like this style ❤
@flutterguys
@flutterguys Жыл бұрын
@yoriichi28
@yoriichi28 2 ай бұрын
Best video out there for flutter clean architecture Still i've some confusion can you help me?
@flutterguys
@flutterguys 2 ай бұрын
Yes sure
@yoriichi28
@yoriichi28 2 ай бұрын
​@@flutterguys Suppose there is some variable like bool , string or any variable that can change UI like isSaved Something like that so if we need to handle them how we can do we need to declare those in UI or bloc file for this clean architecture ? Like in Getx we can declare in controller file but in this structure how we can manage As u said in bloc there will be only less logic like calling apiRepo/use case so can you explain that one? It will be great. Also more question on any sdk implementation like firebase services or suppose we are using any ChatSdk so how do we manage that in clean architecture where should we create all services in this structure.
@mrfounderr
@mrfounderr 11 ай бұрын
Most clean architecture projects focus on working with apis. What if you have firebase as backend? Which layer should you put your firebase methods in?
@flutterguys
@flutterguys 11 ай бұрын
Data layer , not difference
@mrfounderr
@mrfounderr 11 ай бұрын
When bloc setup is done I get a null error. It works fine on the browser, Api key and all other stuff are okay, I have exactly copied all your codes to solve it but still doesn't work. DataState is success but it returns a list of articles with all null data inside. Plz help.@@flutterguys
@flutterguys
@flutterguys 11 ай бұрын
@@mrfounderr This error is because the url of some photos, You can check this to set a default url if it is null.
@mrfounderr
@mrfounderr 11 ай бұрын
@@flutterguys It didn't solve the error. I when I print the data, there are 17 ArticleModels where all their fields are null. This is what it looks like: ArticleModel(null, null, null, null, null, null, null, null). The only difference in my code is that I had to upgrade some dependencies to latest version.
@flutterguys
@flutterguys 11 ай бұрын
@@mrfounderr This error can be from the from json method. please print in from json. If you could not solve it, push it on GitHub and I will check it.
@JamesBond-mq7pd
@JamesBond-mq7pd Жыл бұрын
What is the dagger alternative for Flutter?
@melmanoi2788
@melmanoi2788 Жыл бұрын
R Native
@satdevlpr
@satdevlpr 7 ай бұрын
Which state management is best.. Provider, Bloc or Riverpod ?
@flutterguys
@flutterguys 7 ай бұрын
Bloc
@satdevlpr
@satdevlpr 7 ай бұрын
@@flutterguys Any main reason using Bloc over others
@blumiden
@blumiden 4 ай бұрын
riverpod
@ankit_apk
@ankit_apk 9 ай бұрын
For those whose build_runner command is not working add retrofit_generator in dev_dependencies.
@sarmadajmal3602
@sarmadajmal3602 8 ай бұрын
Thanks
@donathmm3881
@donathmm3881 Жыл бұрын
You are talking so fast man take a breath between each sentence ...
@arnob_
@arnob_ Жыл бұрын
Ya it feels like AI voiceover at 1.15x speed
@JJ-to7hj
@JJ-to7hj 11 ай бұрын
Most definitely AI voice
@user-tf4cd2rw3t
@user-tf4cd2rw3t 10 ай бұрын
I used the 0.75x setting :D
@sanjoydey2256
@sanjoydey2256 10 ай бұрын
Its his credit, you can slow the video speed.
@badsanta7356
@badsanta7356 10 ай бұрын
This channel is from France. No way this is his real voice
Clean Architecture in Flutter - All You Need to Know!
3:57
Flutter Guys
Рет қаралды 34 М.
Flutter Basics by a REAL Project
25:42
Flutter Guys
Рет қаралды 422 М.
Вечный ДВИГАТЕЛЬ!⚙️ #shorts
00:27
Гараж 54
Рет қаралды 14 МЛН
Cat Corn?! 🙀 #cat #cute #catlover
00:54
Stocat
Рет қаралды 15 МЛН
Best father #shorts by Secret Vlog
00:18
Secret Vlog
Рет қаралды 22 МЛН
3M❤️ #thankyou #shorts
00:16
ウエスP -Mr Uekusa- Wes-P
Рет қаралды 15 МЛН
The First Step To Clean Architecture | Flutter SOLID Principles
28:27
Rivaan Ranawat
Рет қаралды 14 М.
Beginning Flutter - Intermediate - Using Common Widgets
4:44
JediPixels
Рет қаралды 74 М.
KMP vs. Flutter - Who Will Win The Cross-Platform Battle?
16:19
Philipp Lackner
Рет қаралды 35 М.
Flutter Bloc Project! | One video and you are master of Flutter Bloc
1:47:57
Golang Web Server and RSS Scraper | Full Tutorial
2:49:35
Boot dev
Рет қаралды 45 М.
35 Flutter Tips That Will Change Your Life
10:53
Flutter Mapp
Рет қаралды 296 М.
1$ vs 500$ ВИРТУАЛЬНАЯ РЕАЛЬНОСТЬ !
23:20
GoldenBurst
Рет қаралды 1,7 МЛН
НЕ ПОКУПАЙ СМАРТФОН, ПОКА НЕ УЗНАЕШЬ ЭТО! Не ошибись с выбором…
15:23
PART 52 || DIY Wireless Switch forElectronic Lights - Easy Guide!
1:01
HUBAB__OFFICIAL
Рет қаралды 52 МЛН
Klavye İle Trafik Işığını Yönetmek #shorts
0:18
Osman Kabadayı
Рет қаралды 4,1 МЛН
iPhone 15 Pro в реальной жизни
24:07
HUDAKOV
Рет қаралды 351 М.
Что не так с раскладушками? #samsung #fold
0:42
Телефон-електрошокер
0:43
RICARDO 2.0
Рет қаралды 382 М.