flutter_pod 0.15.0 copy "flutter_pod: ^0.15.0" to clipboard
flutter_pod: ^0.15.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

Quick Start #

import 'package:flutter/material.dart';
import 'package:flutter_pod/flutter_pod.dart';

/// A pod that asynchronously exposes the current user
final userPod = futurePod<User>((_) async {
  // fetch the user
});

class Example extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final AsyncValue<User> user = context.watch(userPod);

    return user.when(
      loading: () => CircularProgressIndicator(),
      error: (error, stack) => Text('Oops, something unexpected happened'),
      data: (user) => Text('Hello ${user.name}'),
    );
  }
}
1
likes
0
pub points
22%
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

License

unknown (LICENSE)

Dependencies

flutter, pod

More

Packages that depend on flutter_pod