Flutter ValueNotifier and ChangeNotifier Difference | State Management

Поділитися
Вставка
  • Опубліковано 14 жов 2024

КОМЕНТАРІ • 19

  • @corepuncher
    @corepuncher Місяць тому

    Is this method FOR SURE faster than using Provider with ChangeNotifier? I do have 1 or 2 very small provider widgets set up but they only handle one or two values. Of course code is less complex and I can remove from multiprovider at the top level but I only want to do it if there will be a clear performance increase? Thanks.

  • @meek6836
    @meek6836 2 роки тому +1

    Really nice video. When should we use ChangeNotifierBuilder and when valueNotifier?

    • @dbestech
      @dbestech  2 роки тому +3

      When you want to work a on single value change use valueNotifier. It makes your code faster to run, Since you only work on one widget to rebuild. It's bound to a widget, rather than whole widget tree.

    • @meek6836
      @meek6836 2 роки тому

      @@dbestech Thanks!

  • @fozaibx1
    @fozaibx1 Рік тому

    What if i want to use the value of the notifier in multiple screens? how can I do that?

  • @sbasalan
    @sbasalan 2 роки тому

    What exactly ValueNotifier provide us if we use it in our projects? Is that part clear in the video context? or missed

    • @dbestech
      @dbestech  2 роки тому +1

      It gives the chance to work with individual variable properly. In once one sense it's cleaner than changenotifier

    • @sbasalan
      @sbasalan 2 роки тому

      @@dbestech Thank you for your rapidly response. It is very useful then

    • @sbasalan
      @sbasalan 2 роки тому

      @@dbestech btw, how about Riverpod? Is it covering the same architecture?

  • @hendrysteven7834
    @hendrysteven7834 2 роки тому

    do you mind, Im trying to use cubit (watched your tutorial), and I am so confuse about applying it at the bottom navigation bar..

  • @legardemontcho6739
    @legardemontcho6739 5 місяців тому

    When people do tutorials, it's important to first explain the differences between ChangeNotifier, statefull and ValueNotifier. When will you suggest using ChangeNotifier and not ValueNotifier, for example?

    • @dbestech
      @dbestech  5 місяців тому

      www.dbestech.com/tutorials/differences-between-changenotifier,-statefulwidget,-and-valuenotifier-in-flutter-for-state-management

    • @legardemontcho6739
      @legardemontcho6739 5 місяців тому

      @@dbestech Your article is more theoretical than practical. A reader should be able to understand your explanations with practical examples. For example, how many builds happen when you use a Consummer (Provider) compared to a ValueListenable (ValueNotifier)?

    • @dbestech
      @dbestech  5 місяців тому +2

      @@legardemontcho6739 I have updated with examples now

    • @legardemontcho6739
      @legardemontcho6739 5 місяців тому

      @@dbestech Thank you for your additional comments. However, to perfect your article, I suggest you use a practical example of state management where the use of the ValueNotifier is limited. This example will help the reader understand what you mean by simple and complex.

    • @dbestech
      @dbestech  5 місяців тому +1

      @@legardemontcho6739 thanks, I will update it

  • @seangreen9590
    @seangreen9590 2 роки тому +1

    Its not clear

    • @dbestech
      @dbestech  2 роки тому

      Still not?

    • @seangreen9590
      @seangreen9590 2 роки тому

      @@dbestech yes and im sorry, ill try to rewach and see