Below I have a simple array that contains key-value pairs. Here's what I'm trying to achieve:
If 'global' == true, print the value of the 'title' key inside that same object. If 'global' == false, do nothing.
So for the example below, we would only print 'hello'.
Any help is greatly appreciated!
void main() {
var messages = [
{
'id': 1,
'title': "hello",
'global': true,
},
{
'id': 2,
'title': "bye",
'global': false,
},
];