Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
state_examples: notes cubit
class NotesCubit extends Cubit<NotesState> {
NotesCubit(): super(NotesState.initial());
void addNote() {
emit(state.copyWith(notes: state.notes.concat(state.input), input: ''));
}
void updateInput(String input) => emit(state.copyWith(input: input));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment