Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/calsranna/creator_watcher
A widget wrap creator's watcher which is simple to use especially for emitter.
https://github.com/calsranna/creator_watcher
Last synced: about 1 month ago
JSON representation
A widget wrap creator's watcher which is simple to use especially for emitter.
- Host: GitHub
- URL: https://github.com/calsranna/creator_watcher
- Owner: CalsRanna
- License: mit
- Created: 2022-12-25T15:39:12.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-11T02:41:14.000Z (almost 2 years ago)
- Last Synced: 2023-12-04T12:48:06.359Z (about 1 year ago)
- Language: Dart
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Creator Watcher
A widget wrap creator's watcher which is simple to use especially for emitter.
## Install
```bash
flutter pub add creator_watcher
```## Getting started
This widget can be used to wrap creator's watch widget, make it easy to use and provides some default widget to display extra status of emitter.
### Creator Watcher
```dart
import 'package:creator/creator.dart';
import 'package:creator_watcher/creator_watcher.dart';
import 'package:flutter/material.dart';final exampleCreator = Creator.value(
'Hello creator',
name: 'exampleCreator',
);void main() {
runApp(MaterialApp(
home: CreatorWatcher(
builder: (context, content) => Text(content),
creator: exampleCreator,
),
));
}```
### Emitter Watcher
```dart
import 'package:creator/creator.dart';
import 'package:creator_watcher/creator_watcher.dart';
import 'package:flutter/material.dart';final exampleEmitter = Emitter(
(ref, emit) async {
await Future.delayed(const Duration(seconds: 1));
emit('Hello emitter');
},
name: 'exampleEmitter',
);void main() {
runApp(MaterialApp(
home: EmitterWatcher(
builder: (context, content) => Text(content),
emitter: exampleEmitter,
),
));
}```