I saw many similar questions but I haven't found one which satisfy the question I'm asking now. So suppose I have 3 maps like these:
final map1 = {name: Bill, age: 34, nickname: ''};
final map2 = {name: John, age: 50};
final map3 = {name: Dan, age: 21, nickname: 'Avengers'};
I want to be able to check whether nickname
is null or empty so I check like this:
if(map[nickname] != null && map[nickname] != '')
Or
if(map[nickname] == null || map[nickname] == '')
I had to use two conditional checks every time.
Is there a way in Dart so we can shorten this into one condition check?
Thanks and I apologize if this is a duplicate of some other question but I have searched a a bunch of similar questions without finding anything exactly for Dart yet.