Dart 3 Class Modifiers Is kinda Confusing

Sdílet
Vložit
  • čas přidán 12. 05. 2023
  • Struggled a bit to understand Dart 3 Class modifiers. Let's learn about them and use them.
    Flutter Course: robertbrunhage.com
    Want to support me?
    ♥ Patreon: / robertbrunhage
    ♥ BuyMeACoffee: buymeacoffee.com/robertbrunhage
    ♥ Paypal: paypal.me/robertbrunhage
    ····················································································
    You can find me on:
    ● Website: robertbrunhage.com
    ● Twitter: / robertbrunhage
    ● Join our community: / discord
    ····················································································
    😎 Subscribe: bit.ly/2SUyRhx

Komentáře • 31

  • @icodeyoutodeath
    @icodeyoutodeath Před rokem +16

    This `abstract interface class` to say `interface` is such a weird thing. Wish we'd just call it an `interface` as in other languages.

    • @RobertBrunhage
      @RobertBrunhage  Před rokem +1

      Haha, please don't remind me

    • @draakisback
      @draakisback Před rokem +1

      Yeah it's kind of verbose. Abstract classes are supposed to sort of work like interfaces and now we have this interface keyword which is basically just a class level visibility/accessibility modifier. I don't know, I suppose it's because we're working with class based programming/OOP rather than procedural or imperative. It's strange, the records and the pattern matching features were implemented in a way that's very thoughtful but these were kind of haphazard in my opinion. On the other hand, darts version of OOP is pretty straightforward so it's not a big deal, just really don't see myself using any of these keywords apart from mixin and final. Maybe though this will open the door for other modifiers like immutable or case class.

  • @alexpol108
    @alexpol108 Před rokem +5

    Yes, please, highlight the new features of the Dart and Flutter, would be interesting

  • @pierrejoye
    @pierrejoye Před rokem +5

    you cannot instantiate interface. Interface are implementation-less definition of an object (its methods, its interface).
    I do like this short video, good summary.
    I would suggest to explain the 101 concept of OO and how it was implemented in flutter as well, maybe for another video :)

  • @jajasaria
    @jajasaria Před rokem

    always love how you explain things into simple ways. thanks for the video

  • @alexmercerind
    @alexmercerind Před měsícem +1

    I'm only studying these for interview. Sealed classes are fine, but others are just overkill now imo.

    • @RobertBrunhage
      @RobertBrunhage  Před měsícem

      Between all of these modifiers I using sealed classes 99% of the time

  • @sangamshrestha143
    @sangamshrestha143 Před rokem +2

    Thanks for the video. I am curious to know how you use debug point with that editor.

    • @RobertBrunhage
      @RobertBrunhage  Před rokem +1

      I haven't used the debugger like that for more than 2 years so in short, I don't.
      If I want to, I just use the debugger that comes with the flutter devtools

  • @artofnessa
    @artofnessa Před rokem +1

    Let's goooo!!!

  • @Abdurrahman98XX
    @Abdurrahman98XX Před rokem +2

    May i ask if coding in command line is any better of vscode (especially you have alot of keymaps customization or vim extension) ?

    • @RobertBrunhage
      @RobertBrunhage  Před rokem +4

      I guess for me, the defining factor are these for using NeoVim in the terminal:
      - More fun
      - Learning more about terminal usage/commands
      - Just feels more snappy
      So no, you will do completely fine on a normal editor. I just wanted to learn it, and then got stuck/loved it

  • @Landon_Hughes
    @Landon_Hughes Před rokem

    I come from Swift.
    I find all of this very confusing. What's the difference between a mixin and an interface?
    Even the dart documentation blurs the lines for me 😅

  • @RAFAELAGUIAR-nt3lt
    @RAFAELAGUIAR-nt3lt Před rokem +2

    It's cool, but I'm worried about all the bad code that this will generate, broken SOLID principles and so on. I still prefer to work with class.

  • @1234matthewjohnson
    @1234matthewjohnson Před rokem +2

    plz more

  • @saqqara6361
    @saqqara6361 Před rokem +2

    Great!!!

  • @pierrejoye
    @pierrejoye Před rokem +1

    interface is an interface. I am not sure why talking about extends etc. It is a common concept in all languages providing OO

    • @RobertBrunhage
      @RobertBrunhage  Před rokem +1

      Dart doesn't have normal interfaces as classes has implicit interfaces.
      The way we create interfaces before was just defining classes that we couldn't instantiate, which still has the problem that the class could be inherited from.
      Using the interface keyword makes it so the class is only being able to implement as an "interface".
      Such a pain, but it is what it is.

  • @silverhairs
    @silverhairs Před rokem +2

    `abstract interface class` ??? really? wth

    • @RobertBrunhage
      @RobertBrunhage  Před rokem +3

      abstract interface base sealed class

    • @gokuldas027
      @gokuldas027 Před rokem +1

      @@RobertBrunhage "Stop it, Patrick! You're Scaring Him!"

  • @cristianproust
    @cristianproust Před 7 měsíci

    You pronounce can and can't almost the same. It becomes confusing

  • @1234matthewjohnson
    @1234matthewjohnson Před rokem +1

    yew

  • @TechBuddy_
    @TechBuddy_ Před rokem

    You I didn't want this at all this just Java but worse atleast in Java you just do interface but now we say abstract interface class 🤮
    Edit: base classes and sealed classes are good enough though

    • @Abdurrahman98XX
      @Abdurrahman98XX Před rokem

      Switch to java then

    • @TechBuddy_
      @TechBuddy_ Před rokem

      @@Abdurrahman98XX 😂😂 that's a fantastic response lol. But I can just ignore interfaces and just use abstract classes as I am used to.

  • @baggern
    @baggern Před rokem

    I think Dart SDK, the technical implementation is good, but my god Dart is such a badly designed language

  • @ikerborja1082
    @ikerborja1082 Před rokem +1

    what a terrible explanation