flutter_pod 0.17.0 copy "flutter_pod: ^0.17.0" to clipboard
flutter_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: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
130
pub points
10%
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

flutter, pod

More

Packages that depend on flutter_pod