sc 0.0.11 copy "sc: ^0.0.11" to clipboard
sc: ^0.0.11 copied to clipboard

unlisted

A Flutter library for state and lifecycle management.

SC is a library for state and lifecycle management.

[Work-In-Progress]

Still not ready for production.

Signals #

import 'package:sc/sc1.dart'; // import sc1 instead of material/cupertino/widgets
import 'package:sc/signals.dart';

class CounterService {
  final _counter = MutableSignal(0); // just wrap your value in a MutableSignal

  Signal<int> get counter => _counter; // expose a Signal, so just this class can change the value

  void increment() {
    _counter.value++;
  }
}

class CounterWidget extends StatelessWidget {
  final counterService = CounterService();

  CounterWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return Text('counter: ${counterService.counter()}'); // call the Signal to get the value
    // your widget will automatically rebuild when the value changes
  }
}
0
likes
0
points
39
downloads

Publisher

verified publisherdreamscenter.com

Weekly Downloads

A Flutter library for state and lifecycle management.

License

unknown (license)

Dependencies

async, collection, flutter, kt_dart

More

Packages that depend on sc