when<T> method
T?
when<T>({
- T? instantaneous(
- InstantaneousTileDisplay instantaneous
- T? fadeIn(
- FadeInTileDisplay fadeIn
Output a value of type T
dependent on this and its type
Implementation
T? when<T>({
T? Function(InstantaneousTileDisplay instantaneous)? instantaneous,
T? Function(FadeInTileDisplay fadeIn)? fadeIn,
}) {
final display = this;
return switch (display) {
InstantaneousTileDisplay() => instantaneous?.call(display),
FadeInTileDisplay() => fadeIn?.call(display),
};
}