flutter_taerae 0.2.0
flutter_taerae: ^0.2.0 copied to clipboard
Local-first embedded graph package for Flutter with ChangeNotifier state APIs, durability controls, and GraphRAG-ready extensions.
flutter_taerae #
Flutter package for using taerae_core graph APIs in Flutter apps.
flutter_taerae provides:
TaeraeGraphController(ChangeNotifier) for Flutter-friendly graph state.TaeraeGraphViewfor in-app graph visualization with node/edge tap callbacks.TaeraeFlutter.getPlatformVersion()for platform-channel smoke testing.- Re-exported
taerae_coreAPIs (graph model/engine, persistence, GraphRAG).
Why this package #
- Flutter-native state integration for graph data via
TaeraeGraphController. - No external GraphDB required for on-device graph features.
- Unified import for graph engine, persistence, and GraphRAG building blocks.
- Practical path from local prototype to production app architecture.
Documentation #
- Detailed guide:
DEVELOPER_GUIDE.md - API reference:
API_REFERENCE.md
Installation #
dependencies:
flutter_taerae: ^0.2.0
Local monorepo override example:
dependencies:
flutter_taerae:
path: ../packages/flutter_taerae
dependency_overrides:
taerae_core:
path: ../packages/taerae_core
Adjust relative paths to your app directory.
Quick usage #
import 'package:flutter_taerae/flutter_taerae.dart';
final TaeraeFlutter plugin = TaeraeFlutter();
final String platformVersion =
await plugin.getPlatformVersion() ?? 'unknown';
final TaeraeGraphController controller = TaeraeGraphController();
controller
..upsertNode('n1', labels: const <String>['Person'])
..upsertNode('n2', labels: const <String>['Person'])
..upsertEdge('e1', 'n1', 'n2', type: 'KNOWS');
final List<String>? path = controller.shortestPathBfs('n1', 'n2');
Widget build(BuildContext context) {
return SizedBox(
height: 320,
child: TaeraeGraphView(
controller: controller,
onNodeTap: (TaeraeNode node) => debugPrint('node=${node.id}'),
onEdgeTap: (TaeraeEdge edge) => debugPrint('edge=${edge.id}'),
),
);
}
Practical CRUD Flow (Flutter App) #
For real apps, treat TaeraeGraphController as your local graph state layer
and wire user actions directly to controller APIs.
Create/Updatenode: callupsertNode(id, labels: ..., properties: ...).Create/Updateedge: callupsertEdge(id, from, to, type: ..., properties: ...).Search: combinenodeById,nodesByLabel,nodesWhereProperty,neighbors, andshortestPathBfsdepending on UX.Delete: callremoveNode(id)orremoveEdge(id).Render: bind controller to UI viaAnimatedBuilderor otherListenable-aware state wiring. Mutation APIs automatically callnotifyListeners().
Reference implementation:
- Example app with end-user CRUD/search UI:
example/lib/main.dart - Example widget test:
example/test/widget_test.dart
Run the example app:
cd packages/flutter_taerae/example
flutter pub get
flutter run