fromJson static method

AvailableMap? fromJson(
  1. dynamic json
)

Parses json object to AvailableMap

Implementation

static AvailableMap? fromJson(json) {
  final MapType? mapType =
      Utils.enumFromString(MapType.values, json['mapType']);
  if (mapType != null) {
    return AvailableMap(
      mapName: json['mapName'],
      mapType: mapType,
      icon: 'packages/map_launcher/assets/icons/${json['mapType']}.svg',
    );
  } else {
    return null;
  }
}