flutter_provider_utilities

Creator: coderz1093

Last updated:

Add to Cart

Description:

flutter provider utilities

provider_utilities #
A set of utilities for provider package.
Mixins #
MessageNotifierMixin #
mixin to be user on a [ChangeNotifier] class
It provides two fields [error] and [info] and two methods [notifyError] and [notifyInfo]
Useful used in combination with [MessageListener] to display error or information messages to users
NotificationNotifierMixin #
mixin to be user on a [ChangeNotifier] class
It provides a method [notifyNotification]
Useful used in combination with [NotificationListener] to display in-app notifications
SafeNotifierMixin #
mixin to be user on a [ChangeNotifier] class
it provides a method [notifySafe] the can be called to [notifyListeners] in a safe manner
Useful when using [ChangeNotifier] in pages that can be dismisses or popped
Listeners #
MessageListener #
A listener for [ChangeNotifier] that extends [MessageNotifierMixin] mixin
Wrapping a widget with [MessageListener] will use [Scaffold.context] to show Snackbars called from the ChangeNotifier class with [notifyError] or [notifyInfo] methods
Useful to display error or information messages
As an example:
ChangeNotifierProvider.value(
value: _model,
child: Scaffold(
appBar: AppBar(),
body: MessageListener<Model>(
child: ListView()
)
)
);
copied to clipboard
NotificationListener #
A listener for [ChangeNotifier] that extends [NotificationNotifierMixin] mixin
Wrapping a widget with [NotificationListener] will display an [Overlay] called from the ChangeNotifier class with [notifyNotification]
Useful to display in-app notifications
As an example:
ChangeNotifierProvider.value(
value: _model,
child: Scaffold(
appBar: AppBar(),
body: NotificationListener<Model>(
child: ListView()
)
)
);
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files:

Customer Reviews

There are no reviews.