flutter_watcher 2.1.0+1 copy "flutter_watcher: ^2.1.0+1" to clipboard
flutter_watcher: ^2.1.0+1 copied to clipboard

Simple state management for Flutter, with caching capability

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_watcher/flutter_watcher.dart';

main() => runApp(MyCounter());

class MyCounter extends StatelessWidget {
  MyCounter({super.key});

  final counter = 0.watcher;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Watch Counter',
      home: Scaffold(
        appBar: AppBar(title: const Text('Watch Counter')),
        body: Center(
          child: counter.watchValue(
            (value) {
              return Text('Counter: $value');
            },
          ),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: () => counter.increment(1),
          child: const Icon(Icons.add),
        ),
      ),
    );
  }
}
15
likes
0
pub points
34%
popularity

Publisher

unverified uploader

Simple state management for Flutter, with caching capability

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_helper_utils, hive, hive_flutter

More

Packages that depend on flutter_watcher