I'm new to Flutter and I am trying to find out how to create a list of objects like below and pass it to a widget so I can use it like _imageList[0].label, _imageList[0].path and etc...
List<Object> _imageList = List(); <-
_imageList.add({
'label': 'Image1',
'path': 'lib/assets/image/image1.png',
'active': '0xFFFFFFFF',
'inactive': '0x32FFFFFF'
});
_imageList.add({
'label': 'Image2',
'path': 'lib/assets/image/image2.png',
'active': '0xFFFFFFFF',
'inactive': '0x32FFFFFF'
});
Any help is much appreciated. Thanks in advance