wire_flutter 0.1.1 copy "wire_flutter: ^0.1.1" to clipboard
wire_flutter: ^0.1.1 copied to clipboard

outdated

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;
  });
});
3
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Wire for Flutter widget - WireDataBuilder

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, wire

More

Packages that depend on wire_flutter