Skip to main content

Introduction

Riverpod Craft is an ecosystem built on top of Riverpod that provides solutions and enhancements for state management in Flutter.

Alpha

This package is in alpha. Features and API may change.

What does Riverpod Craft provide?

Better developer experience

Riverpod is powerful, but the daily workflow can feel repetitive. Riverpod Craft gives you a cleaner API — write your logic, and the generated code provides everything else:


Future<List<Note>> notes(Ref ref) async {
final response = await http.get(Uri.parse('https://api.example.com/notes'));
return (jsonDecode(response.body) as List).map(Note.fromJson).toList();
}
// Clean, type-safe API — starts from ref, IDE autocompletes the rest
ref.notesProvider.watch()
ref.notesProvider.read()
ref.notesProvider.reload()
ref.notesProvider.invalidate()

Everything starts from ref. — your IDE autocompletes the rest.

Side effect solution

Riverpod doesn't have a built-in way to handle side effects (API calls, form submissions, delete operations). You end up manually tracking loading, error, and success states for every operation.

Riverpod Craft introduces Commands — each @command gets its own independent state with built-in concurrency control:



Future<void> saveNote(Ref ref, {required String title}) async {
await http.post(Uri.parse('https://api.example.com/notes'), body: ...);
}
// Watch loading/error/success state
final state = ref.saveNoteCommand.watch();

// Run the command
ref.saveNoteCommand.run(title: 'My Note');

Pagination

Built-in support for paginated data with CraftPagedListView — handles infinite scrolling, loading states, and page management automatically.

Fast code generation

craft_runner is a fast code generation runner that skips the Dart Analyzer entirely — giving you instant code generation. Learn why →

Packages

PackageDescription
riverpod_craftRuntime library — annotations, notifiers, state types
craft_runnerCode generation runner — fast alternative to build_runner. Why?

Next steps