ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก

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...

ความคิดเห็น • 70

  • @Flutterly
    @Flutterly  2 ปีที่แล้ว +5

    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 ปีที่แล้ว +10

    Man ... the quality of this turorial series is somethings else, so professional ... hat off to you.

    • @Flutterly
      @Flutterly  3 ปีที่แล้ว +1

      Thank you so much brother, the best is yet to come! ✨

  • @OttoAkama
    @OttoAkama 3 ปีที่แล้ว +4

    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 ปีที่แล้ว +1

      Haha, thank you so much! I'm glad I could help you! 🌟

  • @gumdum6764
    @gumdum6764 3 ปีที่แล้ว +2

    😳 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! ✨

  • @MadeInPython
    @MadeInPython 6 หลายเดือนก่อน

    These videos are way more helpful than Dart's own official documentation. Thank you for explaining everything so clearly.

  • @azackmatoff2570
    @azackmatoff2570 2 ปีที่แล้ว +2

    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  2 ปีที่แล้ว

      Thank you so much! ✨

  • @antoniodominikovic7496
    @antoniodominikovic7496 3 ปีที่แล้ว +4

    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 ปีที่แล้ว +2

      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.

  • @sharbelokzan9673
    @sharbelokzan9673 3 ปีที่แล้ว +6

    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 ปีที่แล้ว +2

      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!

  • @YTarikKalyoncu
    @YTarikKalyoncu 3 ปีที่แล้ว +2

    I never better understanding on mixins and abstract classes. Thank you 💖

    • @Flutterly
      @Flutterly  3 ปีที่แล้ว

      You're welcome, mate! I'm glad I could help! ✨

  • @distributedchaos5129
    @distributedchaos5129 2 ปีที่แล้ว

    Thank you very much for being so thorough and systematic with these tutorials. These are God tier. 🤟

  • @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 😁

  • @akshaywaghe7327
    @akshaywaghe7327 3 ปีที่แล้ว +2

    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 ปีที่แล้ว +1

      Thank you, man, I really appreciate it!

  • @Akua-hx3rb
    @Akua-hx3rb 29 วันที่ผ่านมา

    Absolutely fantastic video. Thank you so much! :)

  • @yecoof
    @yecoof ปีที่แล้ว

    Excellent presentation, hello from Türkiye!

  • @leandroacevedo3339
    @leandroacevedo3339 3 ปีที่แล้ว +1

    Bravo. Best explanation of these important concepts!

    • @Flutterly
      @Flutterly  3 ปีที่แล้ว

      Thank you so much, mate! 🌟

  • @michaelappiah-kubi2829
    @michaelappiah-kubi2829 ปีที่แล้ว

    So well explained, thanks man!

  • @Sanjay54251
    @Sanjay54251 2 ปีที่แล้ว

    Simply Awesome i have no word to say thanks, 😀😀😀😀😀😀😀😀😀😀😀😀😀

  • @lerazy2376
    @lerazy2376 ปีที่แล้ว

    Thanks for this masterpiece tutorial ❤ really helps a lot

  • @AyushPanditofficial
    @AyushPanditofficial 3 ปีที่แล้ว +1

    Bro thanks bro for sharing knowledge

    • @Flutterly
      @Flutterly  3 ปีที่แล้ว

      You're welcome, brother!

  • @ali-cu1ne
    @ali-cu1ne 2 หลายเดือนก่อน

    thanks alot great series

  • @elkokle4333
    @elkokle4333 ปีที่แล้ว

    0:06 Yes, I having a great day because of you, bro :3

  • @gayratbeshimov9533
    @gayratbeshimov9533 2 ปีที่แล้ว +1

    Thanks

  • @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 :)

  • @fluttermdev4444
    @fluttermdev4444 3 ปีที่แล้ว +1

    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.

  • @bodehallak1552
    @bodehallak1552 2 ปีที่แล้ว

    Thank you very much for your efforts, you're awesome man. love ya

  • @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

  • @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.

  • @officialismailshah
    @officialismailshah 2 ปีที่แล้ว +1

    amazing video❤❤❤❤❤❤❤❤

    • @Flutterly
      @Flutterly  2 ปีที่แล้ว

      Thank you 🤍🤍🤍

  • @vishal-val
    @vishal-val 4 หลายเดือนก่อน

    Can we achieve Abstraction concept by using extends keyword ?

  • @md.ruhulamin7963
    @md.ruhulamin7963 3 ปีที่แล้ว +1

    Thank you sir.

    • @Flutterly
      @Flutterly  3 ปีที่แล้ว

      Thank you, Rahul! ✨

  • @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

  • @ParabTarak
    @ParabTarak ปีที่แล้ว

    The best

  • @mr.pradana1273
    @mr.pradana1273 3 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      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

  • @user-cy6cx1bo5e
    @user-cy6cx1bo5e ปีที่แล้ว

    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

    • @user-cy6cx1bo5e
      @user-cy6cx1bo5e ปีที่แล้ว

      I love your explanations, I have to learn English really fast

  • @thinkGrey_
    @thinkGrey_ 3 ปีที่แล้ว +1

    Gem

  • @arnaudduquenoy2061
    @arnaudduquenoy2061 3 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      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 ปีที่แล้ว +1

      @@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 ปีที่แล้ว +1

      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)

  • @joemw8806
    @joemw8806 3 ปีที่แล้ว +1

    Viewer 464(roughly);

  • @kasandrop
    @kasandrop 3 ปีที่แล้ว +2

    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 ปีที่แล้ว +1

      @@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 ปีที่แล้ว +1

    Spanish Subs please

    • @Flutterly
      @Flutterly  3 ปีที่แล้ว +1

      I'm sorry, they are auto-generated, and if TH-cam decides they can't be generated, I can't do anything about it 😔

  • @cscs6587
    @cscs6587 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