import 'package:flutter_bloc/flutter_bloc.dart'; class PersistenceBloc extends Bloc { PersistenceBloc() : super(PersistenceState.init()) { on(storeAllNotes); on(loadAllNotes); } void storeAllNotes(PersistenceEvent event, Emitter emit) {} void loadAllNotes(PersistenceEvent event, Emitter emit) {} } class PersistenceEvent {} class LoadNotesEvent extends PersistenceEvent {} class StoreNotesEvent extends PersistenceEvent {} class PersistenceState { int lastIndex; PersistenceState({required this.lastIndex}); factory PersistenceState.init() { return PersistenceState(lastIndex: 0); } }