Skip to content

Instantly share code, notes, and snippets.

@juliuscanute
Created December 14, 2019 21:43
Show Gist options
  • Select an option

  • Save juliuscanute/bccdec724d112ae2115046eeb36bc81a to your computer and use it in GitHub Desktop.

Select an option

Save juliuscanute/bccdec724d112ae2115046eeb36bc81a to your computer and use it in GitHub Desktop.
Create a new state for navigate action
final emotionAppReducer = combineReducers<EmotionAppState>([
TypedReducer<EmotionAppState, NavigateToCreateEmotion>(
_handleNavigateToCreateNewEmotion)
]);
EmotionAppState _handleNavigateToCreateNewEmotion(
EmotionAppState previousState, NavigateToCreateEmotion action) {
EmotionAppState state;
state = previousState.copy(
newState: EmotionAppState(emoji: action.emoji, emotion: action.emotion));
return state;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment