Created
July 4, 2020 08:11
-
-
Save PatilShreyas/14db1630730670a56f2b858f0e745f36 to your computer and use it in GitHub Desktop.
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 _FeedbackListPageState extends State<FeedbackListPage> { | |
List<FeedbackForm> feedbackItems = List<FeedbackForm>(); | |
// Method to Submit Feedback and save it in Google Sheets | |
@override | |
void initState() { | |
super.initState(); | |
FormController().getFeedbackList().then((feedbackItems) { | |
setState(() { | |
this.feedbackItems = feedbackItems; | |
}); | |
}); | |
} | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text(widget.title), | |
), | |
body: ListView.builder( | |
itemCount: feedbackItems.length, | |
itemBuilder: (context, index) { | |
return ListTile( | |
title: Row( | |
children: <Widget>[ | |
Icon(Icons.person), | |
Expanded( | |
child: Text( | |
"${feedbackItems[index].name} (${feedbackItems[index].email})"), | |
) | |
], | |
), | |
subtitle: Row( | |
children: <Widget>[ | |
Icon(Icons.message), | |
Expanded( | |
child: Text(feedbackItems[index].feedback), | |
) | |
], | |
), | |
); | |
}, | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment