Created
December 14, 2019 03:03
-
-
Save juliuscanute/bfe21f30622057a60c8fa9521ab8a35e to your computer and use it in GitHub Desktop.
App State
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @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