ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก
Dart Classes Explained II - Inheritance(extends) vs. Abstraction(implements) vs. Mixins(with)
ฝัง
- เผยแพร่เมื่อ 1 ส.ค. 2021
- Hi there!
In this video will be a follow up to my previous video on Dart Classes, and today I'll cover up one of the most important topics you really need to know inside Dart.
- Dart OOP Concepts
- Inheritance via the extends keyword
- Polymorphism
- Covariant keyword
- Abstraction via the implements keyword
- Abstract classes, methods, interfaces
- Mixins via the with keyword
- Mixins with on keyword
- Extension Methods
- Class Hierarchy
- Many, many more!
Hope you'll enjoy my tutorial!
All animations were done in VideoScribe, you can try it by clicking my affiliate link --- www.awin1.com/...
You can contact me directly here:
Join my Discord Server --- / discord
Twitter --- / letsgetwckd
Instagram --- / letsgetwckd
Also, if you want to support me furthermore you can become an TH-cam Member, donate or buy my courses on Udemy, using the following links:
Become an Official TH-cam Member! ---- / flutterly
Buy my Udemy Courses! ---- www.udemy.com/...
Support me on Revolut! ---- revolut.me/let...
Buy me a Ko-fi! --- ko-fi.com/wckdyt
Donate me on Paypal! --- www.paypal.me/...
Support me on Patreon! --- / wckdyt
Dart - from Novice to Expert Source Code --- github.com/The...
My Complete Dart Course is now live on Udemy! Go get it while it's hot!
Oh, and as a gift to my community, here's a limited-time coupon (LETSGETWCKD) helping you get it with as little as 9.99$.
It's a steal for the amount of work I put in.
www.udemy.com/course/dart-from-novice-to-expert/?referralCode=EC9CB6CC14FFA62C901B
Man ... the quality of this turorial series is somethings else, so professional ... hat off to you.
Thank you so much brother, the best is yet to come! ✨
Wow! I had to take a Java course to understand these OOP concepts before coming back to Dart, and you have them all right here with the Dart unique features. Thanks.
Haha, thank you so much! I'm glad I could help you! 🌟
😳 Wow! Complete lightbulb moment for me. Thank you for the description on how 'super' access the class right above the current class. That is amazing
Thank you so much, glad I could help! ✨
These videos are way more helpful than Dart's own official documentation. Thank you for explaining everything so clearly.
I've been watching different videos to understand OOP better, this is one of the best videos if not the best! Thanks man!
Thank you so much! ✨
Honestly this is the best Dart/Flutter channel there is. I found myself watching vids about stuff I already know just because it is presented in such a clear and easy to understand way and the videos are so well done. I am interested in your opinions on how successful you think Flutter will be outside of mobile; do you see Flutter making a lot if headway on the web -dev side of things outside of the mobile space.
Thank you so much for your amazing feedback and kind words! I really appreciate them! ✨ To be honest, Flutter is still in its early days outside mobile platforms, so currently I don't see it as a competitor to other web-related technologies. Anyways, I've seen products trying to be the jack of all trades and frankly I think flutter should focus more on its mobile platform at first, because it's not perfect on that department either, then focus more on other platforms.
I haven't heard of the "covariant" keyword ever before, and it could actually be extremely useful in some rare cases.
I was trying to do exactly that few days ago, I had a class (for handling requests) containing some logic, thus I can't make it abstract in order to not copy and paste the same methods in every child class, and at same time I wanted every child to implement its own toJson fromJson method, and I couldn't do it the proper way (as you said, abstract methods aren't allowed in a non-abstract class) , so I ended up declaring them with an empty body, which is not optimal and also risky cuz there're many programmers working on the project and any one of us can easily forget to override those empty methos when extending the class
It's a long comment 😅 but what I meant to say is that's why I like your videos, you arm us with this valuable tips that a person may only use once in a month, but when do, it's really advanced and useful, also one can brag about it lol 😂😎
Thank you so much, indeed, this makes a difference between being a normal developer to an expert one on a programming language. 👍 Thanks for the feedback!
I never better understanding on mixins and abstract classes. Thank you 💖
You're welcome, mate! I'm glad I could help! ✨
Thank you very much for being so thorough and systematic with these tutorials. These are God tier. 🤟
Thank you very much!! I'm not a programmer, but the way you explained hard concepts is very clear and concise. You are an amazing teacher. Instant subscribe 😁
Nice, great video, better understand, thank you sooo much sir for provide such great video, also motivate us...love you from india♥️
Thank you, man, I really appreciate it!
Absolutely fantastic video. Thank you so much! :)
Excellent presentation, hello from Türkiye!
Bravo. Best explanation of these important concepts!
Thank you so much, mate! 🌟
So well explained, thanks man!
Simply Awesome i have no word to say thanks, 😀😀😀😀😀😀😀😀😀😀😀😀😀
Thanks for this masterpiece tutorial ❤ really helps a lot
Bro thanks bro for sharing knowledge
You're welcome, brother!
thanks alot great series
0:06 Yes, I having a great day because of you, bro :3
Thanks
Hi, off topic, but in 29:36 the tooltip shows the problem at the top and the doc at the bottom, do you see the same happening with modern versions of vscode? There are users reporting since 2019 that the problem list shows at the bottom, but I was curious if this was taken last year, how is it possible.
Exelent explanations btw :)
Thank you for such great content❤️❤️,
How many other videos left in this series?!
Thank you! I don't really know, at least another 20 I guess.
Thank you very much for your efforts, you're awesome man. love ya
Thanks Bro and I have a questions, SO about the extensions what are some real life use cases that we need to use it? In flutter or dark language
Encapsulation says you should use private attributes, but this brought me an issue. I cannot access super-class attributes in my sub-class. I've readed that if classes are in different files, you cannot read them if their private, so should I just use public attributes or use multiple classes in the same file? which of this fixes are commonly accepted/not considered a bad practice?
Probably you have already solved it by this time but if anyone else needs to solve this problem, the usage of 'part' and 'part of' can solve it.
amazing video❤❤❤❤❤❤❤❤
Thank you 🤍🤍🤍
Can we achieve Abstraction concept by using extends keyword ?
Thank you sir.
Thank you, Rahul! ✨
Is there any option to create final method in dart so no one can override it? In Dart every method gets override. In our business logic we don't need our this function will never override by its child classes so how can we make function
The best
I still confused here, we can also define interface with normal class but we can use abstract class too
Which is the best way?
Abstract classes cannot be instantiated, and they should be used as interfaces more often due to this fact alone. I just mentioned that every class in Dart is an interface, just as a quick tip and information, but regardless of that, you'd be better of creating an abstract class when you want to create an interface. 👍
Alright thanks i will watch again and again till I understand
nice video
I'm watching your videos. I was watching the first explanation in speed 0.5 and with subtitles in Spanish. I really don't speak English, I'm learning, the video was 30 minutes long but, between pauses, it took me two days to finish it. I just noticed that in this video there are no subtitles, i'm really sad lol
I love your explanations, I have to learn English really fast
Gem
🤍
Musician extends Guitarist, Drummer could have used the last class perform() method (here Drummer) .. like with Mixins ?! It would have solved the DDD problem ? :)
So good tutos !
A musician cannot extend multiple classes, that's the rule. It can implement multiple ones, or have other one extending it that mixins with other ones
@@Flutterly I know i followed carefully but you said that in Dart there was only single inheritence to avoid DDD conflict .. BUT if EXTENDS would have react like with mixins and choose the method that is the lowest in the hierarchy .. it could have been ok to extend multiple class ?! I like talking about useless topics :)
Yes, that's correct, I understood what you are saying, sorry. It would have been multiplr linear inheritance, from top to bottom. However, this is not ok because that would mean the drummer would borrow the perform method from the guitarist in the hierarchy, and a drummer instance cannot play the guitar.
@@Flutterly Thank you WCKD :)
4:35 Dart now let's you do super.name , for example Bird(super.name)
Viewer 464(roughly);
I hardly ever see that any content creator provides their sources of information at the end of the tutorial.
And what sources should I provide? I am just stating things from my knowledge and sometimes if I forget a minor detail, I take a look over the official Dart documentation on Dart website.
@@Flutterly I can be the next one who will praise your content and yes I do . But at the same time I might be the first who tell you that customer interaction is even more challenging and more important. I wish you learned that quickly.
the part with mixins was .............................................................................
Spanish Subs please
I'm sorry, they are auto-generated, and if TH-cam decides they can't be generated, I can't do anything about it 😔
good content, but you are talking fast man
please reply. in interface we have to override each and every method , thn what about implicit interface