Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save juliuscanute/bfe21f30622057a60c8fa9521ab8a35e to your computer and use it in GitHub Desktop.
App State
@immutable
class EmotionAppState {
final bool isDatabaseOpen;
final String emoji;
final String emotion;
final List<SavedDetail> details;
final int index;
final bool loadComplete;
EmotionAppState(
{this.isDatabaseOpen,
this.emoji,
this.emotion,
this.details,
this.index,
this.loadComplete});
EmotionAppState copy({EmotionAppState newState}) {
return EmotionAppState(
isDatabaseOpen: _getDatabaseState(newState),
emoji: _getEmoji(newState),
emotion: _getEmotion(newState),
details: _savedDetails(newState),
index: _getIndex(newState),
loadComplete: _getLoadStatus(newState));
}
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment