UNotificationTargetPatterns extension

Adds pattern-matching-related methods to UNotificationTarget.

on

Methods

map<TResult extends Object?>({required TResult reportRef(UNotificationTargetReportRef value), required TResult subjectRef(UNotificationTargetSubjectRef value), required TResult standingRef(UNotificationTargetStandingRef value), required TResult unknown(UNotificationTargetUnknown value)}) → TResult

Available on UNotificationTarget, provided by the UNotificationTargetPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>({TResult? reportRef(UNotificationTargetReportRef value)?, TResult? subjectRef(UNotificationTargetSubjectRef value)?, TResult? standingRef(UNotificationTargetStandingRef value)?, TResult? unknown(UNotificationTargetUnknown value)?}) → TResult?

Available on UNotificationTarget, provided by the UNotificationTargetPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>({TResult reportRef(UNotificationTargetReportRef value)?, TResult subjectRef(UNotificationTargetSubjectRef value)?, TResult standingRef(UNotificationTargetStandingRef value)?, TResult unknown(UNotificationTargetUnknown value)?, required TResult orElse()}) → TResult

Available on UNotificationTarget, provided by the UNotificationTargetPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>({TResult reportRef(ReportRef data)?, TResult subjectRef(SubjectRef data)?, TResult standingRef(StandingRef data)?, TResult unknown(Map<String, dynamic> data)?, required TResult orElse()}) → TResult

Available on UNotificationTarget, provided by the UNotificationTargetPatterns extension

A variant of when that fallback to an orElse callback.
when<TResult extends Object?>({required TResult reportRef(ReportRef data), required TResult subjectRef(SubjectRef data), required TResult standingRef(StandingRef data), required TResult unknown(Map<String, dynamic> data)}) → TResult

Available on UNotificationTarget, provided by the UNotificationTargetPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>({TResult? reportRef(ReportRef data)?, TResult? subjectRef(SubjectRef data)?, TResult? standingRef(StandingRef data)?, TResult? unknown(Map<String, dynamic> data)?}) → TResult?

Available on UNotificationTarget, provided by the UNotificationTargetPatterns extension

A variant of when that fallback to returning null