Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save juliuscanute/f349a56cfb5ae02b182fc2c6e8c0f860 to your computer and use it in GitHub Desktop.
Display retrieved emotions
class SavedEmotionsList extends StatelessWidget {
@override
Widget build(BuildContext context) {
return StoreConnector<EmotionAppState, _ViewModelSavedEmotion>(
converter: _ViewModelSavedEmotion.fromStore,
builder: (context, vm) {
return ListView.builder(
itemBuilder: (BuildContext context, int index) =>
SavedEmotionsListItem(
index: index,
emotionImage: vm.getEmotionImage(index),
emotionDescription: vm.getEmotionDescription(index),
emotionDate: vm.getDate(index),
emotionTime: vm.getTime(index),
),
itemCount: vm.getEmotionCount(),
);
},
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment