Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kikuchy/error_notifier_for_provider
A trick to notify errors in ChangeNotifier/ValueNotifier/StateNotifier.
https://github.com/kikuchy/error_notifier_for_provider
dart flutter
Last synced: 20 days ago
JSON representation
A trick to notify errors in ChangeNotifier/ValueNotifier/StateNotifier.
- Host: GitHub
- URL: https://github.com/kikuchy/error_notifier_for_provider
- Owner: kikuchy
- License: mit
- Created: 2020-08-30T15:12:09.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-04T17:00:59.000Z (almost 4 years ago)
- Last Synced: 2024-12-20T05:02:57.722Z (24 days ago)
- Topics: dart, flutter
- Language: Dart
- Homepage: https://pub.dev/packages/error_notifier_for_provider
- Size: 58.6 KB
- Stars: 10
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# error_notifier_for_provider
A trick to notify errors in ChangeNotifier/ValueNotifier/StateNotifier.
No more `GlobalKey`!```dart
Provider(
create (_) => YourObjectWithErrorNotifierMixin(),
child: Scaffold(
body: ErrorListener(
onNotify: (context, message) => Scaffold.of(context).showSnackbar(
Snackbar(content: Text(message))
)
child: YourContent(),
),
),
);
```## 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.