flutter_obs 1.4.5 copy "flutter_obs: ^1.4.5" to clipboard
flutter_obs: ^1.4.5 copied to clipboard

discontinued

a easy flutter state management, the source code is less than 100, but you can use it to implement global and local states

example/lib/main.dart

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

void main() {
  runApp(const MainApp());
}

class MainApp extends StatelessWidget {
  const MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Home'),
        ),
        body: const Center(
          child: Example(),
        ),
      ),
    );
  }
}

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: (context) => Text('count: ${count.value}')),
    );
  }
}
0
likes
0
points
95
downloads

Publisher

unverified uploader

Weekly Downloads

a easy flutter state management, the source code is less than 100, but you can use it to implement global and local states

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_obs