I'm trying to make an UI-element for every element in a list of recordings, but nothing is appearing. I've made a class which asks for the Name, Date and Description, which i'm providing for each element in the list.
The one I'm making outside of the for loop, to test if it will draw anything, is showing up as intended. I also know that the list does contain the elements it needs.
The elements in the list is loaded from an Amplify DataStore instance, and is printing correctly to the Debug console.
Here's the code:
class BuildRecordingsList extends StatefulWidget {
const BuildRecordingsList({Key? key}) : super(key: key);
@override
_BuildRecordingsListState createState() => _BuildRecordingsListState();
}
class _BuildRecordingsListState extends State<BuildRecordingsList> {
List<Recording> recordings = DataStoreAppProvider().recordings;
@override
Widget build(BuildContext context) {
DataStoreAppProvider().getRecordings();
return Container(
child: Column(
children: [
RecordingElement(
recordingName: 'recordingName',
recordingDate: TemporalDate.now(),
recordingDescription: 'recordingDescription'),
for (var rec in recordings)
RecordingElement(
recordingName: '${rec.name}',
recordingDate: rec.date,
recordingDescription: '${rec.description}',
),
],
),
);
}
}
I'm still very new to Flutter and Dart, so please do tell me if you'll need more info :)