Dart Classes Explained II - Inheritance(extends) vs. Abstraction(implements) vs. Mixins(with)

  Рет қаралды 13,516

Flutterly

Flutterly

Күн бұрын

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 KZbin Member, donate or buy my courses on Udemy, using the following links:
Become an Official KZbin 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...

Пікірлер: 70
@Flutterly
@Flutterly 3 жыл бұрын
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
@salim7958
@salim7958 3 жыл бұрын
Man ... the quality of this turorial series is somethings else, so professional ... hat off to you.
@Flutterly
@Flutterly 3 жыл бұрын
Thank you so much brother, the best is yet to come! ✨
@OttoAkama
@OttoAkama 3 жыл бұрын
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.
@Flutterly
@Flutterly 3 жыл бұрын
Haha, thank you so much! I'm glad I could help you! 🌟
@MadeInPython
@MadeInPython 8 ай бұрын
These videos are way more helpful than Dart's own official documentation. Thank you for explaining everything so clearly.
@gumdum6764
@gumdum6764 3 жыл бұрын
😳 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
@Flutterly
@Flutterly 3 жыл бұрын
Thank you so much, glad I could help! ✨
@azackmatoff2570
@azackmatoff2570 3 жыл бұрын
I've been watching different videos to understand OOP better, this is one of the best videos if not the best! Thanks man!
@Flutterly
@Flutterly 3 жыл бұрын
Thank you so much! ✨
@antoniodominikovic7496
@antoniodominikovic7496 3 жыл бұрын
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.
@Flutterly
@Flutterly 3 жыл бұрын
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.
@YTarikKalyoncu
@YTarikKalyoncu 3 жыл бұрын
I never better understanding on mixins and abstract classes. Thank you 💖
@Flutterly
@Flutterly 3 жыл бұрын
You're welcome, mate! I'm glad I could help! ✨
@sharbelokzan9673
@sharbelokzan9673 3 жыл бұрын
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 😂😎
@Flutterly
@Flutterly 3 жыл бұрын
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!
@bang-naim
@bang-naim Жыл бұрын
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 😁
@distributedchaos5129
@distributedchaos5129 2 жыл бұрын
Thank you very much for being so thorough and systematic with these tutorials. These are God tier. 🤟
@leandroacevedo3339
@leandroacevedo3339 3 жыл бұрын
Bravo. Best explanation of these important concepts!
@Flutterly
@Flutterly 3 жыл бұрын
Thank you so much, mate! 🌟
@yecoof
@yecoof 2 жыл бұрын
Excellent presentation, hello from Türkiye!
@akshaywaghe7327
@akshaywaghe7327 3 жыл бұрын
Nice, great video, better understand, thank you sooo much sir for provide such great video, also motivate us...love you from india♥️
@Flutterly
@Flutterly 3 жыл бұрын
Thank you, man, I really appreciate it!
@michaelappiah-kubi2829
@michaelappiah-kubi2829 Жыл бұрын
So well explained, thanks man!
@lerazy2376
@lerazy2376 Жыл бұрын
Thanks for this masterpiece tutorial ❤ really helps a lot
@fluttermdev4444
@fluttermdev4444 3 жыл бұрын
Thank you for such great content❤️❤️, How many other videos left in this series?!
@Flutterly
@Flutterly 3 жыл бұрын
Thank you! I don't really know, at least another 20 I guess.
@Akua-hx3rb
@Akua-hx3rb 2 ай бұрын
Absolutely fantastic video. Thank you so much! :)
@Sanjay54251
@Sanjay54251 2 жыл бұрын
Simply Awesome i have no word to say thanks, 😀😀😀😀😀😀😀😀😀😀😀😀😀
@bodehallak1552
@bodehallak1552 2 жыл бұрын
Thank you very much for your efforts, you're awesome man. love ya
@pd2180
@pd2180 2 жыл бұрын
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 :)
@elkokle4333
@elkokle4333 Жыл бұрын
0:06 Yes, I having a great day because of you, bro :3
@ali-cu1ne
@ali-cu1ne 4 ай бұрын
thanks alot great series
@shadyarbzharothman8689
@shadyarbzharothman8689 Жыл бұрын
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
@AyushPanditofficial
@AyushPanditofficial 3 жыл бұрын
Bro thanks bro for sharing knowledge
@Flutterly
@Flutterly 3 жыл бұрын
You're welcome, brother!
@officialismailshah
@officialismailshah 3 жыл бұрын
amazing video❤❤❤❤❤❤❤❤
@Flutterly
@Flutterly 3 жыл бұрын
Thank you 🤍🤍🤍
@md.ruhulamin7963
@md.ruhulamin7963 3 жыл бұрын
Thank you sir.
@Flutterly
@Flutterly 3 жыл бұрын
Thank you, Rahul! ✨
@vishal-val
@vishal-val 6 ай бұрын
Can we achieve Abstraction concept by using extends keyword ?
@gayratbeshimov9533
@gayratbeshimov9533 2 жыл бұрын
Thanks
@SaraArguello-f1p
@SaraArguello-f1p Жыл бұрын
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
@SaraArguello-f1p
@SaraArguello-f1p Жыл бұрын
I love your explanations, I have to learn English really fast
@Nicosfrs
@Nicosfrs 2 жыл бұрын
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?
@alperk347
@alperk347 Жыл бұрын
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.
@aarijamir5550
@aarijamir5550 2 жыл бұрын
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
@mr.pradana1273
@mr.pradana1273 3 жыл бұрын
I still confused here, we can also define interface with normal class but we can use abstract class too Which is the best way?
@Flutterly
@Flutterly 3 жыл бұрын
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. 👍
@mr.pradana1273
@mr.pradana1273 3 жыл бұрын
Alright thanks i will watch again and again till I understand
@gyanupadhyay9473
@gyanupadhyay9473 Жыл бұрын
nice video
@ParabTarak
@ParabTarak Жыл бұрын
The best
@arnaudduquenoy2061
@arnaudduquenoy2061 3 жыл бұрын
Musician extends Guitarist, Drummer could have used the last class perform() method (here Drummer) .. like with Mixins ?! It would have solved the DDD problem ? :)
@arnaudduquenoy2061
@arnaudduquenoy2061 3 жыл бұрын
So good tutos !
@Flutterly
@Flutterly 3 жыл бұрын
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
@arnaudduquenoy2061
@arnaudduquenoy2061 3 жыл бұрын
@@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 :)
@Flutterly
@Flutterly 3 жыл бұрын
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.
@arnaudduquenoy2061
@arnaudduquenoy2061 3 жыл бұрын
@@Flutterly Thank you WCKD :)
@kuroodo_
@kuroodo_ 2 жыл бұрын
4:35 Dart now let's you do super.name , for example Bird(super.name)
@thinkGrey_
@thinkGrey_ 3 жыл бұрын
Gem
@Flutterly
@Flutterly 3 жыл бұрын
🤍
@joemw8806
@joemw8806 3 жыл бұрын
Viewer 464(roughly);
@kasandrop
@kasandrop 3 жыл бұрын
I hardly ever see that any content creator provides their sources of information at the end of the tutorial.
@Flutterly
@Flutterly 3 жыл бұрын
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.
@kasandrop
@kasandrop 3 жыл бұрын
@@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.
@mqhamdam
@mqhamdam 2 жыл бұрын
the part with mixins was .............................................................................
@DavidGarcia-ej5cb
@DavidGarcia-ej5cb 3 жыл бұрын
Spanish Subs please
@Flutterly
@Flutterly 3 жыл бұрын
I'm sorry, they are auto-generated, and if KZbin decides they can't be generated, I can't do anything about it 😔
@RbyLearning
@RbyLearning 2 жыл бұрын
good content, but you are talking fast man
@flutter4525
@flutter4525 Жыл бұрын
please reply. in interface we have to override each and every method , thn what about implicit interface
Why Favor Object Composition Over Class Inheritance? A Deep Dive
19:00
РОДИТЕЛИ НА ШКОЛЬНОМ ПРАЗДНИКЕ
01:00
SIDELNIKOVVV
Рет қаралды 3,7 МЛН
这到底是怎么做到的 #路飞#海贼王
00:10
路飞与唐舞桐
Рет қаралды 3,5 МЛН
Watermelon magic box! #shorts by Leisi Crazy
00:20
Leisi Crazy
Рет қаралды 106 МЛН
She's very CREATIVE💡💦 #camping #survival #bushcraft #outdoors #lifehack
00:26
Protocol Or ABC In Python - When to Use Which One?
23:45
ArjanCodes
Рет қаралды 203 М.
Interface In Dart - Learn Dart Programming
23:32
Dart Tutorial
Рет қаралды 2,7 М.
Rust Powered Polymorphism ⚡️ With Traits
9:55
Code to the Moon
Рет қаралды 101 М.
The Flaws of Inheritance
10:01
CodeAesthetic
Рет қаралды 952 М.
Microservices are Technical Debt
31:59
NeetCodeIO
Рет қаралды 494 М.
РОДИТЕЛИ НА ШКОЛЬНОМ ПРАЗДНИКЕ
01:00
SIDELNIKOVVV
Рет қаралды 3,7 МЛН