Create a Flutter app with two tabs that communicate via state.
Details
The app should build off of the app from the last activity by adding the following:
the class
CountModel
that extendsChangeNotifier
, defined in a separate file, that represents the number of times the button has been pressed. The class should define a mutator methodincrement
that modifies the model’s state and notifies listeners.a
ChangeNotifierProvider
to the parent widget.a
Consumer
widget to the tab that displays the count.a call to the
Provider.of
function in the button tap handler to update the model without rebuilding the button.