<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Eman Hamad</title>
    <description>The latest articles on DEV Community by Eman Hamad (@eman55555).</description>
    <link>https://dev.to/eman55555</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F585446%2F86369636-0ba9-483a-9b55-1f04e9e3f4c1.jpeg</url>
      <title>DEV Community: Eman Hamad</title>
      <link>https://dev.to/eman55555</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/eman55555"/>
    <language>en</language>
    <item>
      <title>Provider State Management in Flutter - Part 2</title>
      <dc:creator>Eman Hamad</dc:creator>
      <pubDate>Tue, 02 Aug 2022 13:42:00 +0000</pubDate>
      <link>https://dev.to/eman55555/provider-state-management-in-flutter-part-2-29ki</link>
      <guid>https://dev.to/eman55555/provider-state-management-in-flutter-part-2-29ki</guid>
      <description>&lt;p&gt;&lt;strong&gt;First of all :&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;i recommend you to read part 1:&lt;br&gt;
&lt;a href="https://dev.to/eman55555/provider-state-management-in-flutter-part-1-e4k"&gt;https://dev.to/eman55555/provider-state-management-in-flutter-part-1-e4k&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;In Part 1 we have seen only single provider implementation.&lt;/strong&gt;&lt;strong&gt;What about having  multiple providers declared in your flutter app ?&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;using provider you can expose the data and can observe it with the help of &lt;code&gt;consumer&lt;/code&gt;through out your app.This will make a easy to access user friendly data usage. Flutter &lt;code&gt;Multiprovider&lt;/code&gt;is required to handle some situations where we require different data objects or depending upon the modules so in this article we will be dealing with a example on them. Using the provider you can avoid all the unnecessary data hierarchies and can just make use of the data where ever required and also can properly dispose them after use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Ok let's make an app have 2 screens .each of them uses different Provider like this :&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KiakO6gG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3bcpcplny30h25bn9r0y.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KiakO6gG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3bcpcplny30h25bn9r0y.PNG" alt="Image description" width="343" height="723"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Vd9lKevM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r0p8vsiwiio2sqnuiitt.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Vd9lKevM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r0p8vsiwiio2sqnuiitt.PNG" alt="Image description" width="350" height="715"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;add the dependency for the provider pattern in the pubspec.yaml file.&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;flutter pub add provider&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dependencies:
  flutter:
    sdk: flutter
  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.2
  provider: ^6.0.3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;create your first model and add methods to increment / decrement / reset the counter, extend &lt;code&gt;ChangeNotifier&lt;/code&gt; from the material.dart package. This provides us with the &lt;code&gt;notifyListeners()&lt;/code&gt; method, and will notify all the listeners whenever we change a value.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:flutter/material.dart';

class Counter with ChangeNotifier {
  int count = 0;
 //int get myCounter() =&amp;gt; count;

  void incrementCounter() {
    count++;
    notifyListeners();
  }

   void decrementCounter() {
    if (count &amp;gt; 0) {
      count--;
    }
    notifyListeners();
  }

   void resetCounter() {
    count=0;
    notifyListeners();
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;create your second model and add a method to add item to   &lt;code&gt;List&amp;lt;String&amp;gt; _cart = ["Red", "Green", "Blue"]&lt;/code&gt; , extend &lt;code&gt;ChangeNotifier&lt;/code&gt; from the material.dart package. This provides us with the &lt;code&gt;notifyListeners()&lt;/code&gt; method, and will notify all the listeners whenever we change a value.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:flutter/material.dart';

class Cart with ChangeNotifier {
  final List&amp;lt;String&amp;gt; _cart = ["Red", "Green", "Blue"];
  int get count =&amp;gt; _cart.length;
  List&amp;lt;String&amp;gt; get cart =&amp;gt; _cart;



  void addItem(String item) {
    _cart.add(item);
    notifyListeners();
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;wrap your home widget with &lt;code&gt;MultiProvider&lt;/code&gt; and inside it call &lt;code&gt;ChangeNotifierProvider&amp;lt;YOUR_MODEL_NAME&amp;gt;&lt;/code&gt; widget to every model&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;void main() {

  runApp(

    MultiProvider(

      providers:[
          ChangeNotifierProvider&amp;lt;Counter&amp;gt;(create: (_)=&amp;gt;Counter(),),
          ChangeNotifierProvider&amp;lt;Cart&amp;gt; (create: (_)=&amp;gt;Cart(),),

    ],
    child: MyApp(),
    ),

  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;add &lt;code&gt;routes&lt;/code&gt; in your MaterialApp widget&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@override
  Widget build(BuildContext context) {
    return 
       MaterialApp(
        title: 'Flutter Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),

        initialRoute: '/',
        routes: {
        '/' : (context) =&amp;gt; HomePage(),
        '/second' :(context) =&amp;gt; Second()


      },
      );
  }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;To update the text, call your variables and function from Your model to use them&lt;br&gt;
wrap your text widget with &lt;code&gt;Consumer&amp;lt;YOUR_MODEL_NAME&amp;gt;&lt;/code&gt; widget&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@override
  Widget build(BuildContext context) {
    return Consumer&amp;lt;Counter&amp;gt;(
      builder: (context, counter, child) {
        return Scaffold(
          appBar: AppBar(
            title: Text('Home'),
          ),
          body: Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                // Text('${cart.cart}'),
                // Text('${context.watch&amp;lt;Cart&amp;gt;().cart}'),
                Row(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    const Text('The Number : '),
                    // Text('${context.watch&amp;lt;Counter&amp;gt;().count}'),
                    Text('${counter.count}',
                        style: const TextStyle(
                            fontWeight: FontWeight.bold, fontSize: 20)),
                  ],
                ),


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Source Code&lt;/strong&gt;: branch  " &lt;u&gt;&lt;code&gt;multiProvider&lt;/code&gt;&lt;/u&gt; "&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/eman55555"&gt;
        eman55555
      &lt;/a&gt; / &lt;a href="https://github.com/eman55555/provider_state_management"&gt;
        provider_state_management
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;read this article for more details :&lt;/p&gt;
&lt;p&gt;Dev : &lt;a href="https://dev.to/eman55555/provider-state-management-in-flutter-part-1-e4k" rel="nofollow"&gt;https://dev.to/eman55555/provider-state-management-in-flutter-part-1-e4k&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Medium : &lt;a href="https://medium.com/@emanhamad55555/provider-state-management-in-flutter-part-1-b3fcb9fd2226" rel="nofollow"&gt;https://medium.com/@emanhamad55555/provider-state-management-in-flutter-part-1-b3fcb9fd2226&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
provider_state_management&lt;/h1&gt;
&lt;p&gt;A new Flutter project.&lt;/p&gt;
&lt;h2&gt;
Getting Started&lt;/h2&gt;
&lt;p&gt;This project is a starting point for a Flutter application.&lt;/p&gt;
&lt;p&gt;A few resources to get you started if this is your first Flutter project:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.flutter.dev/get-started/codelab" rel="nofollow"&gt;Lab: Write your first Flutter app&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.flutter.dev/cookbook" rel="nofollow"&gt;Cookbook: Useful Flutter samples&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For help getting started with Flutter development, view the
&lt;a href="https://docs.flutter.dev/" rel="nofollow"&gt;online documentation&lt;/a&gt;, which offers tutorials,
samples, guidance on mobile development, and a full API reference.&lt;/p&gt;
&lt;/div&gt;

  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/eman55555/provider_state_management"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;&lt;em&gt;&lt;strong&gt;Congratulations 🥳🤩&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
&lt;em&gt;&lt;strong&gt;you implemented multiProvider in Flutter Counter App !&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>provider</category>
      <category>dart</category>
    </item>
    <item>
      <title>Provider State Management in Flutter - Part 1</title>
      <dc:creator>Eman Hamad</dc:creator>
      <pubDate>Sun, 24 Jul 2022 16:41:00 +0000</pubDate>
      <link>https://dev.to/eman55555/provider-state-management-in-flutter-part-1-e4k</link>
      <guid>https://dev.to/eman55555/provider-state-management-in-flutter-part-1-e4k</guid>
      <description>&lt;p&gt;&lt;u&gt;&lt;strong&gt;&lt;em&gt;Why state management is important ?&lt;/em&gt;&lt;/strong&gt;&lt;/u&gt;&lt;br&gt;&lt;br&gt;
Application state management is the process of maintaining knowledge of an application's inputs across multiple related data flows that form a complete business transaction or a session to understand the condition of the app at any given moment. In computer science, an input is information put into the program by the user and state refers to the condition of an application according to its stored inputs saved as variables or constants. State can also be described as the collection of preserved information that forms a complete session .So, without some form of state management. the performance of the application will reduce.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;Benefits of State-Management:&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;1-&lt;/strong&gt; The State of the Whole Application is present at a single place, so we do not need to access the single state or data from different places.&lt;br&gt;
&lt;strong&gt;2-&lt;/strong&gt;It reduces the HTTP requests sent to the back-end for fetching and retrieval of the data.&lt;br&gt;
&lt;strong&gt;3-&lt;/strong&gt; helps to centralize and made the maintenance of code very easy, also it improves the quality of code, by reducing the code size and making it more readable .&lt;br&gt;
&lt;strong&gt;&lt;u&gt;&lt;br&gt;
&lt;em&gt;&lt;u&gt;Then ,I should use state management in every app ,That's right ?&lt;/u&gt;&lt;/em&gt;&lt;/u&gt;&lt;/strong&gt;&lt;br&gt;
we can't say that.&lt;br&gt;
 if : the data of app is little and the app is small =&amp;gt; you shouldn't use state management .&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;what is provider ?&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
The provider package is easy to use which is basically a wrapper around the Inherited Widgets that makes it easier to use and manage. It provides a state management technique that is used for managing a piece of data around the app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt; Let's create app and Learn How to implement Provider on default counter app ?&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;flutter create provider_state_management&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;add the dependency for the provider pattern in the pubspec.yaml file.&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;flutter pub add provider&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dependencies:
  flutter:
    sdk: flutter
  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.2
  provider: ^6.0.3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;create your model and add a method to increment the counter, extend &lt;code&gt;ChangeNotifier&lt;/code&gt; from the material.dart package. This provides us with the &lt;code&gt;notifyListeners()&lt;/code&gt; method, and will notify all the listeners whenever we change a value.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:flutter/material.dart';

class Counter with ChangeNotifier {
  int counter = 0;
  // int get_Counter() =&amp;gt; counter;

  void incrementCounter() {
    counter++;
    notifyListeners();
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;wrap your home / materialApp widget with &lt;code&gt;ChangeNotifierProvider&amp;lt;YOUR_MODEL_NAME&amp;gt;&lt;/code&gt; widget&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@override
  Widget build(BuildContext context) {
    return  ChangeNotifierProvider&amp;lt;Counter&amp;gt;(
       create: (context) =&amp;gt; Counter(),
      child: MaterialApp(
        title: 'Flutter Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home:MyHomePage(),
    ),
    );
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;To update the text, call your variables and function from Your model to use them&lt;br&gt;
wrap your text widget with &lt;code&gt;Consumer&amp;lt;YOUR_MODEL_NAME&amp;gt;&lt;/code&gt; widget&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  Consumer&amp;lt;Counter&amp;gt;(
              builder:(context, count, child) =&amp;gt; Text(
                '${count.counter}',
                style: Theme.of(context).textTheme.headline4,
              )
            ),
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Source Code&lt;/strong&gt;: branch  " &lt;u&gt;&lt;code&gt;master&lt;/code&gt;&lt;/u&gt; "&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/eman-hamad" rel="noopener noreferrer"&gt;
        eman-hamad
      &lt;/a&gt; / &lt;a href="https://github.com/eman-hamad/provider_state_management" rel="noopener noreferrer"&gt;
        provider_state_management
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;read this article for more details :&lt;/p&gt;
&lt;p&gt;Part 1&lt;/p&gt;
&lt;p&gt;Dev : &lt;a href="https://lnkd.in/dHZJs5sC" rel="nofollow noopener noreferrer"&gt;https://lnkd.in/dHZJs5sC&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Medium : &lt;a href="https://lnkd.in/dgeqiM86" rel="nofollow noopener noreferrer"&gt;https://lnkd.in/dgeqiM86&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Part 2&lt;/p&gt;
&lt;p&gt;Dev : &lt;a href="https://lnkd.in/eVZx82Av" rel="nofollow noopener noreferrer"&gt;https://lnkd.in/eVZx82Av&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Medium : &lt;a href="https://lnkd.in/evtQVtws" rel="nofollow noopener noreferrer"&gt;https://lnkd.in/evtQVtws&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;provider_state_management&lt;/h1&gt;

&lt;/div&gt;

&lt;p&gt;A new Flutter project.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Getting Started&lt;/h2&gt;

&lt;/div&gt;

&lt;p&gt;This project is a starting point for a Flutter application.&lt;/p&gt;

&lt;p&gt;A few resources to get you started if this is your first Flutter project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.flutter.dev/get-started/codelab" rel="nofollow noopener noreferrer"&gt;Lab: Write your first Flutter app&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.flutter.dev/cookbook" rel="nofollow noopener noreferrer"&gt;Cookbook: Useful Flutter samples&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For help getting started with Flutter development, view the
&lt;a href="https://docs.flutter.dev/" rel="nofollow noopener noreferrer"&gt;online documentation&lt;/a&gt;, which offers tutorials,
samples, guidance on mobile development, and a full API reference.&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/eman-hamad/provider_state_management" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;&lt;em&gt;&lt;strong&gt;Congratulations 🥳🤩&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
&lt;em&gt;&lt;strong&gt;you implemented Provider in Default Flutter Counter App !&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;run:&lt;/strong&gt;  &lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://www.google.com/imgres?imgurl=https://bloclibrary.dev/assets/gifs/flutter_counter.gif&amp;amp;imgrefurl=https://pub.dev/packages/flutter_bloc&amp;amp;tbnid=zlVzL6nVJ1sy9M&amp;amp;vet=1&amp;amp;docid=kJbqyBilXF0_pM&amp;amp;w=320&amp;amp;h=632&amp;amp;source=sh/x/im" rel="noopener noreferrer"&gt;
      google.com
    &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;Ok , what is difference between ValueNotifier , ChangeNotifier  and StateNotifier ?&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;ValueNotifier&lt;/code&gt;is a special type of class that extends &lt;code&gt;Changenotifier&lt;/code&gt;, which can hold a single value and notifies the widgets which are listening to it whenever its holding value gets change.&lt;br&gt;
&lt;code&gt;ChangeNotifier&lt;/code&gt;is a class that provides change notification to its listeners. That means you can subscribe to a class that is extended or mixed in with &lt;code&gt;ChangeNotifier&lt;/code&gt;and call its &lt;code&gt;notifyListeners()&lt;/code&gt; method when there’s a change in that class. This call will notify the widgets that are subscribed to this class to rebuild.&lt;br&gt;
On the other hand, &lt;code&gt;StateNotifier&lt;/code&gt; is an immutable state management solution where the state can be directly changed within the notifier only.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;So, We can implement &lt;code&gt;ValueNotifier&lt;/code&gt;on the same counter app&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source Code&lt;/strong&gt;: branch  " &lt;u&gt;&lt;code&gt;Value_Notifier&lt;/code&gt;&lt;/u&gt; "&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/eman-hamad" rel="noopener noreferrer"&gt;
        eman-hamad
      &lt;/a&gt; / &lt;a href="https://github.com/eman-hamad/provider_state_management" rel="noopener noreferrer"&gt;
        provider_state_management
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;read this article for more details :&lt;/p&gt;
&lt;p&gt;Part 1&lt;/p&gt;
&lt;p&gt;Dev : &lt;a href="https://lnkd.in/dHZJs5sC" rel="nofollow noopener noreferrer"&gt;https://lnkd.in/dHZJs5sC&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Medium : &lt;a href="https://lnkd.in/dgeqiM86" rel="nofollow noopener noreferrer"&gt;https://lnkd.in/dgeqiM86&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Part 2&lt;/p&gt;
&lt;p&gt;Dev : &lt;a href="https://lnkd.in/eVZx82Av" rel="nofollow noopener noreferrer"&gt;https://lnkd.in/eVZx82Av&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Medium : &lt;a href="https://lnkd.in/evtQVtws" rel="nofollow noopener noreferrer"&gt;https://lnkd.in/evtQVtws&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;provider_state_management&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;A new Flutter project.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Getting Started&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;This project is a starting point for a Flutter application.&lt;/p&gt;
&lt;p&gt;A few resources to get you started if this is your first Flutter project:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.flutter.dev/get-started/codelab" rel="nofollow noopener noreferrer"&gt;Lab: Write your first Flutter app&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.flutter.dev/cookbook" rel="nofollow noopener noreferrer"&gt;Cookbook: Useful Flutter samples&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For help getting started with Flutter development, view the
&lt;a href="https://docs.flutter.dev/" rel="nofollow noopener noreferrer"&gt;online documentation&lt;/a&gt;, which offers tutorials,
samples, guidance on mobile development, and a full API reference.&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/eman-hamad/provider_state_management" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


</description>
      <category>flutter</category>
      <category>provider</category>
      <category>statemanagement</category>
      <category>dart</category>
    </item>
  </channel>
</rss>
