mutationStart method

  1. @override
  2. @mustCallSuper
void mutationStart(
  1. ProviderObserverContext context,
  2. Mutation<Object?> mutation
)

A mutation was started.

mutation is strictly the same as ProviderObserverContext.mutation. It is provided as a convenience, as this life-cycle is guaranteed to have a non-null ProviderObserverContext.mutation.

Implementation

@override
@mustCallSuper
void mutationStart(
  ProviderObserverContext context,
  Mutation<Object?> mutation,
) {
  super.mutationStart(context, mutation);

  if (!settings.enabled || !settings.printMutationStart) return;

  final accepted = settings.providerFilter?.call(context.provider) ?? true;
  if (!accepted) return;

  _talker.logCustom(
    RiverpodMutationStartLog(
      provider: context.provider,
      mutation: mutation,
      settings: settings,
    ),
  );
}