InheritedModel (Flutter Widget of the Week)

Поделиться
HTML-код
  • Опубликовано: 19 ноя 2018
  • InheritedModel works just like InheritedWidget, except that when descendants inherit from it, they specify which data they care about! InheritedModel also handles rebuilds individually and only when necessary, whether your widget needs to store two colors, or a dozen live network connections. Try it out!
    Learn more about InheritedWidget → bit.ly/2zWmmuo
    Learn more about InheritedModel → bit.ly/2DnIAZv
    Get more tips! → bit.ly/2B8M3vG
    Subscribe! → bit.ly/googledevs
    This video is also subtitled in Chinese, Indonesian, French, German, Japanese, Korean, Portuguese, and Spanish.
  • НаукаНаука

Комментарии • 35

  • @Hell2Night
    @Hell2Night 5 лет назад +17

    Your video series are gold mines, some widget are hard to find, and you do not always know what you're looking for.
    Thanks for that, I hope this serie and the 101, will continue.

    • @galihriskipratama3631
      @galihriskipratama3631 2 года назад

      its coming from google, the one who makes flutter, ofc it'll have a good and informatic videos about the product

  • @KevinSheppard
    @KevinSheppard 5 лет назад +45

    A bit complicated but I'm sure it'll be clear once I do a practical

    • @crossfade7112
      @crossfade7112 3 года назад +2

      I gave up half way. I will try it another day🙄

  • @rjevangelista9769
    @rjevangelista9769 4 года назад +4

    I'm familiarizing all flutter widgets by watching *Flutter Widget of the Week* by sequence. I do some little experiment after watching each videos. Now I got stuck to this InhertedModel widget. I'll skip it for now and come back later once I have the deep understanding on Flutter framework. I feel that this widget plays an important role on complex Flutter projects.

    • @shubhammittal9764
      @shubhammittal9764 4 года назад +2

      I think the new Provider package substitutes the need for this widget now for newcomers.

    • @rjevangelista9769
      @rjevangelista9769 4 года назад +1

      @@shubhammittal9764 thanks in advance, I'll note that.

    • @ValdaXD
      @ValdaXD 3 года назад

      InheritedModel is really OP if done nicely. You get fine grained control over the rebuilds.

  • @nakshatranahar
    @nakshatranahar 5 лет назад +2

    nice work google

  • @user-sl7oc7tg4t
    @user-sl7oc7tg4t Год назад

    This is what I have been looking for!

  • @nakshatranahar
    @nakshatranahar 5 лет назад +5

    I thought that its really a cool idea of a widget

  • @emumair
    @emumair 3 года назад +2

    This is sort of difficult to understand on first go. But I'm sure this would prove handy when required.

  •  Год назад +1

    Music and animations make it look fun and easy. But I'm pulling my hair out. Oh well. Just need to keep grinding. I'll get there...

  • @Murtaza-ik8ub
    @Murtaza-ik8ub Год назад +1

    Ah, another state management option. Good to know about it, but I 'll just stick to Provider for now.

  • @gourav7315
    @gourav7315 4 года назад +5

    We are waiting for Flutter Web Stable version

    • @iammusalman
      @iammusalman 3 года назад +1

      its stable now . whats your plan to do hanh? :P

  • @baneneba3477
    @baneneba3477 2 года назад

    is it like to context on react ?

  • @StefanBlosDev
    @StefanBlosDev 5 лет назад +5

    Very useful but how does this differ from ScopedModel?

    • @PascalWelsch
      @PascalWelsch 5 лет назад +1

      ScopedModel, like InheritedWidget rebuilds your Widget for any change. InhertitedModel only rebuilds when the "aspect" changes.

    • @raveeshdotme
      @raveeshdotme 5 лет назад +6

      Scoped model solves a different problem. InheritedWidget/InheritedModel ancestors can only subscribe to the data, but not change it(not directly at least). Ancestors of Scoped Model can also change the data they subscribe to.

    • @sonxuannguyen1207
      @sonxuannguyen1207 2 года назад

      From the pragmatic state video from Google, Scoped Model: The state of a specific widget A has to be passed down through many descendants to arrive the leaf widget F, then if state changes, myriads in the branch will get rebuilt (but u actually only want the widget F to get rebuilt).

  • @aarushnagar3062
    @aarushnagar3062 5 лет назад +3

    Hey google. India loves you

  • @g46psk
    @g46psk 5 лет назад +1

    not really useful to my work since my design is to stay away from the inheritent bloating classes like i used to face in java or c#

    • @bazoozoo1186
      @bazoozoo1186 4 года назад +3

      it is not about class inheritance at all.
      nested widgets are not inherited from theirs ancestor container.
      it is kinda bad name they choose that causes "anti-inheritance seizure" for some people.
      I think a word like "composite" would be a better match.

  • @raveeshdotme
    @raveeshdotme 5 лет назад

    This is new

  • @opal6605
    @opal6605 4 года назад

    way better than react

  • @kirill4531
    @kirill4531 4 года назад +5

    Apparently Provider package is recommended over inherited widgets/models

    • @kirill4531
      @kirill4531 4 года назад

      @@emilyfortuna2262 build my own provider? Thanks but no))
      I fully trust and rely on Rémi Rousselet 😁
      P.S. I agree that we need to know how it's built and how such pattern works in Flutter

    • @ValdaXD
      @ValdaXD 3 года назад

      Provider and Riverpod are mostly overkill for some apps. And if done badly they can bloat code/affect performance.
      But if it works for you. Then good ;D

  • @lexibigcheese
    @lexibigcheese 5 лет назад +5

    0:42 demonetized.

    • @ShivamJha00
      @ShivamJha00 4 года назад

      Why?

    • @lexibigcheese
      @lexibigcheese 4 года назад

      @@ShivamJha00 it's the demonetized icon, the yellow filled circle with a dollar symbol in the middle.