Skip to content

Instantly share code, notes, and snippets.

@PatilShreyas
Created July 4, 2020 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PatilShreyas/14db1630730670a56f2b858f0e745f36 to your computer and use it in GitHub Desktop.
Save PatilShreyas/14db1630730670a56f2b858f0e745f36 to your computer and use it in GitHub Desktop.
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