Add the Flutter video editing application with project management, media import, timeline editing, preview, AI assistance, diagnostics and settings. Include shared UI and native host packages, platform runners, application tests and release tooling. Provide usage and contribution guides, the MIT license and third-party notices. Exclude local credentials, build outputs and validation data.
1456 lines
41 KiB
Dart
1456 lines
41 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
// coverage:ignore-file
|
|
// ignore_for_file: type=lint, type=warning, deprecated_member_use, deprecated_member_use_from_same_package
|
|
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
|
|
|
part of 'view_settings_repositories.dart';
|
|
|
|
// **************************************************************************
|
|
// FreezedGenerator
|
|
// **************************************************************************
|
|
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
T _$identity<T>(T value) => value;
|
|
|
|
/// @nodoc
|
|
mixin _$WorkspaceViewSettingsData {
|
|
bool get hasSavedState;
|
|
WorkspaceMode get mode;
|
|
String? get activeProjectId;
|
|
bool get sidebarCollapsed;
|
|
double? get sidebarWidth;
|
|
|
|
/// Create a copy of WorkspaceViewSettingsData
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
$WorkspaceViewSettingsDataCopyWith<WorkspaceViewSettingsData> get copyWith =>
|
|
_$WorkspaceViewSettingsDataCopyWithImpl<WorkspaceViewSettingsData>(
|
|
this as WorkspaceViewSettingsData,
|
|
_$identity,
|
|
);
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
final _this = this as WorkspaceViewSettingsData;
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is WorkspaceViewSettingsData &&
|
|
(identical(other.hasSavedState, _this.hasSavedState) ||
|
|
other.hasSavedState == _this.hasSavedState) &&
|
|
(identical(other.mode, _this.mode) || other.mode == _this.mode) &&
|
|
(identical(other.activeProjectId, _this.activeProjectId) ||
|
|
other.activeProjectId == _this.activeProjectId) &&
|
|
(identical(other.sidebarCollapsed, _this.sidebarCollapsed) ||
|
|
other.sidebarCollapsed == _this.sidebarCollapsed) &&
|
|
(identical(other.sidebarWidth, _this.sidebarWidth) ||
|
|
other.sidebarWidth == _this.sidebarWidth));
|
|
}
|
|
|
|
@override
|
|
int get hashCode {
|
|
final _this = this as WorkspaceViewSettingsData;
|
|
return Object.hash(
|
|
runtimeType,
|
|
_this.hasSavedState,
|
|
_this.mode,
|
|
_this.activeProjectId,
|
|
_this.sidebarCollapsed,
|
|
_this.sidebarWidth,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
final _this = this as WorkspaceViewSettingsData;
|
|
return 'WorkspaceViewSettingsData(hasSavedState: ${_this.hasSavedState}, mode: ${_this.mode}, activeProjectId: ${_this.activeProjectId}, sidebarCollapsed: ${_this.sidebarCollapsed}, sidebarWidth: ${_this.sidebarWidth})';
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class $WorkspaceViewSettingsDataCopyWith<$Res> {
|
|
factory $WorkspaceViewSettingsDataCopyWith(
|
|
WorkspaceViewSettingsData value,
|
|
$Res Function(WorkspaceViewSettingsData) _then,
|
|
) = _$WorkspaceViewSettingsDataCopyWithImpl;
|
|
@useResult
|
|
$Res call({
|
|
bool hasSavedState,
|
|
WorkspaceMode mode,
|
|
String? activeProjectId,
|
|
bool sidebarCollapsed,
|
|
double? sidebarWidth,
|
|
});
|
|
}
|
|
|
|
/// @nodoc
|
|
class _$WorkspaceViewSettingsDataCopyWithImpl<$Res>
|
|
implements $WorkspaceViewSettingsDataCopyWith<$Res> {
|
|
_$WorkspaceViewSettingsDataCopyWithImpl(this._self, this._then);
|
|
|
|
final WorkspaceViewSettingsData _self;
|
|
final $Res Function(WorkspaceViewSettingsData) _then;
|
|
|
|
/// Create a copy of WorkspaceViewSettingsData
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? hasSavedState = null,
|
|
Object? mode = null,
|
|
Object? activeProjectId = freezed,
|
|
Object? sidebarCollapsed = null,
|
|
Object? sidebarWidth = freezed,
|
|
}) {
|
|
return _then(
|
|
WorkspaceViewSettingsData(
|
|
hasSavedState: null == hasSavedState
|
|
? _self.hasSavedState
|
|
: hasSavedState // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
mode: null == mode
|
|
? _self.mode
|
|
: mode // ignore: cast_nullable_to_non_nullable
|
|
as WorkspaceMode,
|
|
activeProjectId: freezed == activeProjectId
|
|
? _self.activeProjectId
|
|
: activeProjectId // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
sidebarCollapsed: null == sidebarCollapsed
|
|
? _self.sidebarCollapsed
|
|
: sidebarCollapsed // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
sidebarWidth: freezed == sidebarWidth
|
|
? _self.sidebarWidth
|
|
: sidebarWidth // ignore: cast_nullable_to_non_nullable
|
|
as double?,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// Adds pattern-matching-related methods to [WorkspaceViewSettingsData].
|
|
extension WorkspaceViewSettingsDataPatterns on WorkspaceViewSettingsData {
|
|
/// A variant of `map` that fallback to returning `orElse`.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case _:
|
|
/// return orElse();
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult maybeMap<TResult extends Object?>(
|
|
TResult Function(_WorkspaceViewSettingsData value)? $default, {
|
|
required TResult orElse(),
|
|
}) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _WorkspaceViewSettingsData() when $default != null:
|
|
return $default(_that);
|
|
case _:
|
|
return orElse();
|
|
}
|
|
}
|
|
|
|
/// A `switch`-like method, using callbacks.
|
|
///
|
|
/// Callbacks receives the raw object, upcasted.
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case final Subclass2 value:
|
|
/// return ...;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult map<TResult extends Object?>(
|
|
TResult Function(_WorkspaceViewSettingsData value) $default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _WorkspaceViewSettingsData():
|
|
return $default(_that);
|
|
case _:
|
|
throw StateError('Unexpected subclass');
|
|
}
|
|
}
|
|
|
|
/// A variant of `map` that fallback to returning `null`.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case _:
|
|
/// return null;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult? mapOrNull<TResult extends Object?>(
|
|
TResult? Function(_WorkspaceViewSettingsData value)? $default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _WorkspaceViewSettingsData() when $default != null:
|
|
return $default(_that);
|
|
case _:
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/// A variant of `when` that fallback to an `orElse` callback.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case _:
|
|
/// return orElse();
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult maybeWhen<TResult extends Object?>(
|
|
TResult Function(
|
|
bool hasSavedState,
|
|
WorkspaceMode mode,
|
|
String? activeProjectId,
|
|
bool sidebarCollapsed,
|
|
double? sidebarWidth,
|
|
)?
|
|
$default, {
|
|
required TResult orElse(),
|
|
}) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _WorkspaceViewSettingsData() when $default != null:
|
|
return $default(
|
|
_that.hasSavedState,
|
|
_that.mode,
|
|
_that.activeProjectId,
|
|
_that.sidebarCollapsed,
|
|
_that.sidebarWidth,
|
|
);
|
|
case _:
|
|
return orElse();
|
|
}
|
|
}
|
|
|
|
/// A `switch`-like method, using callbacks.
|
|
///
|
|
/// As opposed to `map`, this offers destructuring.
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case Subclass2(:final field2):
|
|
/// return ...;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult when<TResult extends Object?>(
|
|
TResult Function(
|
|
bool hasSavedState,
|
|
WorkspaceMode mode,
|
|
String? activeProjectId,
|
|
bool sidebarCollapsed,
|
|
double? sidebarWidth,
|
|
)
|
|
$default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _WorkspaceViewSettingsData():
|
|
return $default(
|
|
_that.hasSavedState,
|
|
_that.mode,
|
|
_that.activeProjectId,
|
|
_that.sidebarCollapsed,
|
|
_that.sidebarWidth,
|
|
);
|
|
case _:
|
|
throw StateError('Unexpected subclass');
|
|
}
|
|
}
|
|
|
|
/// A variant of `when` that fallback to returning `null`
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case _:
|
|
/// return null;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult? whenOrNull<TResult extends Object?>(
|
|
TResult? Function(
|
|
bool hasSavedState,
|
|
WorkspaceMode mode,
|
|
String? activeProjectId,
|
|
bool sidebarCollapsed,
|
|
double? sidebarWidth,
|
|
)?
|
|
$default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _WorkspaceViewSettingsData() when $default != null:
|
|
return $default(
|
|
_that.hasSavedState,
|
|
_that.mode,
|
|
_that.activeProjectId,
|
|
_that.sidebarCollapsed,
|
|
_that.sidebarWidth,
|
|
);
|
|
case _:
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
|
|
class _WorkspaceViewSettingsData extends WorkspaceViewSettingsData {
|
|
const _WorkspaceViewSettingsData({
|
|
this.hasSavedState = false,
|
|
this.mode = WorkspaceMode.agent,
|
|
this.activeProjectId,
|
|
this.sidebarCollapsed = false,
|
|
this.sidebarWidth,
|
|
}) : super._();
|
|
|
|
@override
|
|
@JsonKey()
|
|
final bool hasSavedState;
|
|
@override
|
|
@JsonKey()
|
|
final WorkspaceMode mode;
|
|
@override
|
|
final String? activeProjectId;
|
|
@override
|
|
@JsonKey()
|
|
final bool sidebarCollapsed;
|
|
@override
|
|
final double? sidebarWidth;
|
|
|
|
/// Create a copy of WorkspaceViewSettingsData
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
_$WorkspaceViewSettingsDataCopyWith<_WorkspaceViewSettingsData>
|
|
get copyWith =>
|
|
__$WorkspaceViewSettingsDataCopyWithImpl<_WorkspaceViewSettingsData>(
|
|
this,
|
|
_$identity,
|
|
);
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is _WorkspaceViewSettingsData &&
|
|
(identical(other.hasSavedState, hasSavedState) ||
|
|
other.hasSavedState == hasSavedState) &&
|
|
(identical(other.mode, mode) || other.mode == mode) &&
|
|
(identical(other.activeProjectId, activeProjectId) ||
|
|
other.activeProjectId == activeProjectId) &&
|
|
(identical(other.sidebarCollapsed, sidebarCollapsed) ||
|
|
other.sidebarCollapsed == sidebarCollapsed) &&
|
|
(identical(other.sidebarWidth, sidebarWidth) ||
|
|
other.sidebarWidth == sidebarWidth));
|
|
}
|
|
|
|
@override
|
|
int get hashCode {
|
|
return Object.hash(
|
|
runtimeType,
|
|
hasSavedState,
|
|
mode,
|
|
activeProjectId,
|
|
sidebarCollapsed,
|
|
sidebarWidth,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return 'WorkspaceViewSettingsData(hasSavedState: $hasSavedState, mode: $mode, activeProjectId: $activeProjectId, sidebarCollapsed: $sidebarCollapsed, sidebarWidth: $sidebarWidth)';
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class _$WorkspaceViewSettingsDataCopyWith<$Res>
|
|
implements $WorkspaceViewSettingsDataCopyWith<$Res> {
|
|
factory _$WorkspaceViewSettingsDataCopyWith(
|
|
_WorkspaceViewSettingsData value,
|
|
$Res Function(_WorkspaceViewSettingsData) _then,
|
|
) = __$WorkspaceViewSettingsDataCopyWithImpl;
|
|
@override
|
|
@useResult
|
|
$Res call({
|
|
bool hasSavedState,
|
|
WorkspaceMode mode,
|
|
String? activeProjectId,
|
|
bool sidebarCollapsed,
|
|
double? sidebarWidth,
|
|
});
|
|
}
|
|
|
|
/// @nodoc
|
|
class __$WorkspaceViewSettingsDataCopyWithImpl<$Res>
|
|
implements _$WorkspaceViewSettingsDataCopyWith<$Res> {
|
|
__$WorkspaceViewSettingsDataCopyWithImpl(this._self, this._then);
|
|
|
|
final _WorkspaceViewSettingsData _self;
|
|
final $Res Function(_WorkspaceViewSettingsData) _then;
|
|
|
|
/// Create a copy of WorkspaceViewSettingsData
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$Res call({
|
|
Object? hasSavedState = null,
|
|
Object? mode = null,
|
|
Object? activeProjectId = freezed,
|
|
Object? sidebarCollapsed = null,
|
|
Object? sidebarWidth = freezed,
|
|
}) {
|
|
return _then(
|
|
_WorkspaceViewSettingsData(
|
|
hasSavedState: null == hasSavedState
|
|
? _self.hasSavedState
|
|
: hasSavedState // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
mode: null == mode
|
|
? _self.mode
|
|
: mode // ignore: cast_nullable_to_non_nullable
|
|
as WorkspaceMode,
|
|
activeProjectId: freezed == activeProjectId
|
|
? _self.activeProjectId
|
|
: activeProjectId // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
sidebarCollapsed: null == sidebarCollapsed
|
|
? _self.sidebarCollapsed
|
|
: sidebarCollapsed // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
sidebarWidth: freezed == sidebarWidth
|
|
? _self.sidebarWidth
|
|
: sidebarWidth // ignore: cast_nullable_to_non_nullable
|
|
as double?,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
mixin _$ProjectViewSettingsData {
|
|
bool get propertiesOpen;
|
|
double? get timelineHeight;
|
|
|
|
/// Create a copy of ProjectViewSettingsData
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
$ProjectViewSettingsDataCopyWith<ProjectViewSettingsData> get copyWith =>
|
|
_$ProjectViewSettingsDataCopyWithImpl<ProjectViewSettingsData>(
|
|
this as ProjectViewSettingsData,
|
|
_$identity,
|
|
);
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
final _this = this as ProjectViewSettingsData;
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is ProjectViewSettingsData &&
|
|
(identical(other.propertiesOpen, _this.propertiesOpen) ||
|
|
other.propertiesOpen == _this.propertiesOpen) &&
|
|
(identical(other.timelineHeight, _this.timelineHeight) ||
|
|
other.timelineHeight == _this.timelineHeight));
|
|
}
|
|
|
|
@override
|
|
int get hashCode {
|
|
final _this = this as ProjectViewSettingsData;
|
|
return Object.hash(runtimeType, _this.propertiesOpen, _this.timelineHeight);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
final _this = this as ProjectViewSettingsData;
|
|
return 'ProjectViewSettingsData(propertiesOpen: ${_this.propertiesOpen}, timelineHeight: ${_this.timelineHeight})';
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class $ProjectViewSettingsDataCopyWith<$Res> {
|
|
factory $ProjectViewSettingsDataCopyWith(
|
|
ProjectViewSettingsData value,
|
|
$Res Function(ProjectViewSettingsData) _then,
|
|
) = _$ProjectViewSettingsDataCopyWithImpl;
|
|
@useResult
|
|
$Res call({bool propertiesOpen, double? timelineHeight});
|
|
}
|
|
|
|
/// @nodoc
|
|
class _$ProjectViewSettingsDataCopyWithImpl<$Res>
|
|
implements $ProjectViewSettingsDataCopyWith<$Res> {
|
|
_$ProjectViewSettingsDataCopyWithImpl(this._self, this._then);
|
|
|
|
final ProjectViewSettingsData _self;
|
|
final $Res Function(ProjectViewSettingsData) _then;
|
|
|
|
/// Create a copy of ProjectViewSettingsData
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({Object? propertiesOpen = null, Object? timelineHeight = freezed}) {
|
|
return _then(
|
|
ProjectViewSettingsData(
|
|
propertiesOpen: null == propertiesOpen
|
|
? _self.propertiesOpen
|
|
: propertiesOpen // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
timelineHeight: freezed == timelineHeight
|
|
? _self.timelineHeight
|
|
: timelineHeight // ignore: cast_nullable_to_non_nullable
|
|
as double?,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// Adds pattern-matching-related methods to [ProjectViewSettingsData].
|
|
extension ProjectViewSettingsDataPatterns on ProjectViewSettingsData {
|
|
/// A variant of `map` that fallback to returning `orElse`.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case _:
|
|
/// return orElse();
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult maybeMap<TResult extends Object?>(
|
|
TResult Function(_ProjectViewSettingsData value)? $default, {
|
|
required TResult orElse(),
|
|
}) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _ProjectViewSettingsData() when $default != null:
|
|
return $default(_that);
|
|
case _:
|
|
return orElse();
|
|
}
|
|
}
|
|
|
|
/// A `switch`-like method, using callbacks.
|
|
///
|
|
/// Callbacks receives the raw object, upcasted.
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case final Subclass2 value:
|
|
/// return ...;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult map<TResult extends Object?>(
|
|
TResult Function(_ProjectViewSettingsData value) $default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _ProjectViewSettingsData():
|
|
return $default(_that);
|
|
case _:
|
|
throw StateError('Unexpected subclass');
|
|
}
|
|
}
|
|
|
|
/// A variant of `map` that fallback to returning `null`.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case _:
|
|
/// return null;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult? mapOrNull<TResult extends Object?>(
|
|
TResult? Function(_ProjectViewSettingsData value)? $default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _ProjectViewSettingsData() when $default != null:
|
|
return $default(_that);
|
|
case _:
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/// A variant of `when` that fallback to an `orElse` callback.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case _:
|
|
/// return orElse();
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult maybeWhen<TResult extends Object?>(
|
|
TResult Function(bool propertiesOpen, double? timelineHeight)? $default, {
|
|
required TResult orElse(),
|
|
}) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _ProjectViewSettingsData() when $default != null:
|
|
return $default(_that.propertiesOpen, _that.timelineHeight);
|
|
case _:
|
|
return orElse();
|
|
}
|
|
}
|
|
|
|
/// A `switch`-like method, using callbacks.
|
|
///
|
|
/// As opposed to `map`, this offers destructuring.
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case Subclass2(:final field2):
|
|
/// return ...;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult when<TResult extends Object?>(
|
|
TResult Function(bool propertiesOpen, double? timelineHeight) $default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _ProjectViewSettingsData():
|
|
return $default(_that.propertiesOpen, _that.timelineHeight);
|
|
case _:
|
|
throw StateError('Unexpected subclass');
|
|
}
|
|
}
|
|
|
|
/// A variant of `when` that fallback to returning `null`
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case _:
|
|
/// return null;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult? whenOrNull<TResult extends Object?>(
|
|
TResult? Function(bool propertiesOpen, double? timelineHeight)? $default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _ProjectViewSettingsData() when $default != null:
|
|
return $default(_that.propertiesOpen, _that.timelineHeight);
|
|
case _:
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
|
|
class _ProjectViewSettingsData extends ProjectViewSettingsData {
|
|
const _ProjectViewSettingsData({
|
|
this.propertiesOpen = false,
|
|
this.timelineHeight,
|
|
}) : super._();
|
|
|
|
@override
|
|
@JsonKey()
|
|
final bool propertiesOpen;
|
|
@override
|
|
final double? timelineHeight;
|
|
|
|
/// Create a copy of ProjectViewSettingsData
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
_$ProjectViewSettingsDataCopyWith<_ProjectViewSettingsData> get copyWith =>
|
|
__$ProjectViewSettingsDataCopyWithImpl<_ProjectViewSettingsData>(
|
|
this,
|
|
_$identity,
|
|
);
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is _ProjectViewSettingsData &&
|
|
(identical(other.propertiesOpen, propertiesOpen) ||
|
|
other.propertiesOpen == propertiesOpen) &&
|
|
(identical(other.timelineHeight, timelineHeight) ||
|
|
other.timelineHeight == timelineHeight));
|
|
}
|
|
|
|
@override
|
|
int get hashCode {
|
|
return Object.hash(runtimeType, propertiesOpen, timelineHeight);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return 'ProjectViewSettingsData(propertiesOpen: $propertiesOpen, timelineHeight: $timelineHeight)';
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class _$ProjectViewSettingsDataCopyWith<$Res>
|
|
implements $ProjectViewSettingsDataCopyWith<$Res> {
|
|
factory _$ProjectViewSettingsDataCopyWith(
|
|
_ProjectViewSettingsData value,
|
|
$Res Function(_ProjectViewSettingsData) _then,
|
|
) = __$ProjectViewSettingsDataCopyWithImpl;
|
|
@override
|
|
@useResult
|
|
$Res call({bool propertiesOpen, double? timelineHeight});
|
|
}
|
|
|
|
/// @nodoc
|
|
class __$ProjectViewSettingsDataCopyWithImpl<$Res>
|
|
implements _$ProjectViewSettingsDataCopyWith<$Res> {
|
|
__$ProjectViewSettingsDataCopyWithImpl(this._self, this._then);
|
|
|
|
final _ProjectViewSettingsData _self;
|
|
final $Res Function(_ProjectViewSettingsData) _then;
|
|
|
|
/// Create a copy of ProjectViewSettingsData
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$Res call({Object? propertiesOpen = null, Object? timelineHeight = freezed}) {
|
|
return _then(
|
|
_ProjectViewSettingsData(
|
|
propertiesOpen: null == propertiesOpen
|
|
? _self.propertiesOpen
|
|
: propertiesOpen // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
timelineHeight: freezed == timelineHeight
|
|
? _self.timelineHeight
|
|
: timelineHeight // ignore: cast_nullable_to_non_nullable
|
|
as double?,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
mixin _$TimelineSequenceViewState {
|
|
int get playheadTick;
|
|
TimelineCamera get camera;
|
|
|
|
/// Create a copy of TimelineSequenceViewState
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
$TimelineSequenceViewStateCopyWith<TimelineSequenceViewState> get copyWith =>
|
|
_$TimelineSequenceViewStateCopyWithImpl<TimelineSequenceViewState>(
|
|
this as TimelineSequenceViewState,
|
|
_$identity,
|
|
);
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
final _this = this as TimelineSequenceViewState;
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is TimelineSequenceViewState &&
|
|
(identical(other.playheadTick, _this.playheadTick) ||
|
|
other.playheadTick == _this.playheadTick) &&
|
|
(identical(other.camera, _this.camera) ||
|
|
other.camera == _this.camera));
|
|
}
|
|
|
|
@override
|
|
int get hashCode {
|
|
final _this = this as TimelineSequenceViewState;
|
|
return Object.hash(runtimeType, _this.playheadTick, _this.camera);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
final _this = this as TimelineSequenceViewState;
|
|
return 'TimelineSequenceViewState(playheadTick: ${_this.playheadTick}, camera: ${_this.camera})';
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class $TimelineSequenceViewStateCopyWith<$Res> {
|
|
factory $TimelineSequenceViewStateCopyWith(
|
|
TimelineSequenceViewState value,
|
|
$Res Function(TimelineSequenceViewState) _then,
|
|
) = _$TimelineSequenceViewStateCopyWithImpl;
|
|
@useResult
|
|
$Res call({int playheadTick, TimelineCamera camera});
|
|
}
|
|
|
|
/// @nodoc
|
|
class _$TimelineSequenceViewStateCopyWithImpl<$Res>
|
|
implements $TimelineSequenceViewStateCopyWith<$Res> {
|
|
_$TimelineSequenceViewStateCopyWithImpl(this._self, this._then);
|
|
|
|
final TimelineSequenceViewState _self;
|
|
final $Res Function(TimelineSequenceViewState) _then;
|
|
|
|
/// Create a copy of TimelineSequenceViewState
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({Object? playheadTick = null, Object? camera = null}) {
|
|
return _then(
|
|
TimelineSequenceViewState(
|
|
playheadTick: null == playheadTick
|
|
? _self.playheadTick
|
|
: playheadTick // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
camera: null == camera
|
|
? _self.camera
|
|
: camera // ignore: cast_nullable_to_non_nullable
|
|
as TimelineCamera,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// Adds pattern-matching-related methods to [TimelineSequenceViewState].
|
|
extension TimelineSequenceViewStatePatterns on TimelineSequenceViewState {
|
|
/// A variant of `map` that fallback to returning `orElse`.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case _:
|
|
/// return orElse();
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult maybeMap<TResult extends Object?>(
|
|
TResult Function(_TimelineSequenceViewState value)? $default, {
|
|
required TResult orElse(),
|
|
}) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _TimelineSequenceViewState() when $default != null:
|
|
return $default(_that);
|
|
case _:
|
|
return orElse();
|
|
}
|
|
}
|
|
|
|
/// A `switch`-like method, using callbacks.
|
|
///
|
|
/// Callbacks receives the raw object, upcasted.
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case final Subclass2 value:
|
|
/// return ...;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult map<TResult extends Object?>(
|
|
TResult Function(_TimelineSequenceViewState value) $default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _TimelineSequenceViewState():
|
|
return $default(_that);
|
|
case _:
|
|
throw StateError('Unexpected subclass');
|
|
}
|
|
}
|
|
|
|
/// A variant of `map` that fallback to returning `null`.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case _:
|
|
/// return null;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult? mapOrNull<TResult extends Object?>(
|
|
TResult? Function(_TimelineSequenceViewState value)? $default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _TimelineSequenceViewState() when $default != null:
|
|
return $default(_that);
|
|
case _:
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/// A variant of `when` that fallback to an `orElse` callback.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case _:
|
|
/// return orElse();
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult maybeWhen<TResult extends Object?>(
|
|
TResult Function(int playheadTick, TimelineCamera camera)? $default, {
|
|
required TResult orElse(),
|
|
}) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _TimelineSequenceViewState() when $default != null:
|
|
return $default(_that.playheadTick, _that.camera);
|
|
case _:
|
|
return orElse();
|
|
}
|
|
}
|
|
|
|
/// A `switch`-like method, using callbacks.
|
|
///
|
|
/// As opposed to `map`, this offers destructuring.
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case Subclass2(:final field2):
|
|
/// return ...;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult when<TResult extends Object?>(
|
|
TResult Function(int playheadTick, TimelineCamera camera) $default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _TimelineSequenceViewState():
|
|
return $default(_that.playheadTick, _that.camera);
|
|
case _:
|
|
throw StateError('Unexpected subclass');
|
|
}
|
|
}
|
|
|
|
/// A variant of `when` that fallback to returning `null`
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case _:
|
|
/// return null;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult? whenOrNull<TResult extends Object?>(
|
|
TResult? Function(int playheadTick, TimelineCamera camera)? $default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _TimelineSequenceViewState() when $default != null:
|
|
return $default(_that.playheadTick, _that.camera);
|
|
case _:
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
|
|
class _TimelineSequenceViewState extends TimelineSequenceViewState {
|
|
const _TimelineSequenceViewState({
|
|
required this.playheadTick,
|
|
required this.camera,
|
|
}) : super._();
|
|
|
|
@override
|
|
final int playheadTick;
|
|
@override
|
|
final TimelineCamera camera;
|
|
|
|
/// Create a copy of TimelineSequenceViewState
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
_$TimelineSequenceViewStateCopyWith<_TimelineSequenceViewState>
|
|
get copyWith =>
|
|
__$TimelineSequenceViewStateCopyWithImpl<_TimelineSequenceViewState>(
|
|
this,
|
|
_$identity,
|
|
);
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is _TimelineSequenceViewState &&
|
|
(identical(other.playheadTick, playheadTick) ||
|
|
other.playheadTick == playheadTick) &&
|
|
(identical(other.camera, camera) || other.camera == camera));
|
|
}
|
|
|
|
@override
|
|
int get hashCode {
|
|
return Object.hash(runtimeType, playheadTick, camera);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return 'TimelineSequenceViewState(playheadTick: $playheadTick, camera: $camera)';
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class _$TimelineSequenceViewStateCopyWith<$Res>
|
|
implements $TimelineSequenceViewStateCopyWith<$Res> {
|
|
factory _$TimelineSequenceViewStateCopyWith(
|
|
_TimelineSequenceViewState value,
|
|
$Res Function(_TimelineSequenceViewState) _then,
|
|
) = __$TimelineSequenceViewStateCopyWithImpl;
|
|
@override
|
|
@useResult
|
|
$Res call({int playheadTick, TimelineCamera camera});
|
|
}
|
|
|
|
/// @nodoc
|
|
class __$TimelineSequenceViewStateCopyWithImpl<$Res>
|
|
implements _$TimelineSequenceViewStateCopyWith<$Res> {
|
|
__$TimelineSequenceViewStateCopyWithImpl(this._self, this._then);
|
|
|
|
final _TimelineSequenceViewState _self;
|
|
final $Res Function(_TimelineSequenceViewState) _then;
|
|
|
|
/// Create a copy of TimelineSequenceViewState
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$Res call({Object? playheadTick = null, Object? camera = null}) {
|
|
return _then(
|
|
_TimelineSequenceViewState(
|
|
playheadTick: null == playheadTick
|
|
? _self.playheadTick
|
|
: playheadTick // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
camera: null == camera
|
|
? _self.camera
|
|
: camera // ignore: cast_nullable_to_non_nullable
|
|
as TimelineCamera,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
mixin _$TimelineViewState {
|
|
SequenceId? get activeSequenceId;
|
|
Map<SequenceId, TimelineSequenceViewState> get sequences;
|
|
|
|
/// Create a copy of TimelineViewState
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
$TimelineViewStateCopyWith<TimelineViewState> get copyWith =>
|
|
_$TimelineViewStateCopyWithImpl<TimelineViewState>(
|
|
this as TimelineViewState,
|
|
_$identity,
|
|
);
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
final _this = this as TimelineViewState;
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is TimelineViewState &&
|
|
(identical(other.activeSequenceId, _this.activeSequenceId) ||
|
|
other.activeSequenceId == _this.activeSequenceId) &&
|
|
const DeepCollectionEquality().equals(
|
|
other.sequences,
|
|
_this.sequences,
|
|
));
|
|
}
|
|
|
|
@override
|
|
int get hashCode {
|
|
final _this = this as TimelineViewState;
|
|
return Object.hash(
|
|
runtimeType,
|
|
_this.activeSequenceId,
|
|
const DeepCollectionEquality().hash(_this.sequences),
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
final _this = this as TimelineViewState;
|
|
return 'TimelineViewState(activeSequenceId: ${_this.activeSequenceId}, sequences: ${_this.sequences})';
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class $TimelineViewStateCopyWith<$Res> {
|
|
factory $TimelineViewStateCopyWith(
|
|
TimelineViewState value,
|
|
$Res Function(TimelineViewState) _then,
|
|
) = _$TimelineViewStateCopyWithImpl;
|
|
@useResult
|
|
$Res call({
|
|
SequenceId? activeSequenceId,
|
|
Map<SequenceId, TimelineSequenceViewState> sequences,
|
|
});
|
|
}
|
|
|
|
/// @nodoc
|
|
class _$TimelineViewStateCopyWithImpl<$Res>
|
|
implements $TimelineViewStateCopyWith<$Res> {
|
|
_$TimelineViewStateCopyWithImpl(this._self, this._then);
|
|
|
|
final TimelineViewState _self;
|
|
final $Res Function(TimelineViewState) _then;
|
|
|
|
/// Create a copy of TimelineViewState
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({Object? activeSequenceId = freezed, Object? sequences = null}) {
|
|
return _then(
|
|
TimelineViewState(
|
|
activeSequenceId: freezed == activeSequenceId
|
|
? _self.activeSequenceId
|
|
: activeSequenceId // ignore: cast_nullable_to_non_nullable
|
|
as SequenceId?,
|
|
sequences: null == sequences
|
|
? _self.sequences
|
|
: sequences // ignore: cast_nullable_to_non_nullable
|
|
as Map<SequenceId, TimelineSequenceViewState>,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// Adds pattern-matching-related methods to [TimelineViewState].
|
|
extension TimelineViewStatePatterns on TimelineViewState {
|
|
/// A variant of `map` that fallback to returning `orElse`.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case _:
|
|
/// return orElse();
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult maybeMap<TResult extends Object?>(
|
|
TResult Function(_TimelineViewState value)? $default, {
|
|
required TResult orElse(),
|
|
}) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _TimelineViewState() when $default != null:
|
|
return $default(_that);
|
|
case _:
|
|
return orElse();
|
|
}
|
|
}
|
|
|
|
/// A `switch`-like method, using callbacks.
|
|
///
|
|
/// Callbacks receives the raw object, upcasted.
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case final Subclass2 value:
|
|
/// return ...;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult map<TResult extends Object?>(
|
|
TResult Function(_TimelineViewState value) $default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _TimelineViewState():
|
|
return $default(_that);
|
|
case _:
|
|
throw StateError('Unexpected subclass');
|
|
}
|
|
}
|
|
|
|
/// A variant of `map` that fallback to returning `null`.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case _:
|
|
/// return null;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult? mapOrNull<TResult extends Object?>(
|
|
TResult? Function(_TimelineViewState value)? $default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _TimelineViewState() when $default != null:
|
|
return $default(_that);
|
|
case _:
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/// A variant of `when` that fallback to an `orElse` callback.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case _:
|
|
/// return orElse();
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult maybeWhen<TResult extends Object?>(
|
|
TResult Function(
|
|
SequenceId? activeSequenceId,
|
|
Map<SequenceId, TimelineSequenceViewState> sequences,
|
|
)?
|
|
$default, {
|
|
required TResult orElse(),
|
|
}) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _TimelineViewState() when $default != null:
|
|
return $default(_that.activeSequenceId, _that.sequences);
|
|
case _:
|
|
return orElse();
|
|
}
|
|
}
|
|
|
|
/// A `switch`-like method, using callbacks.
|
|
///
|
|
/// As opposed to `map`, this offers destructuring.
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case Subclass2(:final field2):
|
|
/// return ...;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult when<TResult extends Object?>(
|
|
TResult Function(
|
|
SequenceId? activeSequenceId,
|
|
Map<SequenceId, TimelineSequenceViewState> sequences,
|
|
)
|
|
$default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _TimelineViewState():
|
|
return $default(_that.activeSequenceId, _that.sequences);
|
|
case _:
|
|
throw StateError('Unexpected subclass');
|
|
}
|
|
}
|
|
|
|
/// A variant of `when` that fallback to returning `null`
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case _:
|
|
/// return null;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs
|
|
TResult? whenOrNull<TResult extends Object?>(
|
|
TResult? Function(
|
|
SequenceId? activeSequenceId,
|
|
Map<SequenceId, TimelineSequenceViewState> sequences,
|
|
)?
|
|
$default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _TimelineViewState() when $default != null:
|
|
return $default(_that.activeSequenceId, _that.sequences);
|
|
case _:
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
|
|
class _TimelineViewState implements TimelineViewState {
|
|
const _TimelineViewState({
|
|
this.activeSequenceId,
|
|
Map<SequenceId, TimelineSequenceViewState> sequences = const {},
|
|
}) : _sequences = sequences;
|
|
|
|
@override
|
|
final SequenceId? activeSequenceId;
|
|
final Map<SequenceId, TimelineSequenceViewState> _sequences;
|
|
@override
|
|
@JsonKey()
|
|
Map<SequenceId, TimelineSequenceViewState> get sequences {
|
|
if (_sequences is EqualUnmodifiableMapView) return _sequences;
|
|
// ignore: implicit_dynamic_type
|
|
return EqualUnmodifiableMapView(_sequences);
|
|
}
|
|
|
|
/// Create a copy of TimelineViewState
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
_$TimelineViewStateCopyWith<_TimelineViewState> get copyWith =>
|
|
__$TimelineViewStateCopyWithImpl<_TimelineViewState>(this, _$identity);
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is _TimelineViewState &&
|
|
(identical(other.activeSequenceId, activeSequenceId) ||
|
|
other.activeSequenceId == activeSequenceId) &&
|
|
const DeepCollectionEquality().equals(other.sequences, _sequences));
|
|
}
|
|
|
|
@override
|
|
int get hashCode {
|
|
return Object.hash(
|
|
runtimeType,
|
|
activeSequenceId,
|
|
const DeepCollectionEquality().hash(_sequences),
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return 'TimelineViewState(activeSequenceId: $activeSequenceId, sequences: $sequences)';
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class _$TimelineViewStateCopyWith<$Res>
|
|
implements $TimelineViewStateCopyWith<$Res> {
|
|
factory _$TimelineViewStateCopyWith(
|
|
_TimelineViewState value,
|
|
$Res Function(_TimelineViewState) _then,
|
|
) = __$TimelineViewStateCopyWithImpl;
|
|
@override
|
|
@useResult
|
|
$Res call({
|
|
SequenceId? activeSequenceId,
|
|
Map<SequenceId, TimelineSequenceViewState> sequences,
|
|
});
|
|
}
|
|
|
|
/// @nodoc
|
|
class __$TimelineViewStateCopyWithImpl<$Res>
|
|
implements _$TimelineViewStateCopyWith<$Res> {
|
|
__$TimelineViewStateCopyWithImpl(this._self, this._then);
|
|
|
|
final _TimelineViewState _self;
|
|
final $Res Function(_TimelineViewState) _then;
|
|
|
|
/// Create a copy of TimelineViewState
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$Res call({Object? activeSequenceId = freezed, Object? sequences = null}) {
|
|
return _then(
|
|
_TimelineViewState(
|
|
activeSequenceId: freezed == activeSequenceId
|
|
? _self.activeSequenceId
|
|
: activeSequenceId // ignore: cast_nullable_to_non_nullable
|
|
as SequenceId?,
|
|
sequences: null == sequences
|
|
? _self._sequences
|
|
: sequences // ignore: cast_nullable_to_non_nullable
|
|
as Map<SequenceId, TimelineSequenceViewState>,
|
|
),
|
|
);
|
|
}
|
|
}
|