pod 0.17.0 copy "pod: ^0.17.0" to clipboard
pod: ^0.17.0 copied to clipboard

A dependency injection and state management library, fast, simple and composable inspired by Riverpod and Jōtai.

Pod #

License: MIT

⚠️ Status: Experimental


A dependency injection and state management library, fast, simple and composable.

Inspired by Riverpod and Jōtai

Package Pub
pod pub package
flutter_pod pub package
bloc_pod pub package

Quick Start #

import 'package:pod/pod.dart';

void main() {
  // Create a state pod.
  final counterPod = statePod(0);

  // Create a derived Pod.
  final counterTimesTwoPod = pod((ref) => ref.watch(counterPod) * 2);

  // Create a pod container.
  final container = PodContainer();

  // Print derived pod's value.
  print(container.get(counterTimesTwoPod)); // 0

  // Subscribe derived pod's value changes.
  final cancelSubscribe = container.subscribe(counterTimesTwoPod, (value) {
    print(value); // 4
  });

  // Set the value of counter pod to 2.
  container.set(counterPod, 2);

  // Cancel derived pod's subscribe.
  cancelSubscribe();
}
3
likes
140
pub points
40%
popularity

Publisher

verified publishereronsoft.com

A dependency injection and state management library, fast, simple and composable inspired by Riverpod and Jōtai.

Homepage
Repository (GitHub)
View/report issues

Topics

#riverpod #pod #atom #dependency-injection #state-management

Documentation

API reference

License

MIT (LICENSE)

Dependencies

meta

More

Packages that depend on pod