getLocationSharingForCreator function

LocationSharingFor? getLocationSharingForCreator(
  1. LocationNotificationModel locationNotificationModel
)

Returns the location sharing information for the creator of a location notification model

Implementation

LocationSharingFor? getLocationSharingForCreator(
    LocationNotificationModel locationNotificationModel) {
  var _atsignCreator = locationNotificationModel.atsignCreator!;
  var _id = trimAtsignsFromKey(locationNotificationModel.key!);

  if (!compareAtSign(locationNotificationModel.atsignCreator!,
      AtLocationNotificationListener().currentAtSign!)) {
    if ((MasterLocationService().locationReceivedData[_atsignCreator] !=
            null) &&
        (MasterLocationService()
                .locationReceivedData[locationNotificationModel.atsignCreator]!
                .locationSharingFor[_id] !=
            null)) {
      var _locationSharingFor = MasterLocationService()
          .locationReceivedData[_atsignCreator]!
          .locationSharingFor[_id]!;

      return _locationSharingFor;
    }
  } else {
    var _receiver = locationNotificationModel.receiver;
    if (SendLocationNotification().allAtsignsLocationData[_receiver] != null) {
      if (SendLocationNotification()
              .allAtsignsLocationData[_receiver]!
              .locationSharingFor[_id] !=
          null) {
        var _locationSharingFor = SendLocationNotification()
            .allAtsignsLocationData[_receiver]!
            .locationSharingFor[_id]!;

        return _locationSharingFor;
      }
    }
  }
  return null;
}