ESM (Easy State Management) A Flutter package to simplify application state management using component.
Add this to your flutter app to:
- Create widgets with mutable state.
- Control widget through his state.
- Handle app routing easily.
A simple counter component. For full counter app you can refer to the example section.
class Counter extends Component<int> {
const Counter(super.state, {super.key});
@override
Widget render(BuildContext context) {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'You have pushed the button this many times:',
),
Text(
'${state.value}',
style: Theme.of(context).textTheme.headlineMedium,
),
ElevatedButton(
onPressed: () => state.value++,
child: const Text('Increment'),
),
],
),
);
}
}