getSubTitle function

String getSubTitle(
  1. LocationNotificationModel locationNotificationModel
)

Implementation

String getSubTitle(LocationNotificationModel locationNotificationModel) {
  DateTime? to;
  String time;
  to = locationNotificationModel.to;
  if (to != null) {
    time =
        'until ${timeOfDayToString(TimeOfDay.fromDateTime(locationNotificationModel.to!))} today';
  } else {
    time = '';
  }
  if (locationNotificationModel.key!.contains(MixedConstants.SHARE_LOCATION)) {
    return locationNotificationModel.atsignCreator ==
            AtLocationNotificationListener().currentAtSign
        ? 'Can see my location $time'
        : 'Can see their location $time';
  } else {
    return locationNotificationModel.isAccepted
        ? (locationNotificationModel.atsignCreator ==
                AtLocationNotificationListener().currentAtSign
            ? 'Sharing my location $time'
            : 'Sharing their location $time')
        : (locationNotificationModel.atsignCreator ==
                AtLocationNotificationListener().currentAtSign
            ? 'Request Location received'
            : 'Request Location sent');
  }
}