maybeMap<TResult extends Object?> method
TResult
maybeMap<TResult extends Object?>({
- TResult channel(
- ChatStatisticsChannel value
- TResult supergroup(
- ChatStatisticsSupergroup value
- required TResult orElse(),
Implementation
TResult maybeMap<TResult extends Object?>({
TResult Function(ChatStatisticsChannel value)? channel,
TResult Function(ChatStatisticsSupergroup value)? supergroup,
required TResult Function() orElse,
}) {
switch (getConstructor()) {
case ChatStatisticsChannel.constructor:
if (channel != null) {
return channel.call(this as ChatStatisticsChannel);
}
break;
case ChatStatisticsSupergroup.constructor:
if (supergroup != null) {
return supergroup.call(this as ChatStatisticsSupergroup);
}
break;
}
return orElse.call();
}