whenOrNull<TResult extends Object?> method
TResult?
whenOrNull<TResult extends Object?>(
- TResult? $default(
- VoDashboardPane? currentPane,
- List<
VoDashboardPane> dockPanes, - List<
VoDashboardPane> drawerPanes, - List<
VoDashboardPane> endDrawerPanes, - List<
VoDashboardPane> registry, - List<
VoPage> flowPages, - bool canPopShell,
- bool isInitialized,
A variant of when that fallback to returning null
It is equivalent to doing:
switch (sealedClass) {
case Subclass(:final field):
return ...;
case _:
return null;
}
Implementation
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( VoDashboardPane? currentPane, List<VoDashboardPane> dockPanes, List<VoDashboardPane> drawerPanes, List<VoDashboardPane> endDrawerPanes, List<VoDashboardPane> registry, List<VoPage> flowPages, bool canPopShell, bool isInitialized)? $default,) {final _that = this;
switch (_that) {
case _VoDashboardState() when $default != null:
return $default(_that.currentPane,_that.dockPanes,_that.drawerPanes,_that.endDrawerPanes,_that.registry,_that.flowPages,_that.canPopShell,_that.isInitialized);case _:
return null;
}
}