Skip to content

Instantly share code, notes, and snippets.

Created November 1, 2020 06:10
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