getId static method

dynamic getId(
  1. Map map
)

Returns the ID of the object if exists otherwise return 0;

Example:

getId(map) // 111

Implementation

static dynamic getId(Map<dynamic, dynamic> map) {
  return (map.containsKey('id') && map['id'] != null) ? map['id'] : 0;
}