maybeMap<TResult extends Object?> method
TResult
maybeMap<TResult extends Object?>({
- TResult channelChats()?,
- TResult groupChats()?,
- TResult privateChats()?,
- required TResult orElse(),
Implementation
TResult maybeMap<TResult extends Object?>({
TResult Function(NotificationSettingsScopeChannelChats value)? channelChats,
TResult Function(NotificationSettingsScopeGroupChats value)? groupChats,
TResult Function(NotificationSettingsScopePrivateChats value)? privateChats,
required TResult Function() orElse,
}) {
switch (getConstructor()) {
case NotificationSettingsScopeChannelChats.constructor:
if (channelChats != null) {
return channelChats.call(
this as NotificationSettingsScopeChannelChats,
);
}
break;
case NotificationSettingsScopeGroupChats.constructor:
if (groupChats != null) {
return groupChats.call(this as NotificationSettingsScopeGroupChats);
}
break;
case NotificationSettingsScopePrivateChats.constructor:
if (privateChats != null) {
return privateChats.call(
this as NotificationSettingsScopePrivateChats,
);
}
break;
}
return orElse.call();
}