wire_flutter 0.1.1

Flutter Android iOS web

Wire for Flutter widget - WireDataBuilder

wire_flutter #

Wire for Flutter widget - WireDataBuilder See Wire: https://pub.dev/packages/wire

Getting Started #

See examples

You need update on data change:

WireDataBuilder<int>(
  param: CounterParams.COUNT,
  builder: (context, value) => Text(
      '$value',
      style: Theme.of(context).textTheme.headline4,
    )
)

Initiate change with firing signal:

FloatingActionButton(
  onPressed: () => Wire.send(CounterSignal.INCREASE),
  child: Icon(Icons.add),
)

React on signal and update data (even passing function to data value). The new value or function call result will be propagated to the WireData listener, and build in WireDataBuilder will rebuild widget with already new value.

Wire.add(this, CounterSignal.INCREASE, (signal, data) {
  Wire.data(CounterParams.COUNT, (value) {
    return value + 1;
  });
});
0
likes
60
pub points
30%
popularity

Wire for Flutter widget - WireDataBuilder

Repository (GitHub)
View/report issues

Uploader

vladimir.cores@gmail.com

License

Apache 2.0 (LICENSE)

Dependencies

flutter, wire

More

Packages that depend on wire_flutter