Dart Programming - Map Property isNotEmpty



Returns true if the Map has at least one item.

Syntax

Map.isNotEmpty 

Example

void main() { 
   var details = {'Usrname':'tom','Password':'pass@123'}; 
   print(details.isNotEmpty); 
   
   var hosts = {}; 
   print(hosts.isNotEmpty); 
}

It will produce the following output

true 
false
dart_programming_map.htm
Advertisements