june 0.7.5 copy "june: ^0.7.5" to clipboard
june: ^0.7.5 copied to clipboard

Simple State Manager is all you need

example/lib/main.dart

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

void main() => runApp(const MyApp());

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: JuneUpdater(
            () => CounterVM(),
            child: (vm) => Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                const Text('You have pushed the button this many times:'),
                Text(
                  '${vm.count}',
                  style: Theme.of(context).textTheme.headlineMedium,
                ),
              ],
            ),
          ),
        ),
        floatingActionButton: const FloatingActionButton(
          onPressed: incrementCounter,
          tooltip: 'Increment',
          child: Icon(Icons.add),
        ),
      ),
    );
  }
}

void incrementCounter() {
  var viewModel = June.get(CounterVM());
  viewModel.count++;

  viewModel.update();
}

class CounterVM extends JuneDataClass {
  int count = 0;
}
77
likes
0
points
6.35k
downloads

Publisher

verified publisherjunelee.fun

Weekly Downloads

Simple State Manager is all you need

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on june