when<T> method
T
when<T>({
- required T sameTab(
- WebAuthenticationSameTab sameTab
- required T popup(
- WebAuthenticationPopup popup
Implementation
T when<T>({
required T Function(WebAuthenticationSameTab sameTab) sameTab,
required T Function(WebAuthenticationPopup popup) popup,
}) {
if (this is WebAuthenticationSameTab) {
return sameTab(this as WebAuthenticationSameTab);
} else if (this is WebAuthenticationPopup) {
return popup(this as WebAuthenticationPopup);
} else {
throw StateError(
'Instance of WebAuthenticationMode is not a known subtype',
);
}
}