flutter_obs 0.0.2
flutter_obs: ^0.0.2 copied to clipboard
a easy flutter state management, the source code is less than 100, but you can use it to implement global and local states
A simple state manager, it's similar to ValueNotifier, but the core is to borrow from Getx.
Install #
flutter pub add flutter_obs
Use #
class Example extends StatelessWidget {
const Example({super.key});
@override
Widget build(BuildContext context) {
final count = Obs(0);
return ElevatedButton(
onPressed: () => count.value++,
child: ObsBuilder(builder: (_) => Text('count: ${count.value}')),
);
}
}