getSemiTitle function

String? getSemiTitle(
  1. LocationNotificationModel locationNotificationModel,
  2. bool haveResponded
)

Implementation

String? getSemiTitle(
    LocationNotificationModel locationNotificationModel, bool haveResponded) {
  if (locationNotificationModel.key!.contains(MixedConstants.SHARE_LOCATION)) {
    return locationNotificationModel.atsignCreator !=
            AtLocationNotificationListener().currentAtSign
        ? (locationNotificationModel.isAccepted
            ? null
            : locationNotificationModel.isExited
                ? 'Received Share location rejected'
                : (haveResponded ? 'Pending request' : 'Action required'))
        : (locationNotificationModel.isAccepted
            ? null
            : locationNotificationModel.isExited
                ? 'Sent Share location rejected'
                : 'Awaiting response');
  } else {
    return locationNotificationModel.atsignCreator ==
            AtLocationNotificationListener().currentAtSign
        ? (!locationNotificationModel.isExited
            ? (locationNotificationModel.isAccepted
                ? null
                : (haveResponded ? 'Pending request' : 'Action required'))
            : 'Request rejected')
        : (!locationNotificationModel.isExited
            ? (locationNotificationModel.isAccepted
                ? null
                : 'Awaiting response')
            : 'Request rejected');
  }
}