creator_watcher 0.0.2 icon indicating copy to clipboard operation
creator_watcher: ^0.0.2 copied to clipboard

A widget wrap creator's watcher which is simple to use especially for emitter.

Creator Watcher #

A widget wrap creator's watcher which is simple to use especially for emitter.

Install #

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 #

import 'package:creator/creator.dart';
import 'package:creator_watcher/creator_watcher.dart';
import 'package:flutter/material.dart';

final exampleCreator = Creator<String>.value(
  'Hello creator',
  name: 'exampleCreator',
);

void main() {
  runApp(MaterialApp(
    home: CreatorWatcher<String>(
      builder: (context, content) => Text(content),
      creator: exampleCreator,
    ),
  ));
}

Emitter Watcher #

import 'package:creator/creator.dart';
import 'package:creator_watcher/creator_watcher.dart';
import 'package:flutter/material.dart';

final exampleEmitter = Emitter<String>(
  (ref, emit) async {
    await Future.delayed(const Duration(seconds: 1));
    emit('Hello emitter');
  },
  name: 'exampleEmitter',
);

void main() {
  runApp(MaterialApp(
    home: EmitterWatcher<String>(
      builder: (context, content) => Text(content),
      emitter: exampleEmitter,
    ),
  ));
}

0
likes
130
pub points
45%
popularity

Publisher

verified publisher iconcals.xyz

A widget wrap creator's watcher which is simple to use especially for emitter.

Repository (GitHub)

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

creator, flutter

More

Packages that depend on creator_watcher