Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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