Reso Coder is becoming my favorite channel for learning flutter
@ResoCoder5 жыл бұрын
Thanks for learning here!
@TheMeanCanEHdian4 жыл бұрын
The jump cut at 12:31 doesn't show you changing class GetConcreteNumberTrivia implements UseCase to class GetConcreteNumberTrivia implements UseCase. If anyone gets an override error this is why.
@seviavishalom4 жыл бұрын
Thank you!
@paulo32324 жыл бұрын
I thought i missed something, thank you.
@A-Bellis3 жыл бұрын
Thanks man
@lodarn9113 жыл бұрын
You are a lifesaver
@sykoz371 Жыл бұрын
thanks
@JeremyConnor5 жыл бұрын
Thanks for the videos mate, I think you can make your UseCase class slightly more elegant using the void type (see below). abstract class UseCase { Future call(Params params); } class ExampleWithoutParams extends UseCase { @override Future call(void params) async => 42; } class ExampleWithoutReturnType extends UseCase { @override Future call(String params) async => print(params); }
@abdelrhmnallam64162 жыл бұрын
thanks
@chordfunc30725 жыл бұрын
10:26 wouldn't it be better to have the method signature have an optional param ([Params params]): Future call([Params params]);
@milossblagojevic5 жыл бұрын
Really appreciate all three TDD vids so far. This is most comprehensive series regarding TDD in Flutter. Thank you very much and keep it going
@abderrahmansettani98435 жыл бұрын
This series is veeery good, you are the only person i wait for his videos ! keep going bro
@habibbellia26075 жыл бұрын
I am waiting this vid more then 3 days Thank you 👍👍👍
@LuisHernandez-sd8sc3 ай бұрын
Here reviewing again this great vidios for new App in 2024, ty Reso Coder
@deoneloff5 жыл бұрын
Great training video!! My flutter journey has become a lot smoother thanks to you. Many thanks!!
@ResoCoder5 жыл бұрын
I'm glad I could help!
@user-kw9cu2 ай бұрын
You can use mocktail package to avoid using code generation from the latest version of mockito package.
@eduardorabanal28035 жыл бұрын
great video again bro, i'll be waiting for the next one
@flarecodeflit48235 жыл бұрын
you literally made everything easy to learn
@vladimirmbassi5 жыл бұрын
Keep up the good work! Can't wait for the next video
@ZubairRehman Жыл бұрын
you can use second param as void e.g. class GetRandomNumberTrivia implements UseCase {} and when you are calling your usecase then you can pass null as param e.g. GetRandomNumberTrivia(params: null)
@hellofolks56064 жыл бұрын
Hey reso, why do we need Type both in the UseCase declaration and in the call return type? Can't we just have it in the function's return type?
@kherelable5 жыл бұрын
HI, what is the reason to create two classes for every feature, instead of creating one service class for both of them? Is it a part of DDD methodology? p.s. thanks for the video.
@nr1525225 жыл бұрын
It's a really good question and would love a response from Reso Coder. *I think*, the point is to use the underlying data to build explicit domain use cases required by the app. If you glance the app structure, the intent of the feature then becomes clear. It would also be easy to add new functionality to the feature by implementing a new use case. Wrapping everything into a service layer might not be so transparent, although IMO, it does feel more natural.
@ResoCoder5 жыл бұрын
You want to have as much separation as possible. I agree, the example given in this Number Trivia App may not be the most fortunate one, but I wanted to keep this course as simple as possible. When you don't have just two use cases, one for random and the other for concrete trivia, and when there's some actual logic to execute, having a separate class for each use case will greatly enhance the testing process.
@ShadowInfest5 жыл бұрын
Finally :D thanks for the hard work :)
@eliezerben Жыл бұрын
Thanks for the video. Why do we have a separate class for Params? Is it to make subclassing easy?
@Abion475 жыл бұрын
Having a NoParams class just for use cases that take no arguments and then passing an instance of NoParams as an argument of those use cases seems redundant and arbitrary, especially since you would then have to pass an instance of NoParams wherever you use those use cases in production code as well. Is there a reason you went with this approach rather than having two separate UseCase and UseCaseWithParams base classes?
@ResoCoder5 жыл бұрын
I mean, you can create a separate base class if you want. In fact, having any base class at all is a kind of a "interface future-proofing", because with only 2 use cases and no logic in the base class, it's not really necessary to have it.
@peterthompson69094 жыл бұрын
Agree @Abion47 I chose that way - love your work @resocoder :)
@eliezerben Жыл бұрын
Any real world examples projects using this architecture? Would be interesting to look through how it scales for larger projects.
@НикитаКлышко5 жыл бұрын
Best english speech on KZbin 👍
5 жыл бұрын
Is there any performance difference between having relative vs absolute imports or is it just aesthetics?
@bmkgokong6684 жыл бұрын
I suppose if someone else copies your code and uses different app name - they would not have to refactor everywhere
@ih47224 жыл бұрын
This is tough. Long live spaghetti code
@ResoCoder4 жыл бұрын
🍝
@pedrodelacruz23693 жыл бұрын
Excellent, Rewaching afthe a Year
@rawnato Жыл бұрын
Hey man, I'm follow your tutorial because I'm a completely noob on frontend stuff! And I'm having some issues on the test part! When I test this (when(repository.newAccountRequest(any)).thenAnswer((_) async => tAccessTokenEntity);) I have in error like this (type 'Null' is not a subtype of type 'Future') do you have an idea what is happening?
@mukeshbheel3320 Жыл бұрын
The problem is with the mockito pakage since any always returns a null type. Use mocktail package instead which is based on mockito and handles the null safety. make these changes in the code. import 'package:mocktail/mocktail.dart'; () async { when(() => mockNumberTriviaRepository.getConcreteNumberTrivia(any())) .thenAnswer((_) async => Right(tNumberTrivia)); verify(() => mockNumberTriviaRepository.getConcreteNumberTrivia(tNumber)); it should work.
@rawnato Жыл бұрын
@@mukeshbheel3320 thanks bro
@ianjaspersantos89154 жыл бұрын
Hello reso! Just want to ask what will be under the folder usecase?? Is it all the methods from entities and repositories must have an use case?? or is it just the repositories' methods to map into usecase classes? Thanks!
@eincandela3 жыл бұрын
Best tuts i have ever followed ! Quick question: I cannot find any info on types after a class definition in dart, like UseCase. What are those for ? Thanks :)
@MKBBKD3 жыл бұрын
This is not a types. Type and Params is a template, its like promises that when you use that class you write there some type(or classes)
@aloussase5 ай бұрын
The use case interface would be neater with something like variadic template parameters for the params type
@haidarrmehsen4 жыл бұрын
Excellent explanation!
@AimaneNajja5 жыл бұрын
the value that you return in the thenAnswer and the value that you expect actual to be equal to are not the same instance which causes the test to be red
@IdanAyalon5 жыл бұрын
Thank you!! amazing videos
@amanshah26544 жыл бұрын
can you also tell how to implement a login system with clean architecture
@karangore69692 жыл бұрын
Damn! you are so honest with your content sharing
@alessandroburza45682 жыл бұрын
the class Params inside the usecase, if I have multiple usecases should I name it like GetConcreteNumberTriviaParams or something? or always Params
@mehdiparsaei18673 жыл бұрын
Thanks for useful contents!
@mohammadrezaraeesy46263 жыл бұрын
it s good tutorial for tdd . I love it
@dawidniegrebecki22054 жыл бұрын
Great Video!!
@hathanhnguyen5553 жыл бұрын
Thanks a lot for your tutorials. I love you
@alaasayed65082 жыл бұрын
are u working with null-safety
@hathanhnguyen5552 жыл бұрын
@@alaasayed6508 Yes
@TheFlyingMonkey2003 жыл бұрын
Where do we put the presentation logic for the code. Lets say for example we need to interact with an IOS sdk on the iphone and need that to update the UI in some way.
@MichaelDev4 жыл бұрын
Please , check link tutorial... just link tutorial 3 clean arq... is error ,not found please fix ...
@memosen802 жыл бұрын
What if Params has to send multiple variables? How do u make Params so called generic when u need to pass let’s say email and password ?
@nasirbalochtv10 ай бұрын
class LoginParams { final String email; final String password; LoginParams({required this.email, required this.password}); }
@max_ishere2 жыл бұрын
Arent usecases the same as closures then?
@1995taunus5 жыл бұрын
Thank you for your videos! Why relative Imports are better than absolute Imports?
@ResoCoder5 жыл бұрын
I just like them.
@1995taunus5 жыл бұрын
Thank you for your Videos! As gratitude for your work I would like to do something good for you: order pizza, donate (please add your version).
@ResoCoder5 жыл бұрын
@@1995taunus Thank you! I would very much appreciate a your donation. Here's a link www.buymeacoffee.com/resocoder
@liorpolak13912 жыл бұрын
Very good
@rezaasgary14424 жыл бұрын
is it available for android studio i mean dart import?
@laujimmy86354 жыл бұрын
How do you know what should be tested or not ?
@BiniyamAlemu-rb4tt Жыл бұрын
Hey could you update this project using current fluttter version
@aloussase5 ай бұрын
I wouldnt have created an interface for use cases because no one is really benefiting from that and it makes the code uglier because the different use cases are sufficiently different to make it awkward to use the same interface. Otherwise great video!
@shivanshiverma80254 жыл бұрын
I want to construct a method in abstract class( in the domain layer ), and I want to pass the Buildcontext as a parameter. Will doing this violate the principles of clean architecture? #ResoCoder
@svetozarvolkov59534 жыл бұрын
Yes, it will. presentation layer can depend on domain layer but not vice versa. See "Dependency Rule" at blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html
@aminelahrim81423 жыл бұрын
Why so much boiler code. In this tuto like creating a full class for only one futures what if. You have 40 get... You will create lot of folder and sub folder and classes why you didn't create class with lots of functions that do the work.
@fclinuxnova79774 жыл бұрын
could you please share the source code, I cannot understand what your mind are concern on each line of code or this is just able to be refereed by experience user, thanks
@hrushipatil4 жыл бұрын
Where can i get the aaa snippet?
@sunnychan30224 жыл бұрын
I have written the snippet since I cannot find one. Happy Coding. gist.github.com/SunnySs/482c8d6770909b73f7f76428e21c46f1#file-dart-json
@opimand3 жыл бұрын
../../SDK/flutter/packages/flutter_test/lib/src/window.dart:6:8: Error: Not found: 'dart:ui' import 'dart:ui' as ui hide window; Android Studio
@akshaymankodia90034 жыл бұрын
The moment you type : super[] , dart analyser getting terminated and then we need to restart it . lol!!!
@ericsan15612 жыл бұрын
So much boilerplate codes. This is violating “Clean code” principle.