riverpod_stateful_service 2.0.3 copy "riverpod_stateful_service: ^2.0.3" to clipboard
riverpod_stateful_service: ^2.0.3 copied to clipboard

This package provides a lightweight stateful_service wrapper for Riverpod. See the stateful_service package for more information.

example/example.dart

import 'package:riverpod_stateful_service/riverpod_stateful_service.dart';
import 'package:stateful_service/stateful_service.dart';

class User {
  const User({required this.name});

  final String name;
}

class UserService extends StatefulService<User> {
  UserService({required super.initialState});

  /// Your code here...
}

final StatefulServiceNotifierProvider<UserService, User> userServiceProvider = StatefulServiceNotifierProvider((ref) {
  return StatefulServiceNotifier(UserService(initialState: const User(name: 'John Doe')));
});
2
likes
140
points
539
downloads

Publisher

verified publisherwolverinebeach.net

Weekly Downloads

This package provides a lightweight stateful_service wrapper for Riverpod. See the stateful_service package for more information.

Repository (GitHub)

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

riverpod, stateful_service

More

Packages that depend on riverpod_stateful_service