LocationNotificationModel.fromJson constructor

LocationNotificationModel.fromJson(
  1. Map<String, dynamic> json
)

Implementation

LocationNotificationModel.fromJson(Map<String, dynamic> json)
    : atsignCreator = json['atsignCreator'],
      receiver = json['receiver'],
      lat = json['lat'] != 'null' && json['lat'] != null
          ? double.parse(json['lat'])
          : 0,
      long = json['long'] != 'null' && json['long'] != null
          ? double.parse(json['long'])
          : 0,
      key = json['key'] ?? '',
      isAcknowledgment = json['isAcknowledgment'] == 'true' ? true : false,
      isAccepted = json['isAccepted'] == 'true' ? true : false,
      isExited = json['isExited'] == 'true' ? true : false,
      isRequest = json['isRequest'] == 'true' ? true : false,
      isSharing = json['isSharing'] == 'true' ? true : false,
      from = ((json['from'] != 'null') && (json['from'] != null))
          ? DateTime.parse(json['from']).toLocal()
          : null,
      to = ((json['to'] != 'null') && (json['to'] != null))
          ? DateTime.parse(json['to']).toLocal()
          : null,
      rePrompt = json['rePrompt'] == 'true' ? true : false,
      updateMap = json['updateMap'] == 'true' ? true : false;