"Don't write boilerplates. To handle complex reactive pipelines, all you have to do is call a line (Coralline)."
Stop tangling your logic wires—a composable pipeline for reactive structures. Simply call a line.
Coralline is a high-performance, zero-overhead Dart & Flutter reactive state management framework powered by CORAL (Chain of Reactivity And Lazy-computation). Designed to solve computational flooding and verbosity in state management, Coralline models state processing after Flutter's RenderObject pipeline: Push-Dirty ($O(1)$) + Pull-Data (Lazy).
| Package | pub.dev | Description |
|---|---|---|
coralline |
Pure Dart core engine implementing the Chain of Reactivity and Lazy Computation pipeline architecture. | |
coralline_extensions |
Official extension library for reactive operations on Dart Future, Stream, Iterable, and List. |
|
coralline_flutter |
High-performance Flutter state management framework with zero-allocation single-dependency components and |
Traditional push-based reactive frameworks (e.g., standard Streams or Signals) continuously flood heavy data payloads downstream on every mutation.
flowchart LR
A0["Data Change"] -->|"Compute & Push"| B0["Intermediate Stage 1"]
B0 -->|"Compute & Push"| C0["Intermediate Stage 2"]
C0 -->|"Compute & Push"| D0["UI Rebuild"]
Coralline decouples dirty notification from data computation into two distinct phases:
flowchart LR
A1["CoralController"] -->|"Push-Dirty O(1)"| B1["CoralBroadcaster"]
B1 --> C1["Coral.diverge"]
C1 --> D1["Trunk.converge"]
D1 -->|"O(1) Invalidation"| E1["CoralTerminal.onDirty"]
E1 --> F1["UI Render Queue"]
(No data computation or memory allocation occurs during state mutation; only a lightweight $O(1)$ dirty flag is broadcast)
flowchart RL
F2["UI Render (Display)"] -->|"VSYNC Render Tick"| E2["CoralTerminal.snapshot"]
E2 --> D2["Trunk.converge"]
D2 -->|"Upstream Pull"| C2["Coral.diverge"]
C2 --> B2["CoralBroadcaster"]
B2 -->|"Fetch Cached Data"| A2["CoralController"]
(Data computation occurs strictly on demand during frame rendering, caching intermediate results automatically)
Add coralline_flutter to your pubspec.yaml:
dependencies:
flutter:
sdk: flutter
coralline_flutter: ^0.1.0import 'package:flutter/material.dart';
import 'package:coralline_flutter/coralline_flutter.dart';
void main() => runApp(CounterApp());
class CounterApp extends StatelessWidget {
CounterApp({super.key});
final counterController = CoralController<int>(0);
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Coralline Counter Example')),
body: Center(
child: counterController.provider.coral
.map((count) => Text(
'Count: $count',
style: const TextStyle(fontSize: 28, fontWeight: FontWeight.bold),
))
.toWidget(),
),
floatingActionButton: FloatingActionButton(
onPressed: () => counterController.set(counterController.data + 1),
child: const Icon(Icons.add),
),
),
);
}
}Explore the in-depth documentation in the coralline/doc/manual directory:
- 🚀 Quickstart & Core Concepts Guide — Build your first reactive pipeline in 5 minutes.
- 🔀 Pipeline & Broadcasting Guide — Master 1:N sharing (
CoralBroadcaster), dynamic topology (CoralCoupler), and snapshots. - 📖 Public API Reference Manual — Complete catalog of all public Classes, Mixins, and Extensions.
- 🔬 Flutter & Dart Engineering Whitepaper — Deep technical analysis of Push-Dirty Pull-Data, Fasttrack
$O(1)$ , and Wasm performance.
Coralline ecosystem libraries are licensed under the Apache License 2.0.