Created
December 14, 2019 22:48
-
-
Save juliuscanute/4bec0fae802f8f5d7bbc5cecfd0fdb31 to your computer and use it in GitHub Desktop.
View emotion detail
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
| class _ViewModel { | |
| final Store<EmotionAppState> store; | |
| const _ViewModel({this.store}); | |
| static _ViewModel fromStore(Store<EmotionAppState> store) { | |
| return _ViewModel(store: store); | |
| } | |
| String getEmotionImage() { | |
| int index = store.state.index; | |
| return store.state.details[index].emoji; | |
| } | |
| String getEmotion() { | |
| int index = store.state.index; | |
| return store.state.details[index].emotion; | |
| } | |
| String getEmotionDescription() { | |
| int index = store.state.index; | |
| return store.state.details[index].emotionDescription; | |
| } | |
| String getDate() { | |
| int index = store.state.index; | |
| return store.state.details[index].emotionDate; | |
| } | |
| String getTime() { | |
| int index = store.state.index; | |
| return store.state.details[index].emotionTime; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment