Skip to content

ref.state no longer available with >2.6.0 #3809

Closed Answered by nikel-abibiano
nikel-abibiano asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks. Solved with following code:

@riverpod
class SaveForm extends _$SaveForm {
  @override
  MutationState<void, Note> build(String id, EntitiesParam? entitiesParam,
      bool isNew, bool createdFromDetail) {
    return MutationState.create(
      (newState) => state = newState,
      (note) async => ref
          .read(
              noteNewEditScreenStateProvider(id, isNew, entitiesParam).notifier)
          .saveForm(note, entitiesParam, isNew, createdFromDetail),
    );
  }
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nikel-abibiano
Comment options

Answer selected by nikel-abibiano
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants