toMap method

Map<String, dynamic> toMap()

It converts the object into a map.

Returns: A map of the country's name, dial code, and code.

Implementation

Map<String, dynamic> toMap() {
  return <String, dynamic>{
    'name': name,
    'dial_code': dialCode,
    'code': code,
  };
}