mapEventToState method
@Deprecated - Use on
Must be implemented when a class extends Bloc
.
mapEventToState is called whenever an event
is added
and is responsible for converting that event
into a new state.
mapEventToState can yield
zero, one, or multiple states for an event.
Implementation
@override
Stream<KeyboardShiftState> mapEventToState(KeyboardShiftEvent event) async* {
//
yield KeyboardShiftLoading(loading);
if (event is KeyboardShiftUpperCaseEvent) {
//
yield KeyboardShiftUpperCase(upperCase);
} else if (event is KeyboardShiftSymbolsEvent) {
//
yield KeyboardShiftSymbols(symbols);
} else if (event is KeyboardShiftLowerCaseEvent) {
//
yield KeyboardShiftLowerCase(lowerCase);
}
}