error_notifier_for_provider

Last updated:

0 purchases

error_notifier_for_provider Image
error_notifier_for_provider Images
Add to Cart

Description:

error notifier for provider

error_notifier_for_provider #
A trick to notify errors in ChangeNotifier/ValueNotifier/StateNotifier.
No more GlobalKey<Scaffold>!
Provider(
create (_) => YourObjectWithErrorNotifierMixin(),
child: Scaffold(
body: ErrorListener(
onNotify: (context, message) => Scaffold.of(context).showSnackbar(
Snackbar(content: Text(message))
)
child: YourContent(),
),
),
);
copied to clipboard
Pros #

Easy to use
You can use it with ChangeNotifier/ValueNotifier/StateNotifier and any other provided objects.

Motivation #
ChangeNotifier/ValueNotifier/StateNotifier can notify and reflect its state to other object.
But it's for UI, not the one shot notification like an error notification.
error_notifier_for_provider provides another path to notify something.

License:

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

Files In This Product:

Customer Reviews

There are no reviews.