maybeWhen<TResult extends Object?> method
A variant of when that fallback to an orElse callback.
It is equivalent to doing:
switch (sealedClass) {
case Subclass(:final field):
return ...;
case _:
return orElse();
}
Implementation
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? format, int? width, int? height, @JsonKey(name: 'video_codec') String? videoCodec, @JsonKey(name: 'audio_codec') String? audioCodec, @JsonKey(name: 'bit_rate') int? bitRate, double? duration, @JsonKey(name: 'frame_rate') double? frameRate)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _SceneFile() when $default != null:
return $default(_that.format,_that.width,_that.height,_that.videoCodec,_that.audioCodec,_that.bitRate,_that.duration,_that.frameRate);case _:
return orElse();
}
}