oref 2.0.0 copy "oref: ^2.0.0" to clipboard
oref: ^2.0.0 copied to clipboard

A reactive state management library for Flutter that adds magic to any Widget with signals, computed values, and effects powered by alien_signals.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Oref Example',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
      ),
      home: const Counter(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    final count = signal(context, 0);
    void increment() => count(count() + 1);

    return Scaffold(
      appBar: AppBar(title: const Text('Counter')),
      body: Center(child: Text("Count: ${count()}")),
      floatingActionButton: FloatingActionButton(
        onPressed: increment,
        child: const Icon(Icons.plus_one),
      ),
    );
  }
}
8
likes
0
points
677
downloads

Publisher

verified publishermedz.dev

Weekly Downloads

A reactive state management library for Flutter that adds magic to any Widget with signals, computed values, and effects powered by alien_signals.

Repository (GitHub)
View/report issues

Topics

#signal #reactive #state

Funding

Consider supporting this project:

github.com
opencollective.com

License

unknown (license)

Dependencies

alien_signals, flutter

More

Packages that depend on oref