AMapGeoFenceStatusModel.fromMap constructor

AMapGeoFenceStatusModel.fromMap(
  1. Map json
)

Implementation

AMapGeoFenceStatusModel.fromMap(Map<dynamic, dynamic> json) {
  customID = json['customID'] as String?;
  fenceID = json['fenceID'] as String?;
  final statusInt = json['status'] as int?;
  if (statusInt != null && statusInt < 4) {
    status = GenFenceStatus.values[statusInt];
  }
  final typeInt = json['type'] as int?;
  if (typeInt != null && typeInt < 4) type = GenFenceType.values[typeInt];
  fence = json['fence'] == null
      ? null
      : AMapGeoFenceModel.fromMap(json['fence'] as Map<dynamic, dynamic>);
}