jolt_flutter 4.0.0-dev.1
jolt_flutter: ^4.0.0-dev.1 copied to clipboard
Flutter library for jolt reactive signals library that builds reactive widgets from signals, automatically updating UI when signals change.
Jolt Flutter #
Flutter widgets that rebuild from Jolt reads.
jolt_flutter lets Flutter views read Signal, Computed, and other Jolt values directly inside JoltBuilder. When those reads change, Flutter rebuilds that part of the tree.
It re-exports jolt, so most Flutter apps can import package:jolt_flutter/jolt_flutter.dart and start there.
A Small Example #
import 'package:flutter/material.dart';
import 'package:jolt_flutter/jolt_flutter.dart';
final counter = Signal(0);
void main() {
runApp(const CounterApp());
}
class CounterApp extends StatelessWidget {
const CounterApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: JoltBuilder(
builder: (context) => Text('Count: ${counter.value}'),
),
),
floatingActionButton: FloatingActionButton(
onPressed: () => counter.value++,
child: const Icon(Icons.add),
),
),
);
}
}
JoltBuilder is the default entry point. It runs builder in a reactive scope, so any Jolt value read there becomes a rebuild dependency.
License #
This project is licensed under the MIT License. See the LICENSE file for details.