reactr 0.2.8 copy "reactr: ^0.2.8" to clipboard
reactr: ^0.2.8 copied to clipboard

Reactr is a state management library for Flutter applications. It provides a simple and efficient way to manage the state of your application using controllers and bindings.

example/lib/main.dart

import 'package:example/module/counter/bindings/counter_binding.dart';
import 'package:example/module/counter/views/counter_view.dart';
import 'package:flutter/material.dart';
import 'package:reactr/reactr.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return ReactrMaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatelessWidget {
  final String title;

  const MyHomePage({super.key, required this.title});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(title),
      ),
      body: Center(
        child: FilledButton(
          onPressed: () => Reactr.to(
            binding: CounterBinding(),
            builder: () => const CounterView(),
          ),
          child: const Text("Open Counter"),
        ),
      ),
    );
  }
}
5
likes
140
points
3
downloads

Publisher

verified publisherinfydex.com

Weekly Downloads

Reactr is a state management library for Flutter applications. It provides a simple and efficient way to manage the state of your application using controllers and bindings.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, get_it, shared_preferences

More

Packages that depend on reactr