riverpod_mutations library

A Library that provides a way to handle mutations with riverpod

This is temporary until riverpod directly supports mutations

Keep an eye on this issue: https://github.com/rrousselGit/riverpod/issues/1660

Classes

GenericMutationFamily
generic mutation. pass a function into call to execute the mutation the mutationKey will allow creating a new provider per context allows you to avoid creating a new mutation definition for every single function
GenericMutationProvider
generic mutation. pass a function into call to execute the mutation the mutationKey will allow creating a new provider per context allows you to avoid creating a new mutation definition for every single function
MutationData<Result, Param>
MutationError<Result, Param>
MutationInitial<Result, Param>
MutationLoading<Result, Param>
MutationState<Result, Param>
AsyncValue-like data class, but includes a setState and callback strictly for use in providers _fn is the handler for whatever parameter gets passed in (a call to a notifier function, for example) Param is the type of the value that gets passed in by the front end T is the type of the created data from the call (equivalent to AsyncValue's T) (the type of the value)

Extensions

MutationValueX on MutationState<Result, Param>

Constants

genericMutationProvider → const GenericMutationFamily
generic mutation. pass a function into call to execute the mutation the mutationKey will allow creating a new provider per context allows you to avoid creating a new mutation definition for every single function

Functions

genericMutation(GenericMutationRef ref, Object mutationKey) MutationState<void, Future<void> Function()>
generic mutation. pass a function into call to execute the mutation the mutationKey will allow creating a new provider per context allows you to avoid creating a new mutation definition for every single function
throwErrorWithCombinedStackTrace(Object error, StackTrace stackTrace) → Never

Typedefs

GenericMutationRef = AutoDisposeProviderRef<MutationState<void, Future<void> Function()>>
StateSetter<Result, Param> = void Function(MutationState<Result, Param> state)