Last updated:
0 purchases
flutter love provider
flutter_love_provider #
flutter_love_provider provide flutter widgets for supporting solution base on flutter, love and provider.
SystemProviders #
SystemProviders can consume a System then provide state and dispatch to descendant widgets.
Descendant widget can access state and dispatch from context:
System<int, CounterEvent> createCounterSystem() { ... }
class UseSystemProvidersPage extends StatelessWidget {
const UseSystemProvidersPage({ Key? key }) : super(key: key);
@override
Widget build(BuildContext context) {
return SystemProviders(
create: (_) => createCounterSystem(),
builder: (context, _) {
final state = context.watch<int>(); // <- access state
return CounterPage(
title: 'Use System Providers Page',
count: state,
onIncreasePressed: () => context
.dispatch<CounterEvent>(Increment()), // <- access dispatch
);
},
);
}
}
copied to clipboard
License #
The MIT License (MIT)
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.