title: About ChangeNotifier Provider
body: <p>I am managing state using provider but ChangeNotifierProvider does not change the value of variable.
  I want to show progress indicator when user is registering. But ChangeNotifierProvider does not provide me update value rather it always return me <code>_isLoading = false;</code>
  My Code:</p>
  <p>AuthServices.dart</p>
  <pre><code>class AuthServices with ChangeNotifier {
    bool _isLoading = false;
  
    bool get loading =&gt; _isLoading;
  
    ///Register User
    Future registerUser(
        {@required String email, @required String password}) async {
      try {
        _isLoading = true;
        notifyListeners();
  
        await http.post(
            BackEndConfigs.baseUrl +
                BackEndConfigs.version +
                BackEndConfigs.auth +
                EndPoints.register,
            body: {
              &quot;email&quot;: email,
              &quot;password&quot;: password
            }).then((http.Response response) {
          _isLoading = false;
          notifyListeners();
          return RegisterUser.fromJson(json.decode(response.body));
        });
      } catch (e) {
        print(e);
      }
    }
  }
  </code></pre>
  <p>RegisterScreen.dart</p>
  <pre><code>class RegisterScreen extends StatefulWidget {
    @override
    _RegisterScreenState createState() =&gt; _RegisterScreenState();
  }
  
  class _RegisterScreenState extends State&lt;RegisterScreen&gt; {
    AuthServices _authServices = AuthServices();
    ProgressDialog pr;
    @override
    Widget build(BuildContext context) {
      pr = ProgressDialog(context, isDismissible: true);
      // print(status.loading);
  
      return Scaffold(
        appBar:
            customAppBar(context, title: 'Register Yourself', onPressed: () {}),
        body: _getUI(context),
      );
    }
  
    Widget _getUI(BuildContext context) {
      return LoadingOverlay(
        isLoading: false,
        child: Padding(
          padding: const EdgeInsets.symmetric(horizontal: 20.0),
          child: SingleChildScrollView(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.start,
              children: [
                VerticalSpace(10.0),
                GreyBoldText('Account Information'),
                VerticalSpace(20.0),
                IconsButtonRow([
                  Icon(
                    FontAwesomeIcons.linkedinIn,
                    color: Color(0xff0e76a8),
                  ),
                  Icon(
                    FontAwesomeIcons.facebook,
                    color: Color(0xff3b5998),
                  ),
                  Icon(
                    FontAwesomeIcons.google,
                    color: Color(0xff4285F4),
                  ),
                ]),
                VerticalSpace(10.0),
                GreyNormalText('or sign up with Email'),
                VerticalSpace(10.0),
                BlackBoldText(&quot;Email&quot;),
                AppTextField(
                  label: 'Email',
                ),
                BlackBoldText(&quot;Password&quot;),
                AppTextField(
                  label: 'Password',
                ),
                BlackBoldText(&quot;Confirm Password&quot;),
                AppTextField(
                  label: 'Confirm Password',
                ),
                VerticalSpace(20.0),
                ChangeNotifierProvider(
                  create: (_) =&gt; AuthServices(),
                  child: Consumer(
                    builder: (context, AuthServices user, _) {
                      return Text(user.loading.toString());
                    },
                  ),
                ),
                AppButton(
                    buttonText: 'Next',
                    onPressed: () async {
                      // await pr.show();
                      _registerNewUser();
                    }),
                VerticalSpace(30.0),
                ToggleView(ToggleViewStatus.SignUpScreen),
                VerticalSpace(20.0),
              ],
            ),
          ),
        ),
      );
    }
  
    _registerNewUser() async {
      _authServices.registerUser(
          email: 'sdjfkldsdf@ssdfdsddfdgsffd.com', password: 'sldjsdfkls');
    }
  }
  </code></pre>
  <p>main.dart</p>
  <pre><code>void main() async {
    WidgetsFlutterBinding.ensureInitialized();
    runApp(MyApp());
  }
  
  class MyApp extends StatelessWidget {
    // This widget is the root of your application.
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        theme: ThemeData(
            scaffoldBackgroundColor: Colors.white,
            hintColor: FrontEndConfigs.hintColor,
            cursorColor: FrontEndConfigs.hintColor,
            fontFamily: 'Gilory'),
        home: RegisterScreen(),
      );
    }
  }
  </code></pre>