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.
1014 lines
28 KiB
Dart
1014 lines
28 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 'project_state.dart';
|
|
|
|
// **************************************************************************
|
|
// FreezedGenerator
|
|
// **************************************************************************
|
|
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
T _$identity<T>(T value) => value;
|
|
|
|
/// @nodoc
|
|
mixin _$RecentProject {
|
|
String get id;
|
|
String get name;
|
|
String get path;
|
|
ProjectAvailability get availability;
|
|
|
|
/// Create a copy of RecentProject
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
$RecentProjectCopyWith<RecentProject> get copyWith =>
|
|
_$RecentProjectCopyWithImpl<RecentProject>(
|
|
this as RecentProject,
|
|
_$identity,
|
|
);
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
final _this = this as RecentProject;
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is RecentProject &&
|
|
(identical(other.id, _this.id) || other.id == _this.id) &&
|
|
(identical(other.name, _this.name) || other.name == _this.name) &&
|
|
(identical(other.path, _this.path) || other.path == _this.path) &&
|
|
(identical(other.availability, _this.availability) ||
|
|
other.availability == _this.availability));
|
|
}
|
|
|
|
@override
|
|
int get hashCode {
|
|
final _this = this as RecentProject;
|
|
return Object.hash(
|
|
runtimeType,
|
|
_this.id,
|
|
_this.name,
|
|
_this.path,
|
|
_this.availability,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
final _this = this as RecentProject;
|
|
return 'RecentProject(id: ${_this.id}, name: ${_this.name}, path: ${_this.path}, availability: ${_this.availability})';
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class $RecentProjectCopyWith<$Res> {
|
|
factory $RecentProjectCopyWith(
|
|
RecentProject value,
|
|
$Res Function(RecentProject) _then,
|
|
) = _$RecentProjectCopyWithImpl;
|
|
@useResult
|
|
$Res call({
|
|
String id,
|
|
String name,
|
|
String path,
|
|
ProjectAvailability availability,
|
|
});
|
|
}
|
|
|
|
/// @nodoc
|
|
class _$RecentProjectCopyWithImpl<$Res>
|
|
implements $RecentProjectCopyWith<$Res> {
|
|
_$RecentProjectCopyWithImpl(this._self, this._then);
|
|
|
|
final RecentProject _self;
|
|
final $Res Function(RecentProject) _then;
|
|
|
|
/// Create a copy of RecentProject
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? id = null,
|
|
Object? name = null,
|
|
Object? path = null,
|
|
Object? availability = null,
|
|
}) {
|
|
return _then(
|
|
RecentProject(
|
|
id: null == id
|
|
? _self.id
|
|
: id // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
name: null == name
|
|
? _self.name
|
|
: name // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
path: null == path
|
|
? _self.path
|
|
: path // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
availability: null == availability
|
|
? _self.availability
|
|
: availability // ignore: cast_nullable_to_non_nullable
|
|
as ProjectAvailability,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// Adds pattern-matching-related methods to [RecentProject].
|
|
extension RecentProjectPatterns on RecentProject {
|
|
/// 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(_RecentProject value)? $default, {
|
|
required TResult orElse(),
|
|
}) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _RecentProject() 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(_RecentProject value) $default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _RecentProject():
|
|
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(_RecentProject value)? $default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _RecentProject() 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(
|
|
String id,
|
|
String name,
|
|
String path,
|
|
ProjectAvailability availability,
|
|
)?
|
|
$default, {
|
|
required TResult orElse(),
|
|
}) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _RecentProject() when $default != null:
|
|
return $default(_that.id, _that.name, _that.path, _that.availability);
|
|
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(
|
|
String id,
|
|
String name,
|
|
String path,
|
|
ProjectAvailability availability,
|
|
)
|
|
$default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _RecentProject():
|
|
return $default(_that.id, _that.name, _that.path, _that.availability);
|
|
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(
|
|
String id,
|
|
String name,
|
|
String path,
|
|
ProjectAvailability availability,
|
|
)?
|
|
$default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _RecentProject() when $default != null:
|
|
return $default(_that.id, _that.name, _that.path, _that.availability);
|
|
case _:
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
|
|
class _RecentProject implements RecentProject {
|
|
const _RecentProject({
|
|
required this.id,
|
|
required this.name,
|
|
required this.path,
|
|
this.availability = ProjectAvailability.available,
|
|
});
|
|
|
|
@override
|
|
final String id;
|
|
@override
|
|
final String name;
|
|
@override
|
|
final String path;
|
|
@override
|
|
@JsonKey()
|
|
final ProjectAvailability availability;
|
|
|
|
/// Create a copy of RecentProject
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
_$RecentProjectCopyWith<_RecentProject> get copyWith =>
|
|
__$RecentProjectCopyWithImpl<_RecentProject>(this, _$identity);
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is _RecentProject &&
|
|
(identical(other.id, id) || other.id == id) &&
|
|
(identical(other.name, name) || other.name == name) &&
|
|
(identical(other.path, path) || other.path == path) &&
|
|
(identical(other.availability, availability) ||
|
|
other.availability == availability));
|
|
}
|
|
|
|
@override
|
|
int get hashCode {
|
|
return Object.hash(runtimeType, id, name, path, availability);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return 'RecentProject(id: $id, name: $name, path: $path, availability: $availability)';
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class _$RecentProjectCopyWith<$Res>
|
|
implements $RecentProjectCopyWith<$Res> {
|
|
factory _$RecentProjectCopyWith(
|
|
_RecentProject value,
|
|
$Res Function(_RecentProject) _then,
|
|
) = __$RecentProjectCopyWithImpl;
|
|
@override
|
|
@useResult
|
|
$Res call({
|
|
String id,
|
|
String name,
|
|
String path,
|
|
ProjectAvailability availability,
|
|
});
|
|
}
|
|
|
|
/// @nodoc
|
|
class __$RecentProjectCopyWithImpl<$Res>
|
|
implements _$RecentProjectCopyWith<$Res> {
|
|
__$RecentProjectCopyWithImpl(this._self, this._then);
|
|
|
|
final _RecentProject _self;
|
|
final $Res Function(_RecentProject) _then;
|
|
|
|
/// Create a copy of RecentProject
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$Res call({
|
|
Object? id = null,
|
|
Object? name = null,
|
|
Object? path = null,
|
|
Object? availability = null,
|
|
}) {
|
|
return _then(
|
|
_RecentProject(
|
|
id: null == id
|
|
? _self.id
|
|
: id // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
name: null == name
|
|
? _self.name
|
|
: name // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
path: null == path
|
|
? _self.path
|
|
: path // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
availability: null == availability
|
|
? _self.availability
|
|
: availability // ignore: cast_nullable_to_non_nullable
|
|
as ProjectAvailability,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
mixin _$ProjectState {
|
|
List<RecentProject> get recent;
|
|
RecentProject? get activeProject;
|
|
List<TimelineSummary> get timelines;
|
|
List<AssetDocument> get assets;
|
|
TimelineDocument? get timeline;
|
|
bool get projectBusy;
|
|
String? get openingTimelineId;
|
|
bool get creatingTimeline;
|
|
AppFailure? get error;
|
|
|
|
/// Create a copy of ProjectState
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
$ProjectStateCopyWith<ProjectState> get copyWith =>
|
|
_$ProjectStateCopyWithImpl<ProjectState>(
|
|
this as ProjectState,
|
|
_$identity,
|
|
);
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
final _this = this as ProjectState;
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is ProjectState &&
|
|
const DeepCollectionEquality().equals(other.recent, _this.recent) &&
|
|
(identical(other.activeProject, _this.activeProject) ||
|
|
other.activeProject == _this.activeProject) &&
|
|
const DeepCollectionEquality().equals(
|
|
other.timelines,
|
|
_this.timelines,
|
|
) &&
|
|
const DeepCollectionEquality().equals(other.assets, _this.assets) &&
|
|
(identical(other.timeline, _this.timeline) ||
|
|
other.timeline == _this.timeline) &&
|
|
(identical(other.projectBusy, _this.projectBusy) ||
|
|
other.projectBusy == _this.projectBusy) &&
|
|
(identical(other.openingTimelineId, _this.openingTimelineId) ||
|
|
other.openingTimelineId == _this.openingTimelineId) &&
|
|
(identical(other.creatingTimeline, _this.creatingTimeline) ||
|
|
other.creatingTimeline == _this.creatingTimeline) &&
|
|
(identical(other.error, _this.error) ||
|
|
other.error == _this.error));
|
|
}
|
|
|
|
@override
|
|
int get hashCode {
|
|
final _this = this as ProjectState;
|
|
return Object.hash(
|
|
runtimeType,
|
|
const DeepCollectionEquality().hash(_this.recent),
|
|
_this.activeProject,
|
|
const DeepCollectionEquality().hash(_this.timelines),
|
|
const DeepCollectionEquality().hash(_this.assets),
|
|
_this.timeline,
|
|
_this.projectBusy,
|
|
_this.openingTimelineId,
|
|
_this.creatingTimeline,
|
|
_this.error,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
final _this = this as ProjectState;
|
|
return 'ProjectState(recent: ${_this.recent}, activeProject: ${_this.activeProject}, timelines: ${_this.timelines}, assets: ${_this.assets}, timeline: ${_this.timeline}, projectBusy: ${_this.projectBusy}, openingTimelineId: ${_this.openingTimelineId}, creatingTimeline: ${_this.creatingTimeline}, error: ${_this.error})';
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class $ProjectStateCopyWith<$Res> {
|
|
factory $ProjectStateCopyWith(
|
|
ProjectState value,
|
|
$Res Function(ProjectState) _then,
|
|
) = _$ProjectStateCopyWithImpl;
|
|
@useResult
|
|
$Res call({
|
|
List<RecentProject> recent,
|
|
RecentProject? activeProject,
|
|
List<TimelineSummary> timelines,
|
|
List<AssetDocument> assets,
|
|
TimelineDocument? timeline,
|
|
bool projectBusy,
|
|
String? openingTimelineId,
|
|
bool creatingTimeline,
|
|
AppFailure? error,
|
|
});
|
|
|
|
$RecentProjectCopyWith<$Res>? get activeProject;
|
|
}
|
|
|
|
/// @nodoc
|
|
class _$ProjectStateCopyWithImpl<$Res> implements $ProjectStateCopyWith<$Res> {
|
|
_$ProjectStateCopyWithImpl(this._self, this._then);
|
|
|
|
final ProjectState _self;
|
|
final $Res Function(ProjectState) _then;
|
|
|
|
/// Create a copy of ProjectState
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? recent = null,
|
|
Object? activeProject = freezed,
|
|
Object? timelines = null,
|
|
Object? assets = null,
|
|
Object? timeline = freezed,
|
|
Object? projectBusy = null,
|
|
Object? openingTimelineId = freezed,
|
|
Object? creatingTimeline = null,
|
|
Object? error = freezed,
|
|
}) {
|
|
return _then(
|
|
ProjectState(
|
|
recent: null == recent
|
|
? _self.recent
|
|
: recent // ignore: cast_nullable_to_non_nullable
|
|
as List<RecentProject>,
|
|
activeProject: freezed == activeProject
|
|
? _self.activeProject
|
|
: activeProject // ignore: cast_nullable_to_non_nullable
|
|
as RecentProject?,
|
|
timelines: null == timelines
|
|
? _self.timelines
|
|
: timelines // ignore: cast_nullable_to_non_nullable
|
|
as List<TimelineSummary>,
|
|
assets: null == assets
|
|
? _self.assets
|
|
: assets // ignore: cast_nullable_to_non_nullable
|
|
as List<AssetDocument>,
|
|
timeline: freezed == timeline
|
|
? _self.timeline
|
|
: timeline // ignore: cast_nullable_to_non_nullable
|
|
as TimelineDocument?,
|
|
projectBusy: null == projectBusy
|
|
? _self.projectBusy
|
|
: projectBusy // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
openingTimelineId: freezed == openingTimelineId
|
|
? _self.openingTimelineId
|
|
: openingTimelineId // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
creatingTimeline: null == creatingTimeline
|
|
? _self.creatingTimeline
|
|
: creatingTimeline // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
error: freezed == error
|
|
? _self.error
|
|
: error // ignore: cast_nullable_to_non_nullable
|
|
as AppFailure?,
|
|
),
|
|
);
|
|
}
|
|
|
|
/// Create a copy of ProjectState
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$RecentProjectCopyWith<$Res>? get activeProject {
|
|
if (_self.activeProject == null) {
|
|
return null;
|
|
}
|
|
|
|
return $RecentProjectCopyWith<$Res>(_self.activeProject!, (value) {
|
|
return _then(_self.copyWith(activeProject: value));
|
|
});
|
|
}
|
|
}
|
|
|
|
/// Adds pattern-matching-related methods to [ProjectState].
|
|
extension ProjectStatePatterns on ProjectState {
|
|
/// 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(_ProjectState value)? $default, {
|
|
required TResult orElse(),
|
|
}) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _ProjectState() 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(_ProjectState value) $default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _ProjectState():
|
|
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(_ProjectState value)? $default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _ProjectState() 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(
|
|
List<RecentProject> recent,
|
|
RecentProject? activeProject,
|
|
List<TimelineSummary> timelines,
|
|
List<AssetDocument> assets,
|
|
TimelineDocument? timeline,
|
|
bool projectBusy,
|
|
String? openingTimelineId,
|
|
bool creatingTimeline,
|
|
AppFailure? error,
|
|
)?
|
|
$default, {
|
|
required TResult orElse(),
|
|
}) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _ProjectState() when $default != null:
|
|
return $default(
|
|
_that.recent,
|
|
_that.activeProject,
|
|
_that.timelines,
|
|
_that.assets,
|
|
_that.timeline,
|
|
_that.projectBusy,
|
|
_that.openingTimelineId,
|
|
_that.creatingTimeline,
|
|
_that.error,
|
|
);
|
|
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(
|
|
List<RecentProject> recent,
|
|
RecentProject? activeProject,
|
|
List<TimelineSummary> timelines,
|
|
List<AssetDocument> assets,
|
|
TimelineDocument? timeline,
|
|
bool projectBusy,
|
|
String? openingTimelineId,
|
|
bool creatingTimeline,
|
|
AppFailure? error,
|
|
)
|
|
$default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _ProjectState():
|
|
return $default(
|
|
_that.recent,
|
|
_that.activeProject,
|
|
_that.timelines,
|
|
_that.assets,
|
|
_that.timeline,
|
|
_that.projectBusy,
|
|
_that.openingTimelineId,
|
|
_that.creatingTimeline,
|
|
_that.error,
|
|
);
|
|
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(
|
|
List<RecentProject> recent,
|
|
RecentProject? activeProject,
|
|
List<TimelineSummary> timelines,
|
|
List<AssetDocument> assets,
|
|
TimelineDocument? timeline,
|
|
bool projectBusy,
|
|
String? openingTimelineId,
|
|
bool creatingTimeline,
|
|
AppFailure? error,
|
|
)?
|
|
$default,
|
|
) {
|
|
final _that = this;
|
|
switch (_that) {
|
|
case _ProjectState() when $default != null:
|
|
return $default(
|
|
_that.recent,
|
|
_that.activeProject,
|
|
_that.timelines,
|
|
_that.assets,
|
|
_that.timeline,
|
|
_that.projectBusy,
|
|
_that.openingTimelineId,
|
|
_that.creatingTimeline,
|
|
_that.error,
|
|
);
|
|
case _:
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
|
|
class _ProjectState implements ProjectState {
|
|
const _ProjectState({
|
|
List<RecentProject> recent = const [],
|
|
this.activeProject,
|
|
List<TimelineSummary> timelines = const [],
|
|
List<AssetDocument> assets = const [],
|
|
this.timeline,
|
|
this.projectBusy = false,
|
|
this.openingTimelineId,
|
|
this.creatingTimeline = false,
|
|
this.error,
|
|
}) : _recent = recent,
|
|
_timelines = timelines,
|
|
_assets = assets;
|
|
|
|
final List<RecentProject> _recent;
|
|
@override
|
|
@JsonKey()
|
|
List<RecentProject> get recent {
|
|
if (_recent is EqualUnmodifiableListView) return _recent;
|
|
// ignore: implicit_dynamic_type
|
|
return EqualUnmodifiableListView(_recent);
|
|
}
|
|
|
|
@override
|
|
final RecentProject? activeProject;
|
|
final List<TimelineSummary> _timelines;
|
|
@override
|
|
@JsonKey()
|
|
List<TimelineSummary> get timelines {
|
|
if (_timelines is EqualUnmodifiableListView) return _timelines;
|
|
// ignore: implicit_dynamic_type
|
|
return EqualUnmodifiableListView(_timelines);
|
|
}
|
|
|
|
final List<AssetDocument> _assets;
|
|
@override
|
|
@JsonKey()
|
|
List<AssetDocument> get assets {
|
|
if (_assets is EqualUnmodifiableListView) return _assets;
|
|
// ignore: implicit_dynamic_type
|
|
return EqualUnmodifiableListView(_assets);
|
|
}
|
|
|
|
@override
|
|
final TimelineDocument? timeline;
|
|
@override
|
|
@JsonKey()
|
|
final bool projectBusy;
|
|
@override
|
|
final String? openingTimelineId;
|
|
@override
|
|
@JsonKey()
|
|
final bool creatingTimeline;
|
|
@override
|
|
final AppFailure? error;
|
|
|
|
/// Create a copy of ProjectState
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@pragma('vm:prefer-inline')
|
|
_$ProjectStateCopyWith<_ProjectState> get copyWith =>
|
|
__$ProjectStateCopyWithImpl<_ProjectState>(this, _$identity);
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is _ProjectState &&
|
|
const DeepCollectionEquality().equals(other.recent, _recent) &&
|
|
(identical(other.activeProject, activeProject) ||
|
|
other.activeProject == activeProject) &&
|
|
const DeepCollectionEquality().equals(
|
|
other.timelines,
|
|
_timelines,
|
|
) &&
|
|
const DeepCollectionEquality().equals(other.assets, _assets) &&
|
|
(identical(other.timeline, timeline) ||
|
|
other.timeline == timeline) &&
|
|
(identical(other.projectBusy, projectBusy) ||
|
|
other.projectBusy == projectBusy) &&
|
|
(identical(other.openingTimelineId, openingTimelineId) ||
|
|
other.openingTimelineId == openingTimelineId) &&
|
|
(identical(other.creatingTimeline, creatingTimeline) ||
|
|
other.creatingTimeline == creatingTimeline) &&
|
|
(identical(other.error, error) || other.error == error));
|
|
}
|
|
|
|
@override
|
|
int get hashCode {
|
|
return Object.hash(
|
|
runtimeType,
|
|
const DeepCollectionEquality().hash(_recent),
|
|
activeProject,
|
|
const DeepCollectionEquality().hash(_timelines),
|
|
const DeepCollectionEquality().hash(_assets),
|
|
timeline,
|
|
projectBusy,
|
|
openingTimelineId,
|
|
creatingTimeline,
|
|
error,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return 'ProjectState(recent: $recent, activeProject: $activeProject, timelines: $timelines, assets: $assets, timeline: $timeline, projectBusy: $projectBusy, openingTimelineId: $openingTimelineId, creatingTimeline: $creatingTimeline, error: $error)';
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract mixin class _$ProjectStateCopyWith<$Res>
|
|
implements $ProjectStateCopyWith<$Res> {
|
|
factory _$ProjectStateCopyWith(
|
|
_ProjectState value,
|
|
$Res Function(_ProjectState) _then,
|
|
) = __$ProjectStateCopyWithImpl;
|
|
@override
|
|
@useResult
|
|
$Res call({
|
|
List<RecentProject> recent,
|
|
RecentProject? activeProject,
|
|
List<TimelineSummary> timelines,
|
|
List<AssetDocument> assets,
|
|
TimelineDocument? timeline,
|
|
bool projectBusy,
|
|
String? openingTimelineId,
|
|
bool creatingTimeline,
|
|
AppFailure? error,
|
|
});
|
|
|
|
@override
|
|
$RecentProjectCopyWith<$Res>? get activeProject;
|
|
}
|
|
|
|
/// @nodoc
|
|
class __$ProjectStateCopyWithImpl<$Res>
|
|
implements _$ProjectStateCopyWith<$Res> {
|
|
__$ProjectStateCopyWithImpl(this._self, this._then);
|
|
|
|
final _ProjectState _self;
|
|
final $Res Function(_ProjectState) _then;
|
|
|
|
/// Create a copy of ProjectState
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$Res call({
|
|
Object? recent = null,
|
|
Object? activeProject = freezed,
|
|
Object? timelines = null,
|
|
Object? assets = null,
|
|
Object? timeline = freezed,
|
|
Object? projectBusy = null,
|
|
Object? openingTimelineId = freezed,
|
|
Object? creatingTimeline = null,
|
|
Object? error = freezed,
|
|
}) {
|
|
return _then(
|
|
_ProjectState(
|
|
recent: null == recent
|
|
? _self._recent
|
|
: recent // ignore: cast_nullable_to_non_nullable
|
|
as List<RecentProject>,
|
|
activeProject: freezed == activeProject
|
|
? _self.activeProject
|
|
: activeProject // ignore: cast_nullable_to_non_nullable
|
|
as RecentProject?,
|
|
timelines: null == timelines
|
|
? _self._timelines
|
|
: timelines // ignore: cast_nullable_to_non_nullable
|
|
as List<TimelineSummary>,
|
|
assets: null == assets
|
|
? _self._assets
|
|
: assets // ignore: cast_nullable_to_non_nullable
|
|
as List<AssetDocument>,
|
|
timeline: freezed == timeline
|
|
? _self.timeline
|
|
: timeline // ignore: cast_nullable_to_non_nullable
|
|
as TimelineDocument?,
|
|
projectBusy: null == projectBusy
|
|
? _self.projectBusy
|
|
: projectBusy // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
openingTimelineId: freezed == openingTimelineId
|
|
? _self.openingTimelineId
|
|
: openingTimelineId // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
creatingTimeline: null == creatingTimeline
|
|
? _self.creatingTimeline
|
|
: creatingTimeline // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
error: freezed == error
|
|
? _self.error
|
|
: error // ignore: cast_nullable_to_non_nullable
|
|
as AppFailure?,
|
|
),
|
|
);
|
|
}
|
|
|
|
/// Create a copy of ProjectState
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
$RecentProjectCopyWith<$Res>? get activeProject {
|
|
if (_self.activeProject == null) {
|
|
return null;
|
|
}
|
|
|
|
return $RecentProjectCopyWith<$Res>(_self.activeProject!, (value) {
|
|
return _then(_self.copyWith(activeProject: value));
|
|
});
|
|
}
|
|
}
|