cubepod_flutter 0.1.5 copy "cubepod_flutter: ^0.1.5" to clipboard
cubepod_flutter: ^0.1.5 copied to clipboard

Flutter widgets and integrations for the CubePod dependency injection and state management framework.

cubepod_flutter #

Flutter UI widgets for CubePod. Connects StateSignal to your widget tree with surgical rebuilds — only the widget reading the changed value updates.

What's inside #

  • CubeBuilder<T> — rebuilds when a StateSignal changes
  • CubeSelector<T, R> — rebuilds only when a derived value changes
  • CubeListener<T> — runs a side effect when a signal changes (no rebuild)
  • CubeConsumer<T> — combines CubeBuilder + CubeListener

Install #

dependencies:
  cubepod_flutter: ^0.1.1

Usage #

import 'package:cubepod_flutter/cubepod_flutter.dart';

final count = StateSignal(0);

// Rebuilds only when count changes
CubeBuilder<int>(
  signal: count,
  builder: (context, value) => Text('$value'),
);

// Rebuilds only when the length of the list changes, not the list itself
CubeSelector<List<Item>, int>(
  signal: items,
  selector: (list) => list.length,
  builder: (context, len) => Text('$len items'),
);

See cubepod for the full docs.

0
likes
150
points
334
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Flutter widgets and integrations for the CubePod dependency injection and state management framework.

Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

cubepod_core, cubepod_state, flutter

More

Packages that depend on cubepod_flutter