mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
chore:cleanup-packages breaking: remove isar (#474)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
ab6182f69d
commit
6357b9843c
81 changed files with 31400 additions and 25673 deletions
|
|
@ -17,7 +17,7 @@ part 'account_model.freezed.dart';
|
|||
part 'account_model.g.dart';
|
||||
|
||||
@Freezed(copyWith: true)
|
||||
class AccountModel with _$AccountModel {
|
||||
abstract class AccountModel with _$AccountModel {
|
||||
const AccountModel._();
|
||||
|
||||
const factory AccountModel({
|
||||
|
|
@ -52,7 +52,7 @@ class AccountModel with _$AccountModel {
|
|||
}
|
||||
|
||||
@Freezed(copyWith: true)
|
||||
class UserSettings with _$UserSettings {
|
||||
abstract class UserSettings with _$UserSettings {
|
||||
factory UserSettings({
|
||||
@Default(Duration(seconds: 30)) Duration skipForwardDuration,
|
||||
@Default(Duration(seconds: 10)) Duration skipBackDuration,
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -6,8 +6,8 @@ part of 'account_model.dart';
|
|||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$AccountModelImpl _$$AccountModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$AccountModelImpl(
|
||||
_AccountModel _$AccountModelFromJson(Map<String, dynamic> json) =>
|
||||
_AccountModel(
|
||||
name: json['name'] as String,
|
||||
id: json['id'] as String,
|
||||
avatar: json['avatar'] as String,
|
||||
|
|
@ -36,7 +36,7 @@ _$AccountModelImpl _$$AccountModelImplFromJson(Map<String, dynamic> json) =>
|
|||
: UserSettings.fromJson(json['userSettings'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$AccountModelImplToJson(_$AccountModelImpl instance) =>
|
||||
Map<String, dynamic> _$AccountModelToJson(_AccountModel instance) =>
|
||||
<String, dynamic>{
|
||||
'name': instance.name,
|
||||
'id': instance.id,
|
||||
|
|
@ -59,8 +59,8 @@ const _$AuthenticationEnumMap = {
|
|||
Authentication.none: 'none',
|
||||
};
|
||||
|
||||
_$UserSettingsImpl _$$UserSettingsImplFromJson(Map<String, dynamic> json) =>
|
||||
_$UserSettingsImpl(
|
||||
_UserSettings _$UserSettingsFromJson(Map<String, dynamic> json) =>
|
||||
_UserSettings(
|
||||
skipForwardDuration: json['skipForwardDuration'] == null
|
||||
? const Duration(seconds: 30)
|
||||
: Duration(
|
||||
|
|
@ -70,7 +70,7 @@ _$UserSettingsImpl _$$UserSettingsImplFromJson(Map<String, dynamic> json) =>
|
|||
: Duration(microseconds: (json['skipBackDuration'] as num).toInt()),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$UserSettingsImplToJson(_$UserSettingsImpl instance) =>
|
||||
Map<String, dynamic> _$UserSettingsToJson(_UserSettings instance) =>
|
||||
<String, dynamic>{
|
||||
'skipForwardDuration': instance.skipForwardDuration.inMicroseconds,
|
||||
'skipBackDuration': instance.skipBackDuration.inMicroseconds,
|
||||
|
|
|
|||
|
|
@ -112,13 +112,14 @@ class BoxSetModelMapper extends SubClassMapperBase<BoxSetModel> {
|
|||
|
||||
mixin BoxSetModelMappable {
|
||||
BoxSetModelCopyWith<BoxSetModel, BoxSetModel, BoxSetModel> get copyWith =>
|
||||
_BoxSetModelCopyWithImpl(this as BoxSetModel, $identity, $identity);
|
||||
_BoxSetModelCopyWithImpl<BoxSetModel, BoxSetModel>(
|
||||
this as BoxSetModel, $identity, $identity);
|
||||
}
|
||||
|
||||
extension BoxSetModelValueCopy<$R, $Out>
|
||||
on ObjectCopyWith<$R, BoxSetModel, $Out> {
|
||||
BoxSetModelCopyWith<$R, BoxSetModel, $Out> get $asBoxSetModel =>
|
||||
$base.as((v, t, t2) => _BoxSetModelCopyWithImpl(v, t, t2));
|
||||
$base.as((v, t, t2) => _BoxSetModelCopyWithImpl<$R, $Out>(v, t, t2));
|
||||
}
|
||||
|
||||
abstract class BoxSetModelCopyWith<$R, $In extends BoxSetModel, $Out>
|
||||
|
|
@ -215,5 +216,5 @@ class _BoxSetModelCopyWithImpl<$R, $Out>
|
|||
@override
|
||||
BoxSetModelCopyWith<$R2, BoxSetModel, $Out2> $chain<$R2, $Out2>(
|
||||
Then<$Out2, $R2> t) =>
|
||||
_BoxSetModelCopyWithImpl($value, $cast, t);
|
||||
_BoxSetModelCopyWithImpl<$R2, $Out2>($value, $cast, t);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,14 +97,14 @@ class ItemBaseModelMapper extends ClassMapperBase<ItemBaseModel> {
|
|||
|
||||
mixin ItemBaseModelMappable {
|
||||
ItemBaseModelCopyWith<ItemBaseModel, ItemBaseModel, ItemBaseModel>
|
||||
get copyWith => _ItemBaseModelCopyWithImpl(
|
||||
get copyWith => _ItemBaseModelCopyWithImpl<ItemBaseModel, ItemBaseModel>(
|
||||
this as ItemBaseModel, $identity, $identity);
|
||||
}
|
||||
|
||||
extension ItemBaseModelValueCopy<$R, $Out>
|
||||
on ObjectCopyWith<$R, ItemBaseModel, $Out> {
|
||||
ItemBaseModelCopyWith<$R, ItemBaseModel, $Out> get $asItemBaseModel =>
|
||||
$base.as((v, t, t2) => _ItemBaseModelCopyWithImpl(v, t, t2));
|
||||
$base.as((v, t, t2) => _ItemBaseModelCopyWithImpl<$R, $Out>(v, t, t2));
|
||||
}
|
||||
|
||||
abstract class ItemBaseModelCopyWith<$R, $In extends ItemBaseModel, $Out>
|
||||
|
|
@ -187,5 +187,5 @@ class _ItemBaseModelCopyWithImpl<$R, $Out>
|
|||
@override
|
||||
ItemBaseModelCopyWith<$R2, ItemBaseModel, $Out2> $chain<$R2, $Out2>(
|
||||
Then<$Out2, $R2> t) =>
|
||||
_ItemBaseModelCopyWithImpl($value, $cast, t);
|
||||
_ItemBaseModelCopyWithImpl<$R2, $Out2>($value, $cast, t);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,13 +150,14 @@ class EpisodeModelMapper extends SubClassMapperBase<EpisodeModel> {
|
|||
|
||||
mixin EpisodeModelMappable {
|
||||
EpisodeModelCopyWith<EpisodeModel, EpisodeModel, EpisodeModel> get copyWith =>
|
||||
_EpisodeModelCopyWithImpl(this as EpisodeModel, $identity, $identity);
|
||||
_EpisodeModelCopyWithImpl<EpisodeModel, EpisodeModel>(
|
||||
this as EpisodeModel, $identity, $identity);
|
||||
}
|
||||
|
||||
extension EpisodeModelValueCopy<$R, $Out>
|
||||
on ObjectCopyWith<$R, EpisodeModel, $Out> {
|
||||
EpisodeModelCopyWith<$R, EpisodeModel, $Out> get $asEpisodeModel =>
|
||||
$base.as((v, t, t2) => _EpisodeModelCopyWithImpl(v, t, t2));
|
||||
$base.as((v, t, t2) => _EpisodeModelCopyWithImpl<$R, $Out>(v, t, t2));
|
||||
}
|
||||
|
||||
abstract class EpisodeModelCopyWith<$R, $In extends EpisodeModel, $Out>
|
||||
|
|
@ -283,5 +284,5 @@ class _EpisodeModelCopyWithImpl<$R, $Out>
|
|||
@override
|
||||
EpisodeModelCopyWith<$R2, EpisodeModel, $Out2> $chain<$R2, $Out2>(
|
||||
Then<$Out2, $R2> t) =>
|
||||
_EpisodeModelCopyWithImpl($value, $cast, t);
|
||||
_EpisodeModelCopyWithImpl<$R2, $Out2>($value, $cast, t);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,13 +112,14 @@ class FolderModelMapper extends SubClassMapperBase<FolderModel> {
|
|||
|
||||
mixin FolderModelMappable {
|
||||
FolderModelCopyWith<FolderModel, FolderModel, FolderModel> get copyWith =>
|
||||
_FolderModelCopyWithImpl(this as FolderModel, $identity, $identity);
|
||||
_FolderModelCopyWithImpl<FolderModel, FolderModel>(
|
||||
this as FolderModel, $identity, $identity);
|
||||
}
|
||||
|
||||
extension FolderModelValueCopy<$R, $Out>
|
||||
on ObjectCopyWith<$R, FolderModel, $Out> {
|
||||
FolderModelCopyWith<$R, FolderModel, $Out> get $asFolderModel =>
|
||||
$base.as((v, t, t2) => _FolderModelCopyWithImpl(v, t, t2));
|
||||
$base.as((v, t, t2) => _FolderModelCopyWithImpl<$R, $Out>(v, t, t2));
|
||||
}
|
||||
|
||||
abstract class FolderModelCopyWith<$R, $In extends FolderModel, $Out>
|
||||
|
|
@ -215,5 +216,5 @@ class _FolderModelCopyWithImpl<$R, $Out>
|
|||
@override
|
||||
FolderModelCopyWith<$R2, FolderModel, $Out2> $chain<$R2, $Out2>(
|
||||
Then<$Out2, $R2> t) =>
|
||||
_FolderModelCopyWithImpl($value, $cast, t);
|
||||
_FolderModelCopyWithImpl<$R2, $Out2>($value, $cast, t);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
import 'package:fladder/jellyfin/jellyfin_open_api.swagger.dart' as dto;
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
import 'package:fladder/jellyfin/jellyfin_open_api.swagger.dart' as dto;
|
||||
|
||||
part 'item_properties_model.freezed.dart';
|
||||
|
||||
@Freezed(fromJson: false, toJson: false)
|
||||
class ItemPropertiesModel with _$ItemPropertiesModel {
|
||||
abstract class ItemPropertiesModel with _$ItemPropertiesModel {
|
||||
const ItemPropertiesModel._();
|
||||
|
||||
factory ItemPropertiesModel._internal({
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint
|
||||
// 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
|
||||
|
||||
|
|
@ -9,22 +9,181 @@ part of 'item_properties_model.dart';
|
|||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ItemPropertiesModel {
|
||||
bool get canDelete => throw _privateConstructorUsedError;
|
||||
bool get canDownload => throw _privateConstructorUsedError;
|
||||
bool get canDelete;
|
||||
bool get canDownload;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ItemPropertiesModel(canDelete: $canDelete, canDownload: $canDownload)';
|
||||
}
|
||||
}
|
||||
|
||||
/// Adds pattern-matching-related methods to [ItemPropertiesModel].
|
||||
extension ItemPropertiesModelPatterns on ItemPropertiesModel {
|
||||
/// 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(_ItemPropertiesModel value)? _internal,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ItemPropertiesModel() when _internal != null:
|
||||
return _internal(_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?>({
|
||||
required TResult Function(_ItemPropertiesModel value) _internal,
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ItemPropertiesModel():
|
||||
return _internal(_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(_ItemPropertiesModel value)? _internal,
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ItemPropertiesModel() when _internal != null:
|
||||
return _internal(_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 canDelete, bool canDownload)? _internal,
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ItemPropertiesModel() when _internal != null:
|
||||
return _internal(_that.canDelete, _that.canDownload);
|
||||
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?>({
|
||||
required TResult Function(bool canDelete, bool canDownload) _internal,
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ItemPropertiesModel():
|
||||
return _internal(_that.canDelete, _that.canDownload);
|
||||
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 canDelete, bool canDownload)? _internal,
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ItemPropertiesModel() when _internal != null:
|
||||
return _internal(_that.canDelete, _that.canDownload);
|
||||
case _:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$ItemPropertiesModelImpl extends _ItemPropertiesModel {
|
||||
_$ItemPropertiesModelImpl(
|
||||
{required this.canDelete, required this.canDownload})
|
||||
class _ItemPropertiesModel extends ItemPropertiesModel {
|
||||
_ItemPropertiesModel({required this.canDelete, required this.canDownload})
|
||||
: super._();
|
||||
|
||||
@override
|
||||
|
|
@ -38,14 +197,4 @@ class _$ItemPropertiesModelImpl extends _ItemPropertiesModel {
|
|||
}
|
||||
}
|
||||
|
||||
abstract class _ItemPropertiesModel extends ItemPropertiesModel {
|
||||
factory _ItemPropertiesModel(
|
||||
{required final bool canDelete,
|
||||
required final bool canDownload}) = _$ItemPropertiesModelImpl;
|
||||
_ItemPropertiesModel._() : super._();
|
||||
|
||||
@override
|
||||
bool get canDelete;
|
||||
@override
|
||||
bool get canDownload;
|
||||
}
|
||||
// dart format on
|
||||
|
|
|
|||
|
|
@ -91,12 +91,13 @@ mixin UserDataMappable {
|
|||
}
|
||||
|
||||
UserDataCopyWith<UserData, UserData, UserData> get copyWith =>
|
||||
_UserDataCopyWithImpl(this as UserData, $identity, $identity);
|
||||
_UserDataCopyWithImpl<UserData, UserData>(
|
||||
this as UserData, $identity, $identity);
|
||||
}
|
||||
|
||||
extension UserDataValueCopy<$R, $Out> on ObjectCopyWith<$R, UserData, $Out> {
|
||||
UserDataCopyWith<$R, UserData, $Out> get $asUserData =>
|
||||
$base.as((v, t, t2) => _UserDataCopyWithImpl(v, t, t2));
|
||||
$base.as((v, t, t2) => _UserDataCopyWithImpl<$R, $Out>(v, t, t2));
|
||||
}
|
||||
|
||||
abstract class UserDataCopyWith<$R, $In extends UserData, $Out>
|
||||
|
|
@ -154,5 +155,5 @@ class _UserDataCopyWithImpl<$R, $Out>
|
|||
@override
|
||||
UserDataCopyWith<$R2, UserData, $Out2> $chain<$R2, $Out2>(
|
||||
Then<$Out2, $R2> t) =>
|
||||
_UserDataCopyWithImpl($value, $cast, t);
|
||||
_UserDataCopyWithImpl<$R2, $Out2>($value, $cast, t);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,14 +116,15 @@ class ItemStreamModelMapper extends SubClassMapperBase<ItemStreamModel> {
|
|||
|
||||
mixin ItemStreamModelMappable {
|
||||
ItemStreamModelCopyWith<ItemStreamModel, ItemStreamModel, ItemStreamModel>
|
||||
get copyWith => _ItemStreamModelCopyWithImpl(
|
||||
this as ItemStreamModel, $identity, $identity);
|
||||
get copyWith =>
|
||||
_ItemStreamModelCopyWithImpl<ItemStreamModel, ItemStreamModel>(
|
||||
this as ItemStreamModel, $identity, $identity);
|
||||
}
|
||||
|
||||
extension ItemStreamModelValueCopy<$R, $Out>
|
||||
on ObjectCopyWith<$R, ItemStreamModel, $Out> {
|
||||
ItemStreamModelCopyWith<$R, ItemStreamModel, $Out> get $asItemStreamModel =>
|
||||
$base.as((v, t, t2) => _ItemStreamModelCopyWithImpl(v, t, t2));
|
||||
$base.as((v, t, t2) => _ItemStreamModelCopyWithImpl<$R, $Out>(v, t, t2));
|
||||
}
|
||||
|
||||
abstract class ItemStreamModelCopyWith<$R, $In extends ItemStreamModel, $Out>
|
||||
|
|
@ -218,5 +219,5 @@ class _ItemStreamModelCopyWithImpl<$R, $Out>
|
|||
@override
|
||||
ItemStreamModelCopyWith<$R2, ItemStreamModel, $Out2> $chain<$R2, $Out2>(
|
||||
Then<$Out2, $R2> t) =>
|
||||
_ItemStreamModelCopyWithImpl($value, $cast, t);
|
||||
_ItemStreamModelCopyWithImpl<$R2, $Out2>($value, $cast, t);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ part 'media_segments_model.freezed.dart';
|
|||
part 'media_segments_model.g.dart';
|
||||
|
||||
@freezed
|
||||
class MediaSegmentsModel with _$MediaSegmentsModel {
|
||||
abstract class MediaSegmentsModel with _$MediaSegmentsModel {
|
||||
const MediaSegmentsModel._();
|
||||
|
||||
factory MediaSegmentsModel({
|
||||
|
|
@ -27,7 +27,7 @@ class MediaSegmentsModel with _$MediaSegmentsModel {
|
|||
}
|
||||
|
||||
@freezed
|
||||
class MediaSegment with _$MediaSegment {
|
||||
abstract class MediaSegment with _$MediaSegment {
|
||||
const MediaSegment._();
|
||||
|
||||
factory MediaSegment({
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint
|
||||
// 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
|
||||
|
||||
|
|
@ -9,32 +9,187 @@ part of 'media_segments_model.dart';
|
|||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
MediaSegmentsModel _$MediaSegmentsModelFromJson(Map<String, dynamic> json) {
|
||||
return _MediaSegmentsModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$MediaSegmentsModel {
|
||||
List<MediaSegment> get segments => throw _privateConstructorUsedError;
|
||||
List<MediaSegment> get segments;
|
||||
|
||||
/// Serializes this MediaSegmentsModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'MediaSegmentsModel(segments: $segments)';
|
||||
}
|
||||
}
|
||||
|
||||
/// Adds pattern-matching-related methods to [MediaSegmentsModel].
|
||||
extension MediaSegmentsModelPatterns on MediaSegmentsModel {
|
||||
/// 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(_MediaSegmentsModel value)? $default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _MediaSegmentsModel() 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(_MediaSegmentsModel value) $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _MediaSegmentsModel():
|
||||
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(_MediaSegmentsModel value)? $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _MediaSegmentsModel() 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<MediaSegment> segments)? $default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _MediaSegmentsModel() when $default != null:
|
||||
return $default(_that.segments);
|
||||
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<MediaSegment> segments) $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _MediaSegmentsModel():
|
||||
return $default(_that.segments);
|
||||
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<MediaSegment> segments)? $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _MediaSegmentsModel() when $default != null:
|
||||
return $default(_that.segments);
|
||||
case _:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$MediaSegmentsModelImpl extends _MediaSegmentsModel {
|
||||
_$MediaSegmentsModelImpl({final List<MediaSegment> segments = const []})
|
||||
class _MediaSegmentsModel extends MediaSegmentsModel {
|
||||
_MediaSegmentsModel({final List<MediaSegment> segments = const []})
|
||||
: _segments = segments,
|
||||
super._();
|
||||
|
||||
factory _$MediaSegmentsModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$MediaSegmentsModelImplFromJson(json);
|
||||
factory _MediaSegmentsModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$MediaSegmentsModelFromJson(json);
|
||||
|
||||
final List<MediaSegment> _segments;
|
||||
@override
|
||||
|
|
@ -45,54 +200,201 @@ class _$MediaSegmentsModelImpl extends _MediaSegmentsModel {
|
|||
return EqualUnmodifiableListView(_segments);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'MediaSegmentsModel(segments: $segments)';
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$MediaSegmentsModelImplToJson(
|
||||
return _$MediaSegmentsModelToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _MediaSegmentsModel extends MediaSegmentsModel {
|
||||
factory _MediaSegmentsModel({final List<MediaSegment> segments}) =
|
||||
_$MediaSegmentsModelImpl;
|
||||
_MediaSegmentsModel._() : super._();
|
||||
|
||||
factory _MediaSegmentsModel.fromJson(Map<String, dynamic> json) =
|
||||
_$MediaSegmentsModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
List<MediaSegment> get segments;
|
||||
}
|
||||
|
||||
MediaSegment _$MediaSegmentFromJson(Map<String, dynamic> json) {
|
||||
return _MediaSegment.fromJson(json);
|
||||
String toString() {
|
||||
return 'MediaSegmentsModel(segments: $segments)';
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$MediaSegment {
|
||||
MediaSegmentType get type => throw _privateConstructorUsedError;
|
||||
Duration get start => throw _privateConstructorUsedError;
|
||||
Duration get end => throw _privateConstructorUsedError;
|
||||
MediaSegmentType get type;
|
||||
Duration get start;
|
||||
Duration get end;
|
||||
|
||||
/// Serializes this MediaSegment to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'MediaSegment(type: $type, start: $start, end: $end)';
|
||||
}
|
||||
}
|
||||
|
||||
/// Adds pattern-matching-related methods to [MediaSegment].
|
||||
extension MediaSegmentPatterns on MediaSegment {
|
||||
/// 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(_MediaSegment value)? $default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _MediaSegment() 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(_MediaSegment value) $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _MediaSegment():
|
||||
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(_MediaSegment value)? $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _MediaSegment() 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(MediaSegmentType type, Duration start, Duration end)?
|
||||
$default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _MediaSegment() when $default != null:
|
||||
return $default(_that.type, _that.start, _that.end);
|
||||
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(MediaSegmentType type, Duration start, Duration end)
|
||||
$default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _MediaSegment():
|
||||
return $default(_that.type, _that.start, _that.end);
|
||||
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(MediaSegmentType type, Duration start, Duration end)?
|
||||
$default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _MediaSegment() when $default != null:
|
||||
return $default(_that.type, _that.start, _that.end);
|
||||
case _:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$MediaSegmentImpl extends _MediaSegment {
|
||||
_$MediaSegmentImpl(
|
||||
{required this.type, required this.start, required this.end})
|
||||
class _MediaSegment extends MediaSegment {
|
||||
_MediaSegment({required this.type, required this.start, required this.end})
|
||||
: super._();
|
||||
|
||||
factory _$MediaSegmentImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$MediaSegmentImplFromJson(json);
|
||||
factory _MediaSegment.fromJson(Map<String, dynamic> json) =>
|
||||
_$MediaSegmentFromJson(json);
|
||||
|
||||
@override
|
||||
final MediaSegmentType type;
|
||||
|
|
@ -101,33 +403,17 @@ class _$MediaSegmentImpl extends _MediaSegment {
|
|||
@override
|
||||
final Duration end;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'MediaSegment(type: $type, start: $start, end: $end)';
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$MediaSegmentImplToJson(
|
||||
return _$MediaSegmentToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'MediaSegment(type: $type, start: $start, end: $end)';
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _MediaSegment extends MediaSegment {
|
||||
factory _MediaSegment(
|
||||
{required final MediaSegmentType type,
|
||||
required final Duration start,
|
||||
required final Duration end}) = _$MediaSegmentImpl;
|
||||
_MediaSegment._() : super._();
|
||||
|
||||
factory _MediaSegment.fromJson(Map<String, dynamic> json) =
|
||||
_$MediaSegmentImpl.fromJson;
|
||||
|
||||
@override
|
||||
MediaSegmentType get type;
|
||||
@override
|
||||
Duration get start;
|
||||
@override
|
||||
Duration get end;
|
||||
}
|
||||
// dart format on
|
||||
|
|
|
|||
|
|
@ -6,29 +6,27 @@ part of 'media_segments_model.dart';
|
|||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$MediaSegmentsModelImpl _$$MediaSegmentsModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$MediaSegmentsModelImpl(
|
||||
_MediaSegmentsModel _$MediaSegmentsModelFromJson(Map<String, dynamic> json) =>
|
||||
_MediaSegmentsModel(
|
||||
segments: (json['segments'] as List<dynamic>?)
|
||||
?.map((e) => MediaSegment.fromJson(e as Map<String, dynamic>))
|
||||
.toList() ??
|
||||
const [],
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$MediaSegmentsModelImplToJson(
|
||||
_$MediaSegmentsModelImpl instance) =>
|
||||
Map<String, dynamic> _$MediaSegmentsModelToJson(_MediaSegmentsModel instance) =>
|
||||
<String, dynamic>{
|
||||
'segments': instance.segments,
|
||||
};
|
||||
|
||||
_$MediaSegmentImpl _$$MediaSegmentImplFromJson(Map<String, dynamic> json) =>
|
||||
_$MediaSegmentImpl(
|
||||
_MediaSegment _$MediaSegmentFromJson(Map<String, dynamic> json) =>
|
||||
_MediaSegment(
|
||||
type: $enumDecode(_$MediaSegmentTypeEnumMap, json['type']),
|
||||
start: Duration(microseconds: (json['start'] as num).toInt()),
|
||||
end: Duration(microseconds: (json['end'] as num).toInt()),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$MediaSegmentImplToJson(_$MediaSegmentImpl instance) =>
|
||||
Map<String, dynamic> _$MediaSegmentToJson(_MediaSegment instance) =>
|
||||
<String, dynamic>{
|
||||
'type': _$MediaSegmentTypeEnumMap[instance.type]!,
|
||||
'start': instance.start.inMicroseconds,
|
||||
|
|
|
|||
|
|
@ -151,13 +151,14 @@ class MovieModelMapper extends SubClassMapperBase<MovieModel> {
|
|||
|
||||
mixin MovieModelMappable {
|
||||
MovieModelCopyWith<MovieModel, MovieModel, MovieModel> get copyWith =>
|
||||
_MovieModelCopyWithImpl(this as MovieModel, $identity, $identity);
|
||||
_MovieModelCopyWithImpl<MovieModel, MovieModel>(
|
||||
this as MovieModel, $identity, $identity);
|
||||
}
|
||||
|
||||
extension MovieModelValueCopy<$R, $Out>
|
||||
on ObjectCopyWith<$R, MovieModel, $Out> {
|
||||
MovieModelCopyWith<$R, MovieModel, $Out> get $asMovieModel =>
|
||||
$base.as((v, t, t2) => _MovieModelCopyWithImpl(v, t, t2));
|
||||
$base.as((v, t, t2) => _MovieModelCopyWithImpl<$R, $Out>(v, t, t2));
|
||||
}
|
||||
|
||||
abstract class MovieModelCopyWith<$R, $In extends MovieModel, $Out>
|
||||
|
|
@ -291,5 +292,5 @@ class _MovieModelCopyWithImpl<$R, $Out>
|
|||
@override
|
||||
MovieModelCopyWith<$R2, MovieModel, $Out2> $chain<$R2, $Out2>(
|
||||
Then<$Out2, $R2> t) =>
|
||||
_MovieModelCopyWithImpl($value, $cast, t);
|
||||
_MovieModelCopyWithImpl<$R2, $Out2>($value, $cast, t);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,14 +118,14 @@ class OverviewModelMapper extends ClassMapperBase<OverviewModel> {
|
|||
|
||||
mixin OverviewModelMappable {
|
||||
OverviewModelCopyWith<OverviewModel, OverviewModel, OverviewModel>
|
||||
get copyWith => _OverviewModelCopyWithImpl(
|
||||
get copyWith => _OverviewModelCopyWithImpl<OverviewModel, OverviewModel>(
|
||||
this as OverviewModel, $identity, $identity);
|
||||
}
|
||||
|
||||
extension OverviewModelValueCopy<$R, $Out>
|
||||
on ObjectCopyWith<$R, OverviewModel, $Out> {
|
||||
OverviewModelCopyWith<$R, OverviewModel, $Out> get $asOverviewModel =>
|
||||
$base.as((v, t, t2) => _OverviewModelCopyWithImpl(v, t, t2));
|
||||
$base.as((v, t, t2) => _OverviewModelCopyWithImpl<$R, $Out>(v, t, t2));
|
||||
}
|
||||
|
||||
abstract class OverviewModelCopyWith<$R, $In extends OverviewModel, $Out>
|
||||
|
|
@ -275,5 +275,5 @@ class _OverviewModelCopyWithImpl<$R, $Out>
|
|||
@override
|
||||
OverviewModelCopyWith<$R2, OverviewModel, $Out2> $chain<$R2, $Out2>(
|
||||
Then<$Out2, $R2> t) =>
|
||||
_OverviewModelCopyWithImpl($value, $cast, t);
|
||||
_OverviewModelCopyWithImpl<$R2, $Out2>($value, $cast, t);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,13 +128,14 @@ class PersonModelMapper extends SubClassMapperBase<PersonModel> {
|
|||
|
||||
mixin PersonModelMappable {
|
||||
PersonModelCopyWith<PersonModel, PersonModel, PersonModel> get copyWith =>
|
||||
_PersonModelCopyWithImpl(this as PersonModel, $identity, $identity);
|
||||
_PersonModelCopyWithImpl<PersonModel, PersonModel>(
|
||||
this as PersonModel, $identity, $identity);
|
||||
}
|
||||
|
||||
extension PersonModelValueCopy<$R, $Out>
|
||||
on ObjectCopyWith<$R, PersonModel, $Out> {
|
||||
PersonModelCopyWith<$R, PersonModel, $Out> get $asPersonModel =>
|
||||
$base.as((v, t, t2) => _PersonModelCopyWithImpl(v, t, t2));
|
||||
$base.as((v, t, t2) => _PersonModelCopyWithImpl<$R, $Out>(v, t, t2));
|
||||
}
|
||||
|
||||
abstract class PersonModelCopyWith<$R, $In extends PersonModel, $Out>
|
||||
|
|
@ -254,5 +255,5 @@ class _PersonModelCopyWithImpl<$R, $Out>
|
|||
@override
|
||||
PersonModelCopyWith<$R2, PersonModel, $Out2> $chain<$R2, $Out2>(
|
||||
Then<$Out2, $R2> t) =>
|
||||
_PersonModelCopyWithImpl($value, $cast, t);
|
||||
_PersonModelCopyWithImpl<$R2, $Out2>($value, $cast, t);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,14 +112,15 @@ class PhotoAlbumModelMapper extends SubClassMapperBase<PhotoAlbumModel> {
|
|||
|
||||
mixin PhotoAlbumModelMappable {
|
||||
PhotoAlbumModelCopyWith<PhotoAlbumModel, PhotoAlbumModel, PhotoAlbumModel>
|
||||
get copyWith => _PhotoAlbumModelCopyWithImpl(
|
||||
this as PhotoAlbumModel, $identity, $identity);
|
||||
get copyWith =>
|
||||
_PhotoAlbumModelCopyWithImpl<PhotoAlbumModel, PhotoAlbumModel>(
|
||||
this as PhotoAlbumModel, $identity, $identity);
|
||||
}
|
||||
|
||||
extension PhotoAlbumModelValueCopy<$R, $Out>
|
||||
on ObjectCopyWith<$R, PhotoAlbumModel, $Out> {
|
||||
PhotoAlbumModelCopyWith<$R, PhotoAlbumModel, $Out> get $asPhotoAlbumModel =>
|
||||
$base.as((v, t, t2) => _PhotoAlbumModelCopyWithImpl(v, t, t2));
|
||||
$base.as((v, t, t2) => _PhotoAlbumModelCopyWithImpl<$R, $Out>(v, t, t2));
|
||||
}
|
||||
|
||||
abstract class PhotoAlbumModelCopyWith<$R, $In extends PhotoAlbumModel, $Out>
|
||||
|
|
@ -217,7 +218,7 @@ class _PhotoAlbumModelCopyWithImpl<$R, $Out>
|
|||
@override
|
||||
PhotoAlbumModelCopyWith<$R2, PhotoAlbumModel, $Out2> $chain<$R2, $Out2>(
|
||||
Then<$Out2, $R2> t) =>
|
||||
_PhotoAlbumModelCopyWithImpl($value, $cast, t);
|
||||
_PhotoAlbumModelCopyWithImpl<$R2, $Out2>($value, $cast, t);
|
||||
}
|
||||
|
||||
class PhotoModelMapper extends SubClassMapperBase<PhotoModel> {
|
||||
|
|
@ -340,13 +341,14 @@ class PhotoModelMapper extends SubClassMapperBase<PhotoModel> {
|
|||
|
||||
mixin PhotoModelMappable {
|
||||
PhotoModelCopyWith<PhotoModel, PhotoModel, PhotoModel> get copyWith =>
|
||||
_PhotoModelCopyWithImpl(this as PhotoModel, $identity, $identity);
|
||||
_PhotoModelCopyWithImpl<PhotoModel, PhotoModel>(
|
||||
this as PhotoModel, $identity, $identity);
|
||||
}
|
||||
|
||||
extension PhotoModelValueCopy<$R, $Out>
|
||||
on ObjectCopyWith<$R, PhotoModel, $Out> {
|
||||
PhotoModelCopyWith<$R, PhotoModel, $Out> get $asPhotoModel =>
|
||||
$base.as((v, t, t2) => _PhotoModelCopyWithImpl(v, t, t2));
|
||||
$base.as((v, t, t2) => _PhotoModelCopyWithImpl<$R, $Out>(v, t, t2));
|
||||
}
|
||||
|
||||
abstract class PhotoModelCopyWith<$R, $In extends PhotoModel, $Out>
|
||||
|
|
@ -448,5 +450,5 @@ class _PhotoModelCopyWithImpl<$R, $Out>
|
|||
@override
|
||||
PhotoModelCopyWith<$R2, PhotoModel, $Out2> $chain<$R2, $Out2>(
|
||||
Then<$Out2, $R2> t) =>
|
||||
_PhotoModelCopyWithImpl($value, $cast, t);
|
||||
_PhotoModelCopyWithImpl<$R2, $Out2>($value, $cast, t);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,13 +141,14 @@ class SeasonModelMapper extends SubClassMapperBase<SeasonModel> {
|
|||
|
||||
mixin SeasonModelMappable {
|
||||
SeasonModelCopyWith<SeasonModel, SeasonModel, SeasonModel> get copyWith =>
|
||||
_SeasonModelCopyWithImpl(this as SeasonModel, $identity, $identity);
|
||||
_SeasonModelCopyWithImpl<SeasonModel, SeasonModel>(
|
||||
this as SeasonModel, $identity, $identity);
|
||||
}
|
||||
|
||||
extension SeasonModelValueCopy<$R, $Out>
|
||||
on ObjectCopyWith<$R, SeasonModel, $Out> {
|
||||
SeasonModelCopyWith<$R, SeasonModel, $Out> get $asSeasonModel =>
|
||||
$base.as((v, t, t2) => _SeasonModelCopyWithImpl(v, t, t2));
|
||||
$base.as((v, t, t2) => _SeasonModelCopyWithImpl<$R, $Out>(v, t, t2));
|
||||
}
|
||||
|
||||
abstract class SeasonModelCopyWith<$R, $In extends SeasonModel, $Out>
|
||||
|
|
@ -268,5 +269,5 @@ class _SeasonModelCopyWithImpl<$R, $Out>
|
|||
@override
|
||||
SeasonModelCopyWith<$R2, SeasonModel, $Out2> $chain<$R2, $Out2>(
|
||||
Then<$Out2, $R2> t) =>
|
||||
_SeasonModelCopyWithImpl($value, $cast, t);
|
||||
_SeasonModelCopyWithImpl<$R2, $Out2>($value, $cast, t);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,13 +139,14 @@ class SeriesModelMapper extends SubClassMapperBase<SeriesModel> {
|
|||
|
||||
mixin SeriesModelMappable {
|
||||
SeriesModelCopyWith<SeriesModel, SeriesModel, SeriesModel> get copyWith =>
|
||||
_SeriesModelCopyWithImpl(this as SeriesModel, $identity, $identity);
|
||||
_SeriesModelCopyWithImpl<SeriesModel, SeriesModel>(
|
||||
this as SeriesModel, $identity, $identity);
|
||||
}
|
||||
|
||||
extension SeriesModelValueCopy<$R, $Out>
|
||||
on ObjectCopyWith<$R, SeriesModel, $Out> {
|
||||
SeriesModelCopyWith<$R, SeriesModel, $Out> get $asSeriesModel =>
|
||||
$base.as((v, t, t2) => _SeriesModelCopyWithImpl(v, t, t2));
|
||||
$base.as((v, t, t2) => _SeriesModelCopyWithImpl<$R, $Out>(v, t, t2));
|
||||
}
|
||||
|
||||
abstract class SeriesModelCopyWith<$R, $In extends SeriesModel, $Out>
|
||||
|
|
@ -282,5 +283,5 @@ class _SeriesModelCopyWithImpl<$R, $Out>
|
|||
@override
|
||||
SeriesModelCopyWith<$R2, SeriesModel, $Out2> $chain<$R2, $Out2>(
|
||||
Then<$Out2, $R2> t) =>
|
||||
_SeriesModelCopyWithImpl($value, $cast, t);
|
||||
_SeriesModelCopyWithImpl<$R2, $Out2>($value, $cast, t);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ part 'trick_play_model.freezed.dart';
|
|||
part 'trick_play_model.g.dart';
|
||||
|
||||
@Freezed(copyWith: true)
|
||||
class TrickPlayModel with _$TrickPlayModel {
|
||||
abstract class TrickPlayModel with _$TrickPlayModel {
|
||||
factory TrickPlayModel({
|
||||
required int width,
|
||||
required int height,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint
|
||||
// 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
|
||||
|
||||
|
|
@ -9,114 +9,41 @@ part of 'trick_play_model.dart';
|
|||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
TrickPlayModel _$TrickPlayModelFromJson(Map<String, dynamic> json) {
|
||||
return _TrickPlayModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$TrickPlayModel {
|
||||
int get width => throw _privateConstructorUsedError;
|
||||
int get height => throw _privateConstructorUsedError;
|
||||
int get tileWidth => throw _privateConstructorUsedError;
|
||||
int get tileHeight => throw _privateConstructorUsedError;
|
||||
int get thumbnailCount => throw _privateConstructorUsedError;
|
||||
Duration get interval => throw _privateConstructorUsedError;
|
||||
List<String> get images => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this TrickPlayModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
int get width;
|
||||
int get height;
|
||||
int get tileWidth;
|
||||
int get tileHeight;
|
||||
int get thumbnailCount;
|
||||
Duration get interval;
|
||||
List<String> get images;
|
||||
|
||||
/// Create a copy of TrickPlayModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$TrickPlayModelCopyWith<TrickPlayModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $TrickPlayModelCopyWith<$Res> {
|
||||
factory $TrickPlayModelCopyWith(
|
||||
TrickPlayModel value, $Res Function(TrickPlayModel) then) =
|
||||
_$TrickPlayModelCopyWithImpl<$Res, TrickPlayModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{int width,
|
||||
int height,
|
||||
int tileWidth,
|
||||
int tileHeight,
|
||||
int thumbnailCount,
|
||||
Duration interval,
|
||||
List<String> images});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$TrickPlayModelCopyWithImpl<$Res, $Val extends TrickPlayModel>
|
||||
implements $TrickPlayModelCopyWith<$Res> {
|
||||
_$TrickPlayModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of TrickPlayModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
$TrickPlayModelCopyWith<TrickPlayModel> get copyWith =>
|
||||
_$TrickPlayModelCopyWithImpl<TrickPlayModel>(
|
||||
this as TrickPlayModel, _$identity);
|
||||
|
||||
/// Serializes this TrickPlayModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
@override
|
||||
$Res call({
|
||||
Object? width = null,
|
||||
Object? height = null,
|
||||
Object? tileWidth = null,
|
||||
Object? tileHeight = null,
|
||||
Object? thumbnailCount = null,
|
||||
Object? interval = null,
|
||||
Object? images = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
width: null == width
|
||||
? _value.width
|
||||
: width // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
height: null == height
|
||||
? _value.height
|
||||
: height // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
tileWidth: null == tileWidth
|
||||
? _value.tileWidth
|
||||
: tileWidth // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
tileHeight: null == tileHeight
|
||||
? _value.tileHeight
|
||||
: tileHeight // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
thumbnailCount: null == thumbnailCount
|
||||
? _value.thumbnailCount
|
||||
: thumbnailCount // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
interval: null == interval
|
||||
? _value.interval
|
||||
: interval // ignore: cast_nullable_to_non_nullable
|
||||
as Duration,
|
||||
images: null == images
|
||||
? _value.images
|
||||
: images // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>,
|
||||
) as $Val);
|
||||
String toString() {
|
||||
return 'TrickPlayModel(width: $width, height: $height, tileWidth: $tileWidth, tileHeight: $tileHeight, thumbnailCount: $thumbnailCount, interval: $interval, images: $images)';
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$TrickPlayModelImplCopyWith<$Res>
|
||||
implements $TrickPlayModelCopyWith<$Res> {
|
||||
factory _$$TrickPlayModelImplCopyWith(_$TrickPlayModelImpl value,
|
||||
$Res Function(_$TrickPlayModelImpl) then) =
|
||||
__$$TrickPlayModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
abstract mixin class $TrickPlayModelCopyWith<$Res> {
|
||||
factory $TrickPlayModelCopyWith(
|
||||
TrickPlayModel value, $Res Function(TrickPlayModel) _then) =
|
||||
_$TrickPlayModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call(
|
||||
{int width,
|
||||
|
|
@ -129,12 +56,12 @@ abstract class _$$TrickPlayModelImplCopyWith<$Res>
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$TrickPlayModelImplCopyWithImpl<$Res>
|
||||
extends _$TrickPlayModelCopyWithImpl<$Res, _$TrickPlayModelImpl>
|
||||
implements _$$TrickPlayModelImplCopyWith<$Res> {
|
||||
__$$TrickPlayModelImplCopyWithImpl(
|
||||
_$TrickPlayModelImpl _value, $Res Function(_$TrickPlayModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
class _$TrickPlayModelCopyWithImpl<$Res>
|
||||
implements $TrickPlayModelCopyWith<$Res> {
|
||||
_$TrickPlayModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final TrickPlayModel _self;
|
||||
final $Res Function(TrickPlayModel) _then;
|
||||
|
||||
/// Create a copy of TrickPlayModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
|
|
@ -149,43 +76,227 @@ class __$$TrickPlayModelImplCopyWithImpl<$Res>
|
|||
Object? interval = null,
|
||||
Object? images = null,
|
||||
}) {
|
||||
return _then(_$TrickPlayModelImpl(
|
||||
return _then(_self.copyWith(
|
||||
width: null == width
|
||||
? _value.width
|
||||
? _self.width
|
||||
: width // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
height: null == height
|
||||
? _value.height
|
||||
? _self.height
|
||||
: height // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
tileWidth: null == tileWidth
|
||||
? _value.tileWidth
|
||||
? _self.tileWidth
|
||||
: tileWidth // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
tileHeight: null == tileHeight
|
||||
? _value.tileHeight
|
||||
? _self.tileHeight
|
||||
: tileHeight // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
thumbnailCount: null == thumbnailCount
|
||||
? _value.thumbnailCount
|
||||
? _self.thumbnailCount
|
||||
: thumbnailCount // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
interval: null == interval
|
||||
? _value.interval
|
||||
? _self.interval
|
||||
: interval // ignore: cast_nullable_to_non_nullable
|
||||
as Duration,
|
||||
images: null == images
|
||||
? _value._images
|
||||
? _self.images
|
||||
: images // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// Adds pattern-matching-related methods to [TrickPlayModel].
|
||||
extension TrickPlayModelPatterns on TrickPlayModel {
|
||||
/// 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(_TrickPlayModel value)? $default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _TrickPlayModel() 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(_TrickPlayModel value) $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _TrickPlayModel():
|
||||
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(_TrickPlayModel value)? $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _TrickPlayModel() 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 width, int height, int tileWidth, int tileHeight,
|
||||
int thumbnailCount, Duration interval, List<String> images)?
|
||||
$default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _TrickPlayModel() when $default != null:
|
||||
return $default(
|
||||
_that.width,
|
||||
_that.height,
|
||||
_that.tileWidth,
|
||||
_that.tileHeight,
|
||||
_that.thumbnailCount,
|
||||
_that.interval,
|
||||
_that.images);
|
||||
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 width, int height, int tileWidth, int tileHeight,
|
||||
int thumbnailCount, Duration interval, List<String> images)
|
||||
$default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _TrickPlayModel():
|
||||
return $default(
|
||||
_that.width,
|
||||
_that.height,
|
||||
_that.tileWidth,
|
||||
_that.tileHeight,
|
||||
_that.thumbnailCount,
|
||||
_that.interval,
|
||||
_that.images);
|
||||
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 width, int height, int tileWidth, int tileHeight,
|
||||
int thumbnailCount, Duration interval, List<String> images)?
|
||||
$default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _TrickPlayModel() when $default != null:
|
||||
return $default(
|
||||
_that.width,
|
||||
_that.height,
|
||||
_that.tileWidth,
|
||||
_that.tileHeight,
|
||||
_that.thumbnailCount,
|
||||
_that.interval,
|
||||
_that.images);
|
||||
case _:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$TrickPlayModelImpl extends _TrickPlayModel {
|
||||
_$TrickPlayModelImpl(
|
||||
class _TrickPlayModel extends TrickPlayModel {
|
||||
_TrickPlayModel(
|
||||
{required this.width,
|
||||
required this.height,
|
||||
required this.tileWidth,
|
||||
|
|
@ -195,9 +306,8 @@ class _$TrickPlayModelImpl extends _TrickPlayModel {
|
|||
final List<String> images = const []})
|
||||
: _images = images,
|
||||
super._();
|
||||
|
||||
factory _$TrickPlayModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$TrickPlayModelImplFromJson(json);
|
||||
factory _TrickPlayModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$TrickPlayModelFromJson(json);
|
||||
|
||||
@override
|
||||
final int width;
|
||||
|
|
@ -220,61 +330,97 @@ class _$TrickPlayModelImpl extends _TrickPlayModel {
|
|||
return EqualUnmodifiableListView(_images);
|
||||
}
|
||||
|
||||
/// Create a copy of TrickPlayModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$TrickPlayModelCopyWith<_TrickPlayModel> get copyWith =>
|
||||
__$TrickPlayModelCopyWithImpl<_TrickPlayModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$TrickPlayModelToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'TrickPlayModel(width: $width, height: $height, tileWidth: $tileWidth, tileHeight: $tileHeight, thumbnailCount: $thumbnailCount, interval: $interval, images: $images)';
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$TrickPlayModelCopyWith<$Res>
|
||||
implements $TrickPlayModelCopyWith<$Res> {
|
||||
factory _$TrickPlayModelCopyWith(
|
||||
_TrickPlayModel value, $Res Function(_TrickPlayModel) _then) =
|
||||
__$TrickPlayModelCopyWithImpl;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{int width,
|
||||
int height,
|
||||
int tileWidth,
|
||||
int tileHeight,
|
||||
int thumbnailCount,
|
||||
Duration interval,
|
||||
List<String> images});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$TrickPlayModelCopyWithImpl<$Res>
|
||||
implements _$TrickPlayModelCopyWith<$Res> {
|
||||
__$TrickPlayModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _TrickPlayModel _self;
|
||||
final $Res Function(_TrickPlayModel) _then;
|
||||
|
||||
/// Create a copy of TrickPlayModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$TrickPlayModelImplCopyWith<_$TrickPlayModelImpl> get copyWith =>
|
||||
__$$TrickPlayModelImplCopyWithImpl<_$TrickPlayModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$TrickPlayModelImplToJson(
|
||||
this,
|
||||
);
|
||||
$Res call({
|
||||
Object? width = null,
|
||||
Object? height = null,
|
||||
Object? tileWidth = null,
|
||||
Object? tileHeight = null,
|
||||
Object? thumbnailCount = null,
|
||||
Object? interval = null,
|
||||
Object? images = null,
|
||||
}) {
|
||||
return _then(_TrickPlayModel(
|
||||
width: null == width
|
||||
? _self.width
|
||||
: width // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
height: null == height
|
||||
? _self.height
|
||||
: height // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
tileWidth: null == tileWidth
|
||||
? _self.tileWidth
|
||||
: tileWidth // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
tileHeight: null == tileHeight
|
||||
? _self.tileHeight
|
||||
: tileHeight // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
thumbnailCount: null == thumbnailCount
|
||||
? _self.thumbnailCount
|
||||
: thumbnailCount // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
interval: null == interval
|
||||
? _self.interval
|
||||
: interval // ignore: cast_nullable_to_non_nullable
|
||||
as Duration,
|
||||
images: null == images
|
||||
? _self._images
|
||||
: images // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _TrickPlayModel extends TrickPlayModel {
|
||||
factory _TrickPlayModel(
|
||||
{required final int width,
|
||||
required final int height,
|
||||
required final int tileWidth,
|
||||
required final int tileHeight,
|
||||
required final int thumbnailCount,
|
||||
required final Duration interval,
|
||||
final List<String> images}) = _$TrickPlayModelImpl;
|
||||
_TrickPlayModel._() : super._();
|
||||
|
||||
factory _TrickPlayModel.fromJson(Map<String, dynamic> json) =
|
||||
_$TrickPlayModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get width;
|
||||
@override
|
||||
int get height;
|
||||
@override
|
||||
int get tileWidth;
|
||||
@override
|
||||
int get tileHeight;
|
||||
@override
|
||||
int get thumbnailCount;
|
||||
@override
|
||||
Duration get interval;
|
||||
@override
|
||||
List<String> get images;
|
||||
|
||||
/// Create a copy of TrickPlayModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$TrickPlayModelImplCopyWith<_$TrickPlayModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
// dart format on
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ part of 'trick_play_model.dart';
|
|||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$TrickPlayModelImpl _$$TrickPlayModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$TrickPlayModelImpl(
|
||||
_TrickPlayModel _$TrickPlayModelFromJson(Map<String, dynamic> json) =>
|
||||
_TrickPlayModel(
|
||||
width: (json['width'] as num).toInt(),
|
||||
height: (json['height'] as num).toInt(),
|
||||
tileWidth: (json['tileWidth'] as num).toInt(),
|
||||
|
|
@ -20,8 +20,7 @@ _$TrickPlayModelImpl _$$TrickPlayModelImplFromJson(Map<String, dynamic> json) =>
|
|||
const [],
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$TrickPlayModelImplToJson(
|
||||
_$TrickPlayModelImpl instance) =>
|
||||
Map<String, dynamic> _$TrickPlayModelToJson(_TrickPlayModel instance) =>
|
||||
<String, dynamic>{
|
||||
'width': instance.width,
|
||||
'height': instance.height,
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@ part 'library_filters_model.freezed.dart';
|
|||
part 'library_filters_model.g.dart';
|
||||
|
||||
@Freezed(copyWith: true)
|
||||
class LibraryFiltersModel with _$LibraryFiltersModel {
|
||||
abstract class LibraryFiltersModel with _$LibraryFiltersModel {
|
||||
const LibraryFiltersModel._();
|
||||
|
||||
factory LibraryFiltersModel._internal({
|
||||
factory LibraryFiltersModel({
|
||||
required String id,
|
||||
required String name,
|
||||
required bool isFavourite,
|
||||
|
|
@ -46,7 +46,7 @@ class LibraryFiltersModel with _$LibraryFiltersModel {
|
|||
bool? isFavourite,
|
||||
String? id,
|
||||
}) {
|
||||
return LibraryFiltersModel._internal(
|
||||
return LibraryFiltersModel(
|
||||
id: id ?? Xid().toString(),
|
||||
name: name,
|
||||
isFavourite: isFavourite ?? false,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint
|
||||
// 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
|
||||
|
||||
|
|
@ -9,185 +9,52 @@ part of 'library_filters_model.dart';
|
|||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
LibraryFiltersModel _$LibraryFiltersModelFromJson(Map<String, dynamic> json) {
|
||||
return _LibraryFiltersModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$LibraryFiltersModel {
|
||||
String get id => throw _privateConstructorUsedError;
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
bool get isFavourite => throw _privateConstructorUsedError;
|
||||
List<String> get ids => throw _privateConstructorUsedError;
|
||||
Map<String, bool> get genres => throw _privateConstructorUsedError;
|
||||
Map<ItemFilter, bool> get filters => throw _privateConstructorUsedError;
|
||||
String get id;
|
||||
String get name;
|
||||
bool get isFavourite;
|
||||
List<String> get ids;
|
||||
Map<String, bool> get genres;
|
||||
Map<ItemFilter, bool> get filters;
|
||||
@StudioEncoder()
|
||||
Map<Studio, bool> get studios => throw _privateConstructorUsedError;
|
||||
Map<String, bool> get tags => throw _privateConstructorUsedError;
|
||||
Map<int, bool> get years => throw _privateConstructorUsedError;
|
||||
Map<String, bool> get officialRatings => throw _privateConstructorUsedError;
|
||||
Map<FladderItemType, bool> get types => throw _privateConstructorUsedError;
|
||||
SortingOptions get sortingOption => throw _privateConstructorUsedError;
|
||||
SortingOrder get sortOrder => throw _privateConstructorUsedError;
|
||||
bool get favourites => throw _privateConstructorUsedError;
|
||||
bool get hideEmptyShows => throw _privateConstructorUsedError;
|
||||
bool get recursive => throw _privateConstructorUsedError;
|
||||
GroupBy get groupBy => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this LibraryFiltersModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
Map<Studio, bool> get studios;
|
||||
Map<String, bool> get tags;
|
||||
Map<int, bool> get years;
|
||||
Map<String, bool> get officialRatings;
|
||||
Map<FladderItemType, bool> get types;
|
||||
SortingOptions get sortingOption;
|
||||
SortingOrder get sortOrder;
|
||||
bool get favourites;
|
||||
bool get hideEmptyShows;
|
||||
bool get recursive;
|
||||
GroupBy get groupBy;
|
||||
|
||||
/// Create a copy of LibraryFiltersModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$LibraryFiltersModelCopyWith<LibraryFiltersModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $LibraryFiltersModelCopyWith<$Res> {
|
||||
factory $LibraryFiltersModelCopyWith(
|
||||
LibraryFiltersModel value, $Res Function(LibraryFiltersModel) then) =
|
||||
_$LibraryFiltersModelCopyWithImpl<$Res, LibraryFiltersModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{String id,
|
||||
String name,
|
||||
bool isFavourite,
|
||||
List<String> ids,
|
||||
Map<String, bool> genres,
|
||||
Map<ItemFilter, bool> filters,
|
||||
@StudioEncoder() Map<Studio, bool> studios,
|
||||
Map<String, bool> tags,
|
||||
Map<int, bool> years,
|
||||
Map<String, bool> officialRatings,
|
||||
Map<FladderItemType, bool> types,
|
||||
SortingOptions sortingOption,
|
||||
SortingOrder sortOrder,
|
||||
bool favourites,
|
||||
bool hideEmptyShows,
|
||||
bool recursive,
|
||||
GroupBy groupBy});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$LibraryFiltersModelCopyWithImpl<$Res, $Val extends LibraryFiltersModel>
|
||||
implements $LibraryFiltersModelCopyWith<$Res> {
|
||||
_$LibraryFiltersModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of LibraryFiltersModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
$LibraryFiltersModelCopyWith<LibraryFiltersModel> get copyWith =>
|
||||
_$LibraryFiltersModelCopyWithImpl<LibraryFiltersModel>(
|
||||
this as LibraryFiltersModel, _$identity);
|
||||
|
||||
/// Serializes this LibraryFiltersModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? name = null,
|
||||
Object? isFavourite = null,
|
||||
Object? ids = null,
|
||||
Object? genres = null,
|
||||
Object? filters = null,
|
||||
Object? studios = null,
|
||||
Object? tags = null,
|
||||
Object? years = null,
|
||||
Object? officialRatings = null,
|
||||
Object? types = null,
|
||||
Object? sortingOption = null,
|
||||
Object? sortOrder = null,
|
||||
Object? favourites = null,
|
||||
Object? hideEmptyShows = null,
|
||||
Object? recursive = null,
|
||||
Object? groupBy = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
name: null == name
|
||||
? _value.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
isFavourite: null == isFavourite
|
||||
? _value.isFavourite
|
||||
: isFavourite // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
ids: null == ids
|
||||
? _value.ids
|
||||
: ids // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>,
|
||||
genres: null == genres
|
||||
? _value.genres
|
||||
: genres // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, bool>,
|
||||
filters: null == filters
|
||||
? _value.filters
|
||||
: filters // ignore: cast_nullable_to_non_nullable
|
||||
as Map<ItemFilter, bool>,
|
||||
studios: null == studios
|
||||
? _value.studios
|
||||
: studios // ignore: cast_nullable_to_non_nullable
|
||||
as Map<Studio, bool>,
|
||||
tags: null == tags
|
||||
? _value.tags
|
||||
: tags // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, bool>,
|
||||
years: null == years
|
||||
? _value.years
|
||||
: years // ignore: cast_nullable_to_non_nullable
|
||||
as Map<int, bool>,
|
||||
officialRatings: null == officialRatings
|
||||
? _value.officialRatings
|
||||
: officialRatings // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, bool>,
|
||||
types: null == types
|
||||
? _value.types
|
||||
: types // ignore: cast_nullable_to_non_nullable
|
||||
as Map<FladderItemType, bool>,
|
||||
sortingOption: null == sortingOption
|
||||
? _value.sortingOption
|
||||
: sortingOption // ignore: cast_nullable_to_non_nullable
|
||||
as SortingOptions,
|
||||
sortOrder: null == sortOrder
|
||||
? _value.sortOrder
|
||||
: sortOrder // ignore: cast_nullable_to_non_nullable
|
||||
as SortingOrder,
|
||||
favourites: null == favourites
|
||||
? _value.favourites
|
||||
: favourites // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
hideEmptyShows: null == hideEmptyShows
|
||||
? _value.hideEmptyShows
|
||||
: hideEmptyShows // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
recursive: null == recursive
|
||||
? _value.recursive
|
||||
: recursive // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
groupBy: null == groupBy
|
||||
? _value.groupBy
|
||||
: groupBy // ignore: cast_nullable_to_non_nullable
|
||||
as GroupBy,
|
||||
) as $Val);
|
||||
String toString() {
|
||||
return 'LibraryFiltersModel(id: $id, name: $name, isFavourite: $isFavourite, ids: $ids, genres: $genres, filters: $filters, studios: $studios, tags: $tags, years: $years, officialRatings: $officialRatings, types: $types, sortingOption: $sortingOption, sortOrder: $sortOrder, favourites: $favourites, hideEmptyShows: $hideEmptyShows, recursive: $recursive, groupBy: $groupBy)';
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$LibraryFiltersModelImplCopyWith<$Res>
|
||||
implements $LibraryFiltersModelCopyWith<$Res> {
|
||||
factory _$$LibraryFiltersModelImplCopyWith(_$LibraryFiltersModelImpl value,
|
||||
$Res Function(_$LibraryFiltersModelImpl) then) =
|
||||
__$$LibraryFiltersModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
abstract mixin class $LibraryFiltersModelCopyWith<$Res> {
|
||||
factory $LibraryFiltersModelCopyWith(
|
||||
LibraryFiltersModel value, $Res Function(LibraryFiltersModel) _then) =
|
||||
_$LibraryFiltersModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call(
|
||||
{String id,
|
||||
|
|
@ -210,12 +77,12 @@ abstract class _$$LibraryFiltersModelImplCopyWith<$Res>
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$LibraryFiltersModelImplCopyWithImpl<$Res>
|
||||
extends _$LibraryFiltersModelCopyWithImpl<$Res, _$LibraryFiltersModelImpl>
|
||||
implements _$$LibraryFiltersModelImplCopyWith<$Res> {
|
||||
__$$LibraryFiltersModelImplCopyWithImpl(_$LibraryFiltersModelImpl _value,
|
||||
$Res Function(_$LibraryFiltersModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
class _$LibraryFiltersModelCopyWithImpl<$Res>
|
||||
implements $LibraryFiltersModelCopyWith<$Res> {
|
||||
_$LibraryFiltersModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final LibraryFiltersModel _self;
|
||||
final $Res Function(LibraryFiltersModel) _then;
|
||||
|
||||
/// Create a copy of LibraryFiltersModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
|
|
@ -240,83 +107,345 @@ class __$$LibraryFiltersModelImplCopyWithImpl<$Res>
|
|||
Object? recursive = null,
|
||||
Object? groupBy = null,
|
||||
}) {
|
||||
return _then(_$LibraryFiltersModelImpl(
|
||||
return _then(_self.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
? _self.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
name: null == name
|
||||
? _value.name
|
||||
? _self.name
|
||||
: name // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
isFavourite: null == isFavourite
|
||||
? _value.isFavourite
|
||||
? _self.isFavourite
|
||||
: isFavourite // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
ids: null == ids
|
||||
? _value._ids
|
||||
? _self.ids
|
||||
: ids // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>,
|
||||
genres: null == genres
|
||||
? _value._genres
|
||||
? _self.genres
|
||||
: genres // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, bool>,
|
||||
filters: null == filters
|
||||
? _value._filters
|
||||
? _self.filters
|
||||
: filters // ignore: cast_nullable_to_non_nullable
|
||||
as Map<ItemFilter, bool>,
|
||||
studios: null == studios
|
||||
? _value._studios
|
||||
? _self.studios
|
||||
: studios // ignore: cast_nullable_to_non_nullable
|
||||
as Map<Studio, bool>,
|
||||
tags: null == tags
|
||||
? _value._tags
|
||||
? _self.tags
|
||||
: tags // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, bool>,
|
||||
years: null == years
|
||||
? _value._years
|
||||
? _self.years
|
||||
: years // ignore: cast_nullable_to_non_nullable
|
||||
as Map<int, bool>,
|
||||
officialRatings: null == officialRatings
|
||||
? _value._officialRatings
|
||||
? _self.officialRatings
|
||||
: officialRatings // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, bool>,
|
||||
types: null == types
|
||||
? _value._types
|
||||
? _self.types
|
||||
: types // ignore: cast_nullable_to_non_nullable
|
||||
as Map<FladderItemType, bool>,
|
||||
sortingOption: null == sortingOption
|
||||
? _value.sortingOption
|
||||
? _self.sortingOption
|
||||
: sortingOption // ignore: cast_nullable_to_non_nullable
|
||||
as SortingOptions,
|
||||
sortOrder: null == sortOrder
|
||||
? _value.sortOrder
|
||||
? _self.sortOrder
|
||||
: sortOrder // ignore: cast_nullable_to_non_nullable
|
||||
as SortingOrder,
|
||||
favourites: null == favourites
|
||||
? _value.favourites
|
||||
? _self.favourites
|
||||
: favourites // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
hideEmptyShows: null == hideEmptyShows
|
||||
? _value.hideEmptyShows
|
||||
? _self.hideEmptyShows
|
||||
: hideEmptyShows // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
recursive: null == recursive
|
||||
? _value.recursive
|
||||
? _self.recursive
|
||||
: recursive // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
groupBy: null == groupBy
|
||||
? _value.groupBy
|
||||
? _self.groupBy
|
||||
: groupBy // ignore: cast_nullable_to_non_nullable
|
||||
as GroupBy,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// Adds pattern-matching-related methods to [LibraryFiltersModel].
|
||||
extension LibraryFiltersModelPatterns on LibraryFiltersModel {
|
||||
/// 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(_LibraryFiltersModel value)? $default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LibraryFiltersModel() 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(_LibraryFiltersModel value) $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LibraryFiltersModel():
|
||||
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(_LibraryFiltersModel value)? $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LibraryFiltersModel() 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,
|
||||
bool isFavourite,
|
||||
List<String> ids,
|
||||
Map<String, bool> genres,
|
||||
Map<ItemFilter, bool> filters,
|
||||
@StudioEncoder() Map<Studio, bool> studios,
|
||||
Map<String, bool> tags,
|
||||
Map<int, bool> years,
|
||||
Map<String, bool> officialRatings,
|
||||
Map<FladderItemType, bool> types,
|
||||
SortingOptions sortingOption,
|
||||
SortingOrder sortOrder,
|
||||
bool favourites,
|
||||
bool hideEmptyShows,
|
||||
bool recursive,
|
||||
GroupBy groupBy)?
|
||||
$default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LibraryFiltersModel() when $default != null:
|
||||
return $default(
|
||||
_that.id,
|
||||
_that.name,
|
||||
_that.isFavourite,
|
||||
_that.ids,
|
||||
_that.genres,
|
||||
_that.filters,
|
||||
_that.studios,
|
||||
_that.tags,
|
||||
_that.years,
|
||||
_that.officialRatings,
|
||||
_that.types,
|
||||
_that.sortingOption,
|
||||
_that.sortOrder,
|
||||
_that.favourites,
|
||||
_that.hideEmptyShows,
|
||||
_that.recursive,
|
||||
_that.groupBy);
|
||||
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,
|
||||
bool isFavourite,
|
||||
List<String> ids,
|
||||
Map<String, bool> genres,
|
||||
Map<ItemFilter, bool> filters,
|
||||
@StudioEncoder() Map<Studio, bool> studios,
|
||||
Map<String, bool> tags,
|
||||
Map<int, bool> years,
|
||||
Map<String, bool> officialRatings,
|
||||
Map<FladderItemType, bool> types,
|
||||
SortingOptions sortingOption,
|
||||
SortingOrder sortOrder,
|
||||
bool favourites,
|
||||
bool hideEmptyShows,
|
||||
bool recursive,
|
||||
GroupBy groupBy)
|
||||
$default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LibraryFiltersModel():
|
||||
return $default(
|
||||
_that.id,
|
||||
_that.name,
|
||||
_that.isFavourite,
|
||||
_that.ids,
|
||||
_that.genres,
|
||||
_that.filters,
|
||||
_that.studios,
|
||||
_that.tags,
|
||||
_that.years,
|
||||
_that.officialRatings,
|
||||
_that.types,
|
||||
_that.sortingOption,
|
||||
_that.sortOrder,
|
||||
_that.favourites,
|
||||
_that.hideEmptyShows,
|
||||
_that.recursive,
|
||||
_that.groupBy);
|
||||
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,
|
||||
bool isFavourite,
|
||||
List<String> ids,
|
||||
Map<String, bool> genres,
|
||||
Map<ItemFilter, bool> filters,
|
||||
@StudioEncoder() Map<Studio, bool> studios,
|
||||
Map<String, bool> tags,
|
||||
Map<int, bool> years,
|
||||
Map<String, bool> officialRatings,
|
||||
Map<FladderItemType, bool> types,
|
||||
SortingOptions sortingOption,
|
||||
SortingOrder sortOrder,
|
||||
bool favourites,
|
||||
bool hideEmptyShows,
|
||||
bool recursive,
|
||||
GroupBy groupBy)?
|
||||
$default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LibraryFiltersModel() when $default != null:
|
||||
return $default(
|
||||
_that.id,
|
||||
_that.name,
|
||||
_that.isFavourite,
|
||||
_that.ids,
|
||||
_that.genres,
|
||||
_that.filters,
|
||||
_that.studios,
|
||||
_that.tags,
|
||||
_that.years,
|
||||
_that.officialRatings,
|
||||
_that.types,
|
||||
_that.sortingOption,
|
||||
_that.sortOrder,
|
||||
_that.favourites,
|
||||
_that.hideEmptyShows,
|
||||
_that.recursive,
|
||||
_that.groupBy);
|
||||
case _:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$LibraryFiltersModelImpl extends _LibraryFiltersModel {
|
||||
_$LibraryFiltersModelImpl(
|
||||
class _LibraryFiltersModel extends LibraryFiltersModel {
|
||||
_LibraryFiltersModel(
|
||||
{required this.id,
|
||||
required this.name,
|
||||
required this.isFavourite,
|
||||
|
|
@ -343,9 +472,8 @@ class _$LibraryFiltersModelImpl extends _LibraryFiltersModel {
|
|||
_officialRatings = officialRatings,
|
||||
_types = types,
|
||||
super._();
|
||||
|
||||
factory _$LibraryFiltersModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$LibraryFiltersModelImplFromJson(json);
|
||||
factory _LibraryFiltersModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$LibraryFiltersModelFromJson(json);
|
||||
|
||||
@override
|
||||
final String id;
|
||||
|
|
@ -431,92 +559,158 @@ class _$LibraryFiltersModelImpl extends _LibraryFiltersModel {
|
|||
@override
|
||||
final GroupBy groupBy;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LibraryFiltersModel._internal(id: $id, name: $name, isFavourite: $isFavourite, ids: $ids, genres: $genres, filters: $filters, studios: $studios, tags: $tags, years: $years, officialRatings: $officialRatings, types: $types, sortingOption: $sortingOption, sortOrder: $sortOrder, favourites: $favourites, hideEmptyShows: $hideEmptyShows, recursive: $recursive, groupBy: $groupBy)';
|
||||
}
|
||||
|
||||
/// Create a copy of LibraryFiltersModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$LibraryFiltersModelImplCopyWith<_$LibraryFiltersModelImpl> get copyWith =>
|
||||
__$$LibraryFiltersModelImplCopyWithImpl<_$LibraryFiltersModelImpl>(
|
||||
_$LibraryFiltersModelCopyWith<_LibraryFiltersModel> get copyWith =>
|
||||
__$LibraryFiltersModelCopyWithImpl<_LibraryFiltersModel>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$LibraryFiltersModelImplToJson(
|
||||
return _$LibraryFiltersModelToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LibraryFiltersModel(id: $id, name: $name, isFavourite: $isFavourite, ids: $ids, genres: $genres, filters: $filters, studios: $studios, tags: $tags, years: $years, officialRatings: $officialRatings, types: $types, sortingOption: $sortingOption, sortOrder: $sortOrder, favourites: $favourites, hideEmptyShows: $hideEmptyShows, recursive: $recursive, groupBy: $groupBy)';
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _LibraryFiltersModel extends LibraryFiltersModel {
|
||||
factory _LibraryFiltersModel(
|
||||
{required final String id,
|
||||
required final String name,
|
||||
required final bool isFavourite,
|
||||
required final List<String> ids,
|
||||
required final Map<String, bool> genres,
|
||||
required final Map<ItemFilter, bool> filters,
|
||||
@StudioEncoder() required final Map<Studio, bool> studios,
|
||||
required final Map<String, bool> tags,
|
||||
required final Map<int, bool> years,
|
||||
required final Map<String, bool> officialRatings,
|
||||
required final Map<FladderItemType, bool> types,
|
||||
required final SortingOptions sortingOption,
|
||||
required final SortingOrder sortOrder,
|
||||
required final bool favourites,
|
||||
required final bool hideEmptyShows,
|
||||
required final bool recursive,
|
||||
required final GroupBy groupBy}) = _$LibraryFiltersModelImpl;
|
||||
_LibraryFiltersModel._() : super._();
|
||||
/// @nodoc
|
||||
abstract mixin class _$LibraryFiltersModelCopyWith<$Res>
|
||||
implements $LibraryFiltersModelCopyWith<$Res> {
|
||||
factory _$LibraryFiltersModelCopyWith(_LibraryFiltersModel value,
|
||||
$Res Function(_LibraryFiltersModel) _then) =
|
||||
__$LibraryFiltersModelCopyWithImpl;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String id,
|
||||
String name,
|
||||
bool isFavourite,
|
||||
List<String> ids,
|
||||
Map<String, bool> genres,
|
||||
Map<ItemFilter, bool> filters,
|
||||
@StudioEncoder() Map<Studio, bool> studios,
|
||||
Map<String, bool> tags,
|
||||
Map<int, bool> years,
|
||||
Map<String, bool> officialRatings,
|
||||
Map<FladderItemType, bool> types,
|
||||
SortingOptions sortingOption,
|
||||
SortingOrder sortOrder,
|
||||
bool favourites,
|
||||
bool hideEmptyShows,
|
||||
bool recursive,
|
||||
GroupBy groupBy});
|
||||
}
|
||||
|
||||
factory _LibraryFiltersModel.fromJson(Map<String, dynamic> json) =
|
||||
_$LibraryFiltersModelImpl.fromJson;
|
||||
/// @nodoc
|
||||
class __$LibraryFiltersModelCopyWithImpl<$Res>
|
||||
implements _$LibraryFiltersModelCopyWith<$Res> {
|
||||
__$LibraryFiltersModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
@override
|
||||
String get id;
|
||||
@override
|
||||
String get name;
|
||||
@override
|
||||
bool get isFavourite;
|
||||
@override
|
||||
List<String> get ids;
|
||||
@override
|
||||
Map<String, bool> get genres;
|
||||
@override
|
||||
Map<ItemFilter, bool> get filters;
|
||||
@override
|
||||
@StudioEncoder()
|
||||
Map<Studio, bool> get studios;
|
||||
@override
|
||||
Map<String, bool> get tags;
|
||||
@override
|
||||
Map<int, bool> get years;
|
||||
@override
|
||||
Map<String, bool> get officialRatings;
|
||||
@override
|
||||
Map<FladderItemType, bool> get types;
|
||||
@override
|
||||
SortingOptions get sortingOption;
|
||||
@override
|
||||
SortingOrder get sortOrder;
|
||||
@override
|
||||
bool get favourites;
|
||||
@override
|
||||
bool get hideEmptyShows;
|
||||
@override
|
||||
bool get recursive;
|
||||
@override
|
||||
GroupBy get groupBy;
|
||||
final _LibraryFiltersModel _self;
|
||||
final $Res Function(_LibraryFiltersModel) _then;
|
||||
|
||||
/// Create a copy of LibraryFiltersModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$LibraryFiltersModelImplCopyWith<_$LibraryFiltersModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
@pragma('vm:prefer-inline')
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? name = null,
|
||||
Object? isFavourite = null,
|
||||
Object? ids = null,
|
||||
Object? genres = null,
|
||||
Object? filters = null,
|
||||
Object? studios = null,
|
||||
Object? tags = null,
|
||||
Object? years = null,
|
||||
Object? officialRatings = null,
|
||||
Object? types = null,
|
||||
Object? sortingOption = null,
|
||||
Object? sortOrder = null,
|
||||
Object? favourites = null,
|
||||
Object? hideEmptyShows = null,
|
||||
Object? recursive = null,
|
||||
Object? groupBy = null,
|
||||
}) {
|
||||
return _then(_LibraryFiltersModel(
|
||||
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,
|
||||
isFavourite: null == isFavourite
|
||||
? _self.isFavourite
|
||||
: isFavourite // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
ids: null == ids
|
||||
? _self._ids
|
||||
: ids // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>,
|
||||
genres: null == genres
|
||||
? _self._genres
|
||||
: genres // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, bool>,
|
||||
filters: null == filters
|
||||
? _self._filters
|
||||
: filters // ignore: cast_nullable_to_non_nullable
|
||||
as Map<ItemFilter, bool>,
|
||||
studios: null == studios
|
||||
? _self._studios
|
||||
: studios // ignore: cast_nullable_to_non_nullable
|
||||
as Map<Studio, bool>,
|
||||
tags: null == tags
|
||||
? _self._tags
|
||||
: tags // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, bool>,
|
||||
years: null == years
|
||||
? _self._years
|
||||
: years // ignore: cast_nullable_to_non_nullable
|
||||
as Map<int, bool>,
|
||||
officialRatings: null == officialRatings
|
||||
? _self._officialRatings
|
||||
: officialRatings // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, bool>,
|
||||
types: null == types
|
||||
? _self._types
|
||||
: types // ignore: cast_nullable_to_non_nullable
|
||||
as Map<FladderItemType, bool>,
|
||||
sortingOption: null == sortingOption
|
||||
? _self.sortingOption
|
||||
: sortingOption // ignore: cast_nullable_to_non_nullable
|
||||
as SortingOptions,
|
||||
sortOrder: null == sortOrder
|
||||
? _self.sortOrder
|
||||
: sortOrder // ignore: cast_nullable_to_non_nullable
|
||||
as SortingOrder,
|
||||
favourites: null == favourites
|
||||
? _self.favourites
|
||||
: favourites // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
hideEmptyShows: null == hideEmptyShows
|
||||
? _self.hideEmptyShows
|
||||
: hideEmptyShows // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
recursive: null == recursive
|
||||
? _self.recursive
|
||||
: recursive // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
groupBy: null == groupBy
|
||||
? _self.groupBy
|
||||
: groupBy // ignore: cast_nullable_to_non_nullable
|
||||
as GroupBy,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
// dart format on
|
||||
|
|
|
|||
|
|
@ -6,9 +6,8 @@ part of 'library_filters_model.dart';
|
|||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$LibraryFiltersModelImpl _$$LibraryFiltersModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$LibraryFiltersModelImpl(
|
||||
_LibraryFiltersModel _$LibraryFiltersModelFromJson(Map<String, dynamic> json) =>
|
||||
_LibraryFiltersModel(
|
||||
id: json['id'] as String,
|
||||
name: json['name'] as String,
|
||||
isFavourite: json['isFavourite'] as bool,
|
||||
|
|
@ -35,8 +34,8 @@ _$LibraryFiltersModelImpl _$$LibraryFiltersModelImplFromJson(
|
|||
groupBy: $enumDecode(_$GroupByEnumMap, json['groupBy']),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$LibraryFiltersModelImplToJson(
|
||||
_$LibraryFiltersModelImpl instance) =>
|
||||
Map<String, dynamic> _$LibraryFiltersModelToJson(
|
||||
_LibraryFiltersModel instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
|
|
|
|||
|
|
@ -182,15 +182,15 @@ class LibrarySearchModelMapper extends ClassMapperBase<LibrarySearchModel> {
|
|||
mixin LibrarySearchModelMappable {
|
||||
LibrarySearchModelCopyWith<LibrarySearchModel, LibrarySearchModel,
|
||||
LibrarySearchModel>
|
||||
get copyWith => _LibrarySearchModelCopyWithImpl(
|
||||
this as LibrarySearchModel, $identity, $identity);
|
||||
get copyWith => _LibrarySearchModelCopyWithImpl<LibrarySearchModel,
|
||||
LibrarySearchModel>(this as LibrarySearchModel, $identity, $identity);
|
||||
}
|
||||
|
||||
extension LibrarySearchModelValueCopy<$R, $Out>
|
||||
on ObjectCopyWith<$R, LibrarySearchModel, $Out> {
|
||||
LibrarySearchModelCopyWith<$R, LibrarySearchModel, $Out>
|
||||
get $asLibrarySearchModel =>
|
||||
$base.as((v, t, t2) => _LibrarySearchModelCopyWithImpl(v, t, t2));
|
||||
get $asLibrarySearchModel => $base.as(
|
||||
(v, t, t2) => _LibrarySearchModelCopyWithImpl<$R, $Out>(v, t, t2));
|
||||
}
|
||||
|
||||
abstract class LibrarySearchModelCopyWith<$R, $In extends LibrarySearchModel,
|
||||
|
|
@ -391,5 +391,5 @@ class _LibrarySearchModelCopyWithImpl<$R, $Out>
|
|||
@override
|
||||
LibrarySearchModelCopyWith<$R2, LibrarySearchModel, $Out2> $chain<$R2, $Out2>(
|
||||
Then<$Out2, $R2> t) =>
|
||||
_LibrarySearchModelCopyWithImpl($value, $cast, t);
|
||||
_LibrarySearchModelCopyWithImpl<$R2, $Out2>($value, $cast, t);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
|
|||
part 'arguments_model.freezed.dart';
|
||||
|
||||
@freezed
|
||||
class ArgumentsModel with _$ArgumentsModel {
|
||||
abstract class ArgumentsModel with _$ArgumentsModel {
|
||||
const ArgumentsModel._();
|
||||
|
||||
factory ArgumentsModel({
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint
|
||||
// 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
|
||||
|
||||
|
|
@ -9,20 +9,180 @@ part of 'arguments_model.dart';
|
|||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ArgumentsModel {
|
||||
bool get htpcMode => throw _privateConstructorUsedError;
|
||||
bool get htpcMode;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ArgumentsModel(htpcMode: $htpcMode)';
|
||||
}
|
||||
}
|
||||
|
||||
/// Adds pattern-matching-related methods to [ArgumentsModel].
|
||||
extension ArgumentsModelPatterns on ArgumentsModel {
|
||||
/// 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(_ArgumentsModel value)? $default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ArgumentsModel() 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(_ArgumentsModel value) $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ArgumentsModel():
|
||||
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(_ArgumentsModel value)? $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ArgumentsModel() 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 htpcMode)? $default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ArgumentsModel() when $default != null:
|
||||
return $default(_that.htpcMode);
|
||||
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 htpcMode) $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ArgumentsModel():
|
||||
return $default(_that.htpcMode);
|
||||
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 htpcMode)? $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ArgumentsModel() when $default != null:
|
||||
return $default(_that.htpcMode);
|
||||
case _:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$ArgumentsModelImpl extends _ArgumentsModel {
|
||||
_$ArgumentsModelImpl({this.htpcMode = false}) : super._();
|
||||
class _ArgumentsModel extends ArgumentsModel {
|
||||
_ArgumentsModel({this.htpcMode = false}) : super._();
|
||||
|
||||
@override
|
||||
@JsonKey()
|
||||
|
|
@ -34,10 +194,4 @@ class _$ArgumentsModelImpl extends _ArgumentsModel {
|
|||
}
|
||||
}
|
||||
|
||||
abstract class _ArgumentsModel extends ArgumentsModel {
|
||||
factory _ArgumentsModel({final bool htpcMode}) = _$ArgumentsModelImpl;
|
||||
_ArgumentsModel._() : super._();
|
||||
|
||||
@override
|
||||
bool get htpcMode;
|
||||
}
|
||||
// dart format on
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ enum BackgroundType {
|
|||
}
|
||||
|
||||
@Freezed(copyWith: true)
|
||||
class ClientSettingsModel with _$ClientSettingsModel {
|
||||
abstract class ClientSettingsModel with _$ClientSettingsModel {
|
||||
const ClientSettingsModel._();
|
||||
|
||||
factory ClientSettingsModel({
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -6,9 +6,8 @@ part of 'client_settings_model.dart';
|
|||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$ClientSettingsModelImpl _$$ClientSettingsModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$ClientSettingsModelImpl(
|
||||
_ClientSettingsModel _$ClientSettingsModelFromJson(Map<String, dynamic> json) =>
|
||||
_ClientSettingsModel(
|
||||
syncPath: json['syncPath'] as String?,
|
||||
position: json['position'] == null
|
||||
? const Vector2(x: 0, y: 0)
|
||||
|
|
@ -55,8 +54,8 @@ _$ClientSettingsModelImpl _$$ClientSettingsModelImplFromJson(
|
|||
const {},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$ClientSettingsModelImplToJson(
|
||||
_$ClientSettingsModelImpl instance) =>
|
||||
Map<String, dynamic> _$ClientSettingsModelToJson(
|
||||
_ClientSettingsModel instance) =>
|
||||
<String, dynamic>{
|
||||
'syncPath': instance.syncPath,
|
||||
'position': instance.position,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ part 'home_settings_model.freezed.dart';
|
|||
part 'home_settings_model.g.dart';
|
||||
|
||||
@Freezed(copyWith: true)
|
||||
class HomeSettingsModel with _$HomeSettingsModel {
|
||||
abstract class HomeSettingsModel with _$HomeSettingsModel {
|
||||
factory HomeSettingsModel({
|
||||
@Default({...LayoutMode.values}) Set<LayoutMode> screenLayouts,
|
||||
@Default({...ViewSize.values}) Set<ViewSize> layoutStates,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint
|
||||
// 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
|
||||
|
||||
|
|
@ -9,101 +9,39 @@ part of 'home_settings_model.dart';
|
|||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
HomeSettingsModel _$HomeSettingsModelFromJson(Map<String, dynamic> json) {
|
||||
return _HomeSettingsModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$HomeSettingsModel {
|
||||
Set<LayoutMode> get screenLayouts => throw _privateConstructorUsedError;
|
||||
Set<ViewSize> get layoutStates => throw _privateConstructorUsedError;
|
||||
HomeBanner get homeBanner => throw _privateConstructorUsedError;
|
||||
HomeCarouselSettings get carouselSettings =>
|
||||
throw _privateConstructorUsedError;
|
||||
HomeNextUp get nextUp => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this HomeSettingsModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
Set<LayoutMode> get screenLayouts;
|
||||
Set<ViewSize> get layoutStates;
|
||||
HomeBanner get homeBanner;
|
||||
HomeCarouselSettings get carouselSettings;
|
||||
HomeNextUp get nextUp;
|
||||
|
||||
/// Create a copy of HomeSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$HomeSettingsModelCopyWith<HomeSettingsModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $HomeSettingsModelCopyWith<$Res> {
|
||||
factory $HomeSettingsModelCopyWith(
|
||||
HomeSettingsModel value, $Res Function(HomeSettingsModel) then) =
|
||||
_$HomeSettingsModelCopyWithImpl<$Res, HomeSettingsModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{Set<LayoutMode> screenLayouts,
|
||||
Set<ViewSize> layoutStates,
|
||||
HomeBanner homeBanner,
|
||||
HomeCarouselSettings carouselSettings,
|
||||
HomeNextUp nextUp});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$HomeSettingsModelCopyWithImpl<$Res, $Val extends HomeSettingsModel>
|
||||
implements $HomeSettingsModelCopyWith<$Res> {
|
||||
_$HomeSettingsModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of HomeSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
$HomeSettingsModelCopyWith<HomeSettingsModel> get copyWith =>
|
||||
_$HomeSettingsModelCopyWithImpl<HomeSettingsModel>(
|
||||
this as HomeSettingsModel, _$identity);
|
||||
|
||||
/// Serializes this HomeSettingsModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
@override
|
||||
$Res call({
|
||||
Object? screenLayouts = null,
|
||||
Object? layoutStates = null,
|
||||
Object? homeBanner = null,
|
||||
Object? carouselSettings = null,
|
||||
Object? nextUp = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
screenLayouts: null == screenLayouts
|
||||
? _value.screenLayouts
|
||||
: screenLayouts // ignore: cast_nullable_to_non_nullable
|
||||
as Set<LayoutMode>,
|
||||
layoutStates: null == layoutStates
|
||||
? _value.layoutStates
|
||||
: layoutStates // ignore: cast_nullable_to_non_nullable
|
||||
as Set<ViewSize>,
|
||||
homeBanner: null == homeBanner
|
||||
? _value.homeBanner
|
||||
: homeBanner // ignore: cast_nullable_to_non_nullable
|
||||
as HomeBanner,
|
||||
carouselSettings: null == carouselSettings
|
||||
? _value.carouselSettings
|
||||
: carouselSettings // ignore: cast_nullable_to_non_nullable
|
||||
as HomeCarouselSettings,
|
||||
nextUp: null == nextUp
|
||||
? _value.nextUp
|
||||
: nextUp // ignore: cast_nullable_to_non_nullable
|
||||
as HomeNextUp,
|
||||
) as $Val);
|
||||
String toString() {
|
||||
return 'HomeSettingsModel(screenLayouts: $screenLayouts, layoutStates: $layoutStates, homeBanner: $homeBanner, carouselSettings: $carouselSettings, nextUp: $nextUp)';
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$HomeSettingsModelImplCopyWith<$Res>
|
||||
implements $HomeSettingsModelCopyWith<$Res> {
|
||||
factory _$$HomeSettingsModelImplCopyWith(_$HomeSettingsModelImpl value,
|
||||
$Res Function(_$HomeSettingsModelImpl) then) =
|
||||
__$$HomeSettingsModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
abstract mixin class $HomeSettingsModelCopyWith<$Res> {
|
||||
factory $HomeSettingsModelCopyWith(
|
||||
HomeSettingsModel value, $Res Function(HomeSettingsModel) _then) =
|
||||
_$HomeSettingsModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call(
|
||||
{Set<LayoutMode> screenLayouts,
|
||||
|
|
@ -114,12 +52,12 @@ abstract class _$$HomeSettingsModelImplCopyWith<$Res>
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$HomeSettingsModelImplCopyWithImpl<$Res>
|
||||
extends _$HomeSettingsModelCopyWithImpl<$Res, _$HomeSettingsModelImpl>
|
||||
implements _$$HomeSettingsModelImplCopyWith<$Res> {
|
||||
__$$HomeSettingsModelImplCopyWithImpl(_$HomeSettingsModelImpl _value,
|
||||
$Res Function(_$HomeSettingsModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
class _$HomeSettingsModelCopyWithImpl<$Res>
|
||||
implements $HomeSettingsModelCopyWith<$Res> {
|
||||
_$HomeSettingsModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final HomeSettingsModel _self;
|
||||
final $Res Function(HomeSettingsModel) _then;
|
||||
|
||||
/// Create a copy of HomeSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
|
|
@ -132,35 +70,213 @@ class __$$HomeSettingsModelImplCopyWithImpl<$Res>
|
|||
Object? carouselSettings = null,
|
||||
Object? nextUp = null,
|
||||
}) {
|
||||
return _then(_$HomeSettingsModelImpl(
|
||||
return _then(_self.copyWith(
|
||||
screenLayouts: null == screenLayouts
|
||||
? _value._screenLayouts
|
||||
? _self.screenLayouts
|
||||
: screenLayouts // ignore: cast_nullable_to_non_nullable
|
||||
as Set<LayoutMode>,
|
||||
layoutStates: null == layoutStates
|
||||
? _value._layoutStates
|
||||
? _self.layoutStates
|
||||
: layoutStates // ignore: cast_nullable_to_non_nullable
|
||||
as Set<ViewSize>,
|
||||
homeBanner: null == homeBanner
|
||||
? _value.homeBanner
|
||||
? _self.homeBanner
|
||||
: homeBanner // ignore: cast_nullable_to_non_nullable
|
||||
as HomeBanner,
|
||||
carouselSettings: null == carouselSettings
|
||||
? _value.carouselSettings
|
||||
? _self.carouselSettings
|
||||
: carouselSettings // ignore: cast_nullable_to_non_nullable
|
||||
as HomeCarouselSettings,
|
||||
nextUp: null == nextUp
|
||||
? _value.nextUp
|
||||
? _self.nextUp
|
||||
: nextUp // ignore: cast_nullable_to_non_nullable
|
||||
as HomeNextUp,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// Adds pattern-matching-related methods to [HomeSettingsModel].
|
||||
extension HomeSettingsModelPatterns on HomeSettingsModel {
|
||||
/// 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(_HomeSettingsModel value)? $default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _HomeSettingsModel() 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(_HomeSettingsModel value) $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _HomeSettingsModel():
|
||||
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(_HomeSettingsModel value)? $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _HomeSettingsModel() 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(
|
||||
Set<LayoutMode> screenLayouts,
|
||||
Set<ViewSize> layoutStates,
|
||||
HomeBanner homeBanner,
|
||||
HomeCarouselSettings carouselSettings,
|
||||
HomeNextUp nextUp)?
|
||||
$default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _HomeSettingsModel() when $default != null:
|
||||
return $default(_that.screenLayouts, _that.layoutStates,
|
||||
_that.homeBanner, _that.carouselSettings, _that.nextUp);
|
||||
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(
|
||||
Set<LayoutMode> screenLayouts,
|
||||
Set<ViewSize> layoutStates,
|
||||
HomeBanner homeBanner,
|
||||
HomeCarouselSettings carouselSettings,
|
||||
HomeNextUp nextUp)
|
||||
$default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _HomeSettingsModel():
|
||||
return $default(_that.screenLayouts, _that.layoutStates,
|
||||
_that.homeBanner, _that.carouselSettings, _that.nextUp);
|
||||
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(
|
||||
Set<LayoutMode> screenLayouts,
|
||||
Set<ViewSize> layoutStates,
|
||||
HomeBanner homeBanner,
|
||||
HomeCarouselSettings carouselSettings,
|
||||
HomeNextUp nextUp)?
|
||||
$default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _HomeSettingsModel() when $default != null:
|
||||
return $default(_that.screenLayouts, _that.layoutStates,
|
||||
_that.homeBanner, _that.carouselSettings, _that.nextUp);
|
||||
case _:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$HomeSettingsModelImpl implements _HomeSettingsModel {
|
||||
_$HomeSettingsModelImpl(
|
||||
class _HomeSettingsModel implements HomeSettingsModel {
|
||||
_HomeSettingsModel(
|
||||
{final Set<LayoutMode> screenLayouts = const {...LayoutMode.values},
|
||||
final Set<ViewSize> layoutStates = const {...ViewSize.values},
|
||||
this.homeBanner = HomeBanner.carousel,
|
||||
|
|
@ -168,9 +284,8 @@ class _$HomeSettingsModelImpl implements _HomeSettingsModel {
|
|||
this.nextUp = HomeNextUp.separate})
|
||||
: _screenLayouts = screenLayouts,
|
||||
_layoutStates = layoutStates;
|
||||
|
||||
factory _$HomeSettingsModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$HomeSettingsModelImplFromJson(json);
|
||||
factory _HomeSettingsModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$HomeSettingsModelFromJson(json);
|
||||
|
||||
final Set<LayoutMode> _screenLayouts;
|
||||
@override
|
||||
|
|
@ -200,54 +315,85 @@ class _$HomeSettingsModelImpl implements _HomeSettingsModel {
|
|||
@JsonKey()
|
||||
final HomeNextUp nextUp;
|
||||
|
||||
/// Create a copy of HomeSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$HomeSettingsModelCopyWith<_HomeSettingsModel> get copyWith =>
|
||||
__$HomeSettingsModelCopyWithImpl<_HomeSettingsModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$HomeSettingsModelToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'HomeSettingsModel(screenLayouts: $screenLayouts, layoutStates: $layoutStates, homeBanner: $homeBanner, carouselSettings: $carouselSettings, nextUp: $nextUp)';
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$HomeSettingsModelCopyWith<$Res>
|
||||
implements $HomeSettingsModelCopyWith<$Res> {
|
||||
factory _$HomeSettingsModelCopyWith(
|
||||
_HomeSettingsModel value, $Res Function(_HomeSettingsModel) _then) =
|
||||
__$HomeSettingsModelCopyWithImpl;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{Set<LayoutMode> screenLayouts,
|
||||
Set<ViewSize> layoutStates,
|
||||
HomeBanner homeBanner,
|
||||
HomeCarouselSettings carouselSettings,
|
||||
HomeNextUp nextUp});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$HomeSettingsModelCopyWithImpl<$Res>
|
||||
implements _$HomeSettingsModelCopyWith<$Res> {
|
||||
__$HomeSettingsModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _HomeSettingsModel _self;
|
||||
final $Res Function(_HomeSettingsModel) _then;
|
||||
|
||||
/// Create a copy of HomeSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$HomeSettingsModelImplCopyWith<_$HomeSettingsModelImpl> get copyWith =>
|
||||
__$$HomeSettingsModelImplCopyWithImpl<_$HomeSettingsModelImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$HomeSettingsModelImplToJson(
|
||||
this,
|
||||
);
|
||||
$Res call({
|
||||
Object? screenLayouts = null,
|
||||
Object? layoutStates = null,
|
||||
Object? homeBanner = null,
|
||||
Object? carouselSettings = null,
|
||||
Object? nextUp = null,
|
||||
}) {
|
||||
return _then(_HomeSettingsModel(
|
||||
screenLayouts: null == screenLayouts
|
||||
? _self._screenLayouts
|
||||
: screenLayouts // ignore: cast_nullable_to_non_nullable
|
||||
as Set<LayoutMode>,
|
||||
layoutStates: null == layoutStates
|
||||
? _self._layoutStates
|
||||
: layoutStates // ignore: cast_nullable_to_non_nullable
|
||||
as Set<ViewSize>,
|
||||
homeBanner: null == homeBanner
|
||||
? _self.homeBanner
|
||||
: homeBanner // ignore: cast_nullable_to_non_nullable
|
||||
as HomeBanner,
|
||||
carouselSettings: null == carouselSettings
|
||||
? _self.carouselSettings
|
||||
: carouselSettings // ignore: cast_nullable_to_non_nullable
|
||||
as HomeCarouselSettings,
|
||||
nextUp: null == nextUp
|
||||
? _self.nextUp
|
||||
: nextUp // ignore: cast_nullable_to_non_nullable
|
||||
as HomeNextUp,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _HomeSettingsModel implements HomeSettingsModel {
|
||||
factory _HomeSettingsModel(
|
||||
{final Set<LayoutMode> screenLayouts,
|
||||
final Set<ViewSize> layoutStates,
|
||||
final HomeBanner homeBanner,
|
||||
final HomeCarouselSettings carouselSettings,
|
||||
final HomeNextUp nextUp}) = _$HomeSettingsModelImpl;
|
||||
|
||||
factory _HomeSettingsModel.fromJson(Map<String, dynamic> json) =
|
||||
_$HomeSettingsModelImpl.fromJson;
|
||||
|
||||
@override
|
||||
Set<LayoutMode> get screenLayouts;
|
||||
@override
|
||||
Set<ViewSize> get layoutStates;
|
||||
@override
|
||||
HomeBanner get homeBanner;
|
||||
@override
|
||||
HomeCarouselSettings get carouselSettings;
|
||||
@override
|
||||
HomeNextUp get nextUp;
|
||||
|
||||
/// Create a copy of HomeSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$HomeSettingsModelImplCopyWith<_$HomeSettingsModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
// dart format on
|
||||
|
|
|
|||
|
|
@ -6,9 +6,8 @@ part of 'home_settings_model.dart';
|
|||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$HomeSettingsModelImpl _$$HomeSettingsModelImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$HomeSettingsModelImpl(
|
||||
_HomeSettingsModel _$HomeSettingsModelFromJson(Map<String, dynamic> json) =>
|
||||
_HomeSettingsModel(
|
||||
screenLayouts: (json['screenLayouts'] as List<dynamic>?)
|
||||
?.map((e) => $enumDecode(_$LayoutModeEnumMap, e))
|
||||
.toSet() ??
|
||||
|
|
@ -27,8 +26,7 @@ _$HomeSettingsModelImpl _$$HomeSettingsModelImplFromJson(
|
|||
HomeNextUp.separate,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$HomeSettingsModelImplToJson(
|
||||
_$HomeSettingsModelImpl instance) =>
|
||||
Map<String, dynamic> _$HomeSettingsModelToJson(_HomeSettingsModel instance) =>
|
||||
<String, dynamic>{
|
||||
'screenLayouts':
|
||||
instance.screenLayouts.map((e) => _$LayoutModeEnumMap[e]!).toList(),
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ part 'key_combinations.freezed.dart';
|
|||
part 'key_combinations.g.dart';
|
||||
|
||||
@Freezed(toJson: true, fromJson: true, copyWith: true)
|
||||
class KeyCombination with _$KeyCombination {
|
||||
abstract class KeyCombination with _$KeyCombination {
|
||||
const KeyCombination._();
|
||||
|
||||
factory KeyCombination({
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint
|
||||
// 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
|
||||
|
||||
|
|
@ -9,97 +9,42 @@ part of 'key_combinations.dart';
|
|||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
KeyCombination _$KeyCombinationFromJson(Map<String, dynamic> json) {
|
||||
return _KeyCombination.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$KeyCombination {
|
||||
@LogicalKeyboardSerializer()
|
||||
LogicalKeyboardKey? get key => throw _privateConstructorUsedError;
|
||||
LogicalKeyboardKey? get key;
|
||||
@LogicalKeyboardSerializer()
|
||||
LogicalKeyboardKey? get modifier => throw _privateConstructorUsedError;
|
||||
LogicalKeyboardKey? get modifier;
|
||||
@LogicalKeyboardSerializer()
|
||||
LogicalKeyboardKey? get altKey => throw _privateConstructorUsedError;
|
||||
LogicalKeyboardKey? get altKey;
|
||||
@LogicalKeyboardSerializer()
|
||||
LogicalKeyboardKey? get altModifier => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this KeyCombination to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
LogicalKeyboardKey? get altModifier;
|
||||
|
||||
/// Create a copy of KeyCombination
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$KeyCombinationCopyWith<KeyCombination> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $KeyCombinationCopyWith<$Res> {
|
||||
factory $KeyCombinationCopyWith(
|
||||
KeyCombination value, $Res Function(KeyCombination) then) =
|
||||
_$KeyCombinationCopyWithImpl<$Res, KeyCombination>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@LogicalKeyboardSerializer() LogicalKeyboardKey? key,
|
||||
@LogicalKeyboardSerializer() LogicalKeyboardKey? modifier,
|
||||
@LogicalKeyboardSerializer() LogicalKeyboardKey? altKey,
|
||||
@LogicalKeyboardSerializer() LogicalKeyboardKey? altModifier});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$KeyCombinationCopyWithImpl<$Res, $Val extends KeyCombination>
|
||||
implements $KeyCombinationCopyWith<$Res> {
|
||||
_$KeyCombinationCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of KeyCombination
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
$KeyCombinationCopyWith<KeyCombination> get copyWith =>
|
||||
_$KeyCombinationCopyWithImpl<KeyCombination>(
|
||||
this as KeyCombination, _$identity);
|
||||
|
||||
/// Serializes this KeyCombination to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
@override
|
||||
$Res call({
|
||||
Object? key = freezed,
|
||||
Object? modifier = freezed,
|
||||
Object? altKey = freezed,
|
||||
Object? altModifier = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
key: freezed == key
|
||||
? _value.key
|
||||
: key // ignore: cast_nullable_to_non_nullable
|
||||
as LogicalKeyboardKey?,
|
||||
modifier: freezed == modifier
|
||||
? _value.modifier
|
||||
: modifier // ignore: cast_nullable_to_non_nullable
|
||||
as LogicalKeyboardKey?,
|
||||
altKey: freezed == altKey
|
||||
? _value.altKey
|
||||
: altKey // ignore: cast_nullable_to_non_nullable
|
||||
as LogicalKeyboardKey?,
|
||||
altModifier: freezed == altModifier
|
||||
? _value.altModifier
|
||||
: altModifier // ignore: cast_nullable_to_non_nullable
|
||||
as LogicalKeyboardKey?,
|
||||
) as $Val);
|
||||
String toString() {
|
||||
return 'KeyCombination(key: $key, modifier: $modifier, altKey: $altKey, altModifier: $altModifier)';
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$KeyCombinationImplCopyWith<$Res>
|
||||
implements $KeyCombinationCopyWith<$Res> {
|
||||
factory _$$KeyCombinationImplCopyWith(_$KeyCombinationImpl value,
|
||||
$Res Function(_$KeyCombinationImpl) then) =
|
||||
__$$KeyCombinationImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
abstract mixin class $KeyCombinationCopyWith<$Res> {
|
||||
factory $KeyCombinationCopyWith(
|
||||
KeyCombination value, $Res Function(KeyCombination) _then) =
|
||||
_$KeyCombinationCopyWithImpl;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@LogicalKeyboardSerializer() LogicalKeyboardKey? key,
|
||||
|
|
@ -109,12 +54,12 @@ abstract class _$$KeyCombinationImplCopyWith<$Res>
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$KeyCombinationImplCopyWithImpl<$Res>
|
||||
extends _$KeyCombinationCopyWithImpl<$Res, _$KeyCombinationImpl>
|
||||
implements _$$KeyCombinationImplCopyWith<$Res> {
|
||||
__$$KeyCombinationImplCopyWithImpl(
|
||||
_$KeyCombinationImpl _value, $Res Function(_$KeyCombinationImpl) _then)
|
||||
: super(_value, _then);
|
||||
class _$KeyCombinationCopyWithImpl<$Res>
|
||||
implements $KeyCombinationCopyWith<$Res> {
|
||||
_$KeyCombinationCopyWithImpl(this._self, this._then);
|
||||
|
||||
final KeyCombination _self;
|
||||
final $Res Function(KeyCombination) _then;
|
||||
|
||||
/// Create a copy of KeyCombination
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
|
|
@ -126,39 +71,213 @@ class __$$KeyCombinationImplCopyWithImpl<$Res>
|
|||
Object? altKey = freezed,
|
||||
Object? altModifier = freezed,
|
||||
}) {
|
||||
return _then(_$KeyCombinationImpl(
|
||||
return _then(_self.copyWith(
|
||||
key: freezed == key
|
||||
? _value.key
|
||||
? _self.key
|
||||
: key // ignore: cast_nullable_to_non_nullable
|
||||
as LogicalKeyboardKey?,
|
||||
modifier: freezed == modifier
|
||||
? _value.modifier
|
||||
? _self.modifier
|
||||
: modifier // ignore: cast_nullable_to_non_nullable
|
||||
as LogicalKeyboardKey?,
|
||||
altKey: freezed == altKey
|
||||
? _value.altKey
|
||||
? _self.altKey
|
||||
: altKey // ignore: cast_nullable_to_non_nullable
|
||||
as LogicalKeyboardKey?,
|
||||
altModifier: freezed == altModifier
|
||||
? _value.altModifier
|
||||
? _self.altModifier
|
||||
: altModifier // ignore: cast_nullable_to_non_nullable
|
||||
as LogicalKeyboardKey?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// Adds pattern-matching-related methods to [KeyCombination].
|
||||
extension KeyCombinationPatterns on KeyCombination {
|
||||
/// 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(_KeyCombination value)? $default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _KeyCombination() 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(_KeyCombination value) $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _KeyCombination():
|
||||
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(_KeyCombination value)? $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _KeyCombination() 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(
|
||||
@LogicalKeyboardSerializer() LogicalKeyboardKey? key,
|
||||
@LogicalKeyboardSerializer() LogicalKeyboardKey? modifier,
|
||||
@LogicalKeyboardSerializer() LogicalKeyboardKey? altKey,
|
||||
@LogicalKeyboardSerializer() LogicalKeyboardKey? altModifier)?
|
||||
$default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _KeyCombination() when $default != null:
|
||||
return $default(
|
||||
_that.key, _that.modifier, _that.altKey, _that.altModifier);
|
||||
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(
|
||||
@LogicalKeyboardSerializer() LogicalKeyboardKey? key,
|
||||
@LogicalKeyboardSerializer() LogicalKeyboardKey? modifier,
|
||||
@LogicalKeyboardSerializer() LogicalKeyboardKey? altKey,
|
||||
@LogicalKeyboardSerializer() LogicalKeyboardKey? altModifier)
|
||||
$default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _KeyCombination():
|
||||
return $default(
|
||||
_that.key, _that.modifier, _that.altKey, _that.altModifier);
|
||||
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(
|
||||
@LogicalKeyboardSerializer() LogicalKeyboardKey? key,
|
||||
@LogicalKeyboardSerializer() LogicalKeyboardKey? modifier,
|
||||
@LogicalKeyboardSerializer() LogicalKeyboardKey? altKey,
|
||||
@LogicalKeyboardSerializer() LogicalKeyboardKey? altModifier)?
|
||||
$default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _KeyCombination() when $default != null:
|
||||
return $default(
|
||||
_that.key, _that.modifier, _that.altKey, _that.altModifier);
|
||||
case _:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$KeyCombinationImpl extends _KeyCombination {
|
||||
_$KeyCombinationImpl(
|
||||
class _KeyCombination extends KeyCombination {
|
||||
_KeyCombination(
|
||||
{@LogicalKeyboardSerializer() this.key,
|
||||
@LogicalKeyboardSerializer() this.modifier,
|
||||
@LogicalKeyboardSerializer() this.altKey,
|
||||
@LogicalKeyboardSerializer() this.altModifier})
|
||||
: super._();
|
||||
|
||||
factory _$KeyCombinationImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$KeyCombinationImplFromJson(json);
|
||||
factory _KeyCombination.fromJson(Map<String, dynamic> json) =>
|
||||
_$KeyCombinationFromJson(json);
|
||||
|
||||
@override
|
||||
@LogicalKeyboardSerializer()
|
||||
|
|
@ -173,57 +292,79 @@ class _$KeyCombinationImpl extends _KeyCombination {
|
|||
@LogicalKeyboardSerializer()
|
||||
final LogicalKeyboardKey? altModifier;
|
||||
|
||||
/// Create a copy of KeyCombination
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$KeyCombinationCopyWith<_KeyCombination> get copyWith =>
|
||||
__$KeyCombinationCopyWithImpl<_KeyCombination>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$KeyCombinationToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'KeyCombination(key: $key, modifier: $modifier, altKey: $altKey, altModifier: $altModifier)';
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$KeyCombinationCopyWith<$Res>
|
||||
implements $KeyCombinationCopyWith<$Res> {
|
||||
factory _$KeyCombinationCopyWith(
|
||||
_KeyCombination value, $Res Function(_KeyCombination) _then) =
|
||||
__$KeyCombinationCopyWithImpl;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@LogicalKeyboardSerializer() LogicalKeyboardKey? key,
|
||||
@LogicalKeyboardSerializer() LogicalKeyboardKey? modifier,
|
||||
@LogicalKeyboardSerializer() LogicalKeyboardKey? altKey,
|
||||
@LogicalKeyboardSerializer() LogicalKeyboardKey? altModifier});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$KeyCombinationCopyWithImpl<$Res>
|
||||
implements _$KeyCombinationCopyWith<$Res> {
|
||||
__$KeyCombinationCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _KeyCombination _self;
|
||||
final $Res Function(_KeyCombination) _then;
|
||||
|
||||
/// Create a copy of KeyCombination
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$KeyCombinationImplCopyWith<_$KeyCombinationImpl> get copyWith =>
|
||||
__$$KeyCombinationImplCopyWithImpl<_$KeyCombinationImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$KeyCombinationImplToJson(
|
||||
this,
|
||||
);
|
||||
$Res call({
|
||||
Object? key = freezed,
|
||||
Object? modifier = freezed,
|
||||
Object? altKey = freezed,
|
||||
Object? altModifier = freezed,
|
||||
}) {
|
||||
return _then(_KeyCombination(
|
||||
key: freezed == key
|
||||
? _self.key
|
||||
: key // ignore: cast_nullable_to_non_nullable
|
||||
as LogicalKeyboardKey?,
|
||||
modifier: freezed == modifier
|
||||
? _self.modifier
|
||||
: modifier // ignore: cast_nullable_to_non_nullable
|
||||
as LogicalKeyboardKey?,
|
||||
altKey: freezed == altKey
|
||||
? _self.altKey
|
||||
: altKey // ignore: cast_nullable_to_non_nullable
|
||||
as LogicalKeyboardKey?,
|
||||
altModifier: freezed == altModifier
|
||||
? _self.altModifier
|
||||
: altModifier // ignore: cast_nullable_to_non_nullable
|
||||
as LogicalKeyboardKey?,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _KeyCombination extends KeyCombination {
|
||||
factory _KeyCombination(
|
||||
{@LogicalKeyboardSerializer() final LogicalKeyboardKey? key,
|
||||
@LogicalKeyboardSerializer() final LogicalKeyboardKey? modifier,
|
||||
@LogicalKeyboardSerializer() final LogicalKeyboardKey? altKey,
|
||||
@LogicalKeyboardSerializer() final LogicalKeyboardKey? altModifier}) =
|
||||
_$KeyCombinationImpl;
|
||||
_KeyCombination._() : super._();
|
||||
|
||||
factory _KeyCombination.fromJson(Map<String, dynamic> json) =
|
||||
_$KeyCombinationImpl.fromJson;
|
||||
|
||||
@override
|
||||
@LogicalKeyboardSerializer()
|
||||
LogicalKeyboardKey? get key;
|
||||
@override
|
||||
@LogicalKeyboardSerializer()
|
||||
LogicalKeyboardKey? get modifier;
|
||||
@override
|
||||
@LogicalKeyboardSerializer()
|
||||
LogicalKeyboardKey? get altKey;
|
||||
@override
|
||||
@LogicalKeyboardSerializer()
|
||||
LogicalKeyboardKey? get altModifier;
|
||||
|
||||
/// Create a copy of KeyCombination
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$KeyCombinationImplCopyWith<_$KeyCombinationImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
// dart format on
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ part of 'key_combinations.dart';
|
|||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$KeyCombinationImpl _$$KeyCombinationImplFromJson(Map<String, dynamic> json) =>
|
||||
_$KeyCombinationImpl(
|
||||
_KeyCombination _$KeyCombinationFromJson(Map<String, dynamic> json) =>
|
||||
_KeyCombination(
|
||||
key: _$JsonConverterFromJson<String, LogicalKeyboardKey>(
|
||||
json['key'], const LogicalKeyboardSerializer().fromJson),
|
||||
modifier: _$JsonConverterFromJson<String, LogicalKeyboardKey>(
|
||||
|
|
@ -18,8 +18,7 @@ _$KeyCombinationImpl _$$KeyCombinationImplFromJson(Map<String, dynamic> json) =>
|
|||
json['altModifier'], const LogicalKeyboardSerializer().fromJson),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$KeyCombinationImplToJson(
|
||||
_$KeyCombinationImpl instance) =>
|
||||
Map<String, dynamic> _$KeyCombinationToJson(_KeyCombination instance) =>
|
||||
<String, dynamic>{
|
||||
'key': _$JsonConverterToJson<String, LogicalKeyboardKey>(
|
||||
instance.key, const LogicalKeyboardSerializer().toJson),
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ enum VideoHotKeys {
|
|||
}
|
||||
|
||||
@Freezed(copyWith: true)
|
||||
class VideoPlayerSettingsModel with _$VideoPlayerSettingsModel {
|
||||
abstract class VideoPlayerSettingsModel with _$VideoPlayerSettingsModel {
|
||||
const VideoPlayerSettingsModel._();
|
||||
|
||||
factory VideoPlayerSettingsModel({
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint
|
||||
// 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
|
||||
|
||||
|
|
@ -9,176 +9,70 @@ part of 'video_player_settings.dart';
|
|||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
VideoPlayerSettingsModel _$VideoPlayerSettingsModelFromJson(
|
||||
Map<String, dynamic> json) {
|
||||
return _VideoPlayerSettingsModel.fromJson(json);
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$VideoPlayerSettingsModel {
|
||||
double? get screenBrightness => throw _privateConstructorUsedError;
|
||||
BoxFit get videoFit => throw _privateConstructorUsedError;
|
||||
bool get fillScreen => throw _privateConstructorUsedError;
|
||||
bool get hardwareAccel => throw _privateConstructorUsedError;
|
||||
bool get useLibass => throw _privateConstructorUsedError;
|
||||
int get bufferSize => throw _privateConstructorUsedError;
|
||||
PlayerOptions? get playerOptions => throw _privateConstructorUsedError;
|
||||
double get internalVolume => throw _privateConstructorUsedError;
|
||||
Set<DeviceOrientation>? get allowedOrientations =>
|
||||
throw _privateConstructorUsedError;
|
||||
AutoNextType get nextVideoType => throw _privateConstructorUsedError;
|
||||
Bitrate get maxHomeBitrate => throw _privateConstructorUsedError;
|
||||
Bitrate get maxInternetBitrate => throw _privateConstructorUsedError;
|
||||
String? get audioDevice => throw _privateConstructorUsedError;
|
||||
Map<MediaSegmentType, SegmentSkip> get segmentSkipSettings =>
|
||||
throw _privateConstructorUsedError;
|
||||
Map<VideoHotKeys, KeyCombination> get hotKeys =>
|
||||
throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this VideoPlayerSettingsModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
mixin _$VideoPlayerSettingsModel implements DiagnosticableTreeMixin {
|
||||
double? get screenBrightness;
|
||||
BoxFit get videoFit;
|
||||
bool get fillScreen;
|
||||
bool get hardwareAccel;
|
||||
bool get useLibass;
|
||||
int get bufferSize;
|
||||
PlayerOptions? get playerOptions;
|
||||
double get internalVolume;
|
||||
Set<DeviceOrientation>? get allowedOrientations;
|
||||
AutoNextType get nextVideoType;
|
||||
Bitrate get maxHomeBitrate;
|
||||
Bitrate get maxInternetBitrate;
|
||||
String? get audioDevice;
|
||||
Map<MediaSegmentType, SegmentSkip> get segmentSkipSettings;
|
||||
Map<VideoHotKeys, KeyCombination> get hotKeys;
|
||||
|
||||
/// Create a copy of VideoPlayerSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$VideoPlayerSettingsModelCopyWith<VideoPlayerSettingsModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $VideoPlayerSettingsModelCopyWith<$Res> {
|
||||
factory $VideoPlayerSettingsModelCopyWith(VideoPlayerSettingsModel value,
|
||||
$Res Function(VideoPlayerSettingsModel) then) =
|
||||
_$VideoPlayerSettingsModelCopyWithImpl<$Res, VideoPlayerSettingsModel>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{double? screenBrightness,
|
||||
BoxFit videoFit,
|
||||
bool fillScreen,
|
||||
bool hardwareAccel,
|
||||
bool useLibass,
|
||||
int bufferSize,
|
||||
PlayerOptions? playerOptions,
|
||||
double internalVolume,
|
||||
Set<DeviceOrientation>? allowedOrientations,
|
||||
AutoNextType nextVideoType,
|
||||
Bitrate maxHomeBitrate,
|
||||
Bitrate maxInternetBitrate,
|
||||
String? audioDevice,
|
||||
Map<MediaSegmentType, SegmentSkip> segmentSkipSettings,
|
||||
Map<VideoHotKeys, KeyCombination> hotKeys});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$VideoPlayerSettingsModelCopyWithImpl<$Res,
|
||||
$Val extends VideoPlayerSettingsModel>
|
||||
implements $VideoPlayerSettingsModelCopyWith<$Res> {
|
||||
_$VideoPlayerSettingsModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of VideoPlayerSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
$VideoPlayerSettingsModelCopyWith<VideoPlayerSettingsModel> get copyWith =>
|
||||
_$VideoPlayerSettingsModelCopyWithImpl<VideoPlayerSettingsModel>(
|
||||
this as VideoPlayerSettingsModel, _$identity);
|
||||
|
||||
/// Serializes this VideoPlayerSettingsModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
@override
|
||||
$Res call({
|
||||
Object? screenBrightness = freezed,
|
||||
Object? videoFit = null,
|
||||
Object? fillScreen = null,
|
||||
Object? hardwareAccel = null,
|
||||
Object? useLibass = null,
|
||||
Object? bufferSize = null,
|
||||
Object? playerOptions = freezed,
|
||||
Object? internalVolume = null,
|
||||
Object? allowedOrientations = freezed,
|
||||
Object? nextVideoType = null,
|
||||
Object? maxHomeBitrate = null,
|
||||
Object? maxInternetBitrate = null,
|
||||
Object? audioDevice = freezed,
|
||||
Object? segmentSkipSettings = null,
|
||||
Object? hotKeys = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
screenBrightness: freezed == screenBrightness
|
||||
? _value.screenBrightness
|
||||
: screenBrightness // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
videoFit: null == videoFit
|
||||
? _value.videoFit
|
||||
: videoFit // ignore: cast_nullable_to_non_nullable
|
||||
as BoxFit,
|
||||
fillScreen: null == fillScreen
|
||||
? _value.fillScreen
|
||||
: fillScreen // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
hardwareAccel: null == hardwareAccel
|
||||
? _value.hardwareAccel
|
||||
: hardwareAccel // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
useLibass: null == useLibass
|
||||
? _value.useLibass
|
||||
: useLibass // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
bufferSize: null == bufferSize
|
||||
? _value.bufferSize
|
||||
: bufferSize // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
playerOptions: freezed == playerOptions
|
||||
? _value.playerOptions
|
||||
: playerOptions // ignore: cast_nullable_to_non_nullable
|
||||
as PlayerOptions?,
|
||||
internalVolume: null == internalVolume
|
||||
? _value.internalVolume
|
||||
: internalVolume // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
allowedOrientations: freezed == allowedOrientations
|
||||
? _value.allowedOrientations
|
||||
: allowedOrientations // ignore: cast_nullable_to_non_nullable
|
||||
as Set<DeviceOrientation>?,
|
||||
nextVideoType: null == nextVideoType
|
||||
? _value.nextVideoType
|
||||
: nextVideoType // ignore: cast_nullable_to_non_nullable
|
||||
as AutoNextType,
|
||||
maxHomeBitrate: null == maxHomeBitrate
|
||||
? _value.maxHomeBitrate
|
||||
: maxHomeBitrate // ignore: cast_nullable_to_non_nullable
|
||||
as Bitrate,
|
||||
maxInternetBitrate: null == maxInternetBitrate
|
||||
? _value.maxInternetBitrate
|
||||
: maxInternetBitrate // ignore: cast_nullable_to_non_nullable
|
||||
as Bitrate,
|
||||
audioDevice: freezed == audioDevice
|
||||
? _value.audioDevice
|
||||
: audioDevice // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
segmentSkipSettings: null == segmentSkipSettings
|
||||
? _value.segmentSkipSettings
|
||||
: segmentSkipSettings // ignore: cast_nullable_to_non_nullable
|
||||
as Map<MediaSegmentType, SegmentSkip>,
|
||||
hotKeys: null == hotKeys
|
||||
? _value.hotKeys
|
||||
: hotKeys // ignore: cast_nullable_to_non_nullable
|
||||
as Map<VideoHotKeys, KeyCombination>,
|
||||
) as $Val);
|
||||
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
||||
properties
|
||||
..add(DiagnosticsProperty('type', 'VideoPlayerSettingsModel'))
|
||||
..add(DiagnosticsProperty('screenBrightness', screenBrightness))
|
||||
..add(DiagnosticsProperty('videoFit', videoFit))
|
||||
..add(DiagnosticsProperty('fillScreen', fillScreen))
|
||||
..add(DiagnosticsProperty('hardwareAccel', hardwareAccel))
|
||||
..add(DiagnosticsProperty('useLibass', useLibass))
|
||||
..add(DiagnosticsProperty('bufferSize', bufferSize))
|
||||
..add(DiagnosticsProperty('playerOptions', playerOptions))
|
||||
..add(DiagnosticsProperty('internalVolume', internalVolume))
|
||||
..add(DiagnosticsProperty('allowedOrientations', allowedOrientations))
|
||||
..add(DiagnosticsProperty('nextVideoType', nextVideoType))
|
||||
..add(DiagnosticsProperty('maxHomeBitrate', maxHomeBitrate))
|
||||
..add(DiagnosticsProperty('maxInternetBitrate', maxInternetBitrate))
|
||||
..add(DiagnosticsProperty('audioDevice', audioDevice))
|
||||
..add(DiagnosticsProperty('segmentSkipSettings', segmentSkipSettings))
|
||||
..add(DiagnosticsProperty('hotKeys', hotKeys));
|
||||
}
|
||||
|
||||
@override
|
||||
String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
|
||||
return 'VideoPlayerSettingsModel(screenBrightness: $screenBrightness, videoFit: $videoFit, fillScreen: $fillScreen, hardwareAccel: $hardwareAccel, useLibass: $useLibass, bufferSize: $bufferSize, playerOptions: $playerOptions, internalVolume: $internalVolume, allowedOrientations: $allowedOrientations, nextVideoType: $nextVideoType, maxHomeBitrate: $maxHomeBitrate, maxInternetBitrate: $maxInternetBitrate, audioDevice: $audioDevice, segmentSkipSettings: $segmentSkipSettings, hotKeys: $hotKeys)';
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$VideoPlayerSettingsModelImplCopyWith<$Res>
|
||||
implements $VideoPlayerSettingsModelCopyWith<$Res> {
|
||||
factory _$$VideoPlayerSettingsModelImplCopyWith(
|
||||
_$VideoPlayerSettingsModelImpl value,
|
||||
$Res Function(_$VideoPlayerSettingsModelImpl) then) =
|
||||
__$$VideoPlayerSettingsModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
abstract mixin class $VideoPlayerSettingsModelCopyWith<$Res> {
|
||||
factory $VideoPlayerSettingsModelCopyWith(VideoPlayerSettingsModel value,
|
||||
$Res Function(VideoPlayerSettingsModel) _then) =
|
||||
_$VideoPlayerSettingsModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call(
|
||||
{double? screenBrightness,
|
||||
|
|
@ -199,14 +93,12 @@ abstract class _$$VideoPlayerSettingsModelImplCopyWith<$Res>
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$VideoPlayerSettingsModelImplCopyWithImpl<$Res>
|
||||
extends _$VideoPlayerSettingsModelCopyWithImpl<$Res,
|
||||
_$VideoPlayerSettingsModelImpl>
|
||||
implements _$$VideoPlayerSettingsModelImplCopyWith<$Res> {
|
||||
__$$VideoPlayerSettingsModelImplCopyWithImpl(
|
||||
_$VideoPlayerSettingsModelImpl _value,
|
||||
$Res Function(_$VideoPlayerSettingsModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
class _$VideoPlayerSettingsModelCopyWithImpl<$Res>
|
||||
implements $VideoPlayerSettingsModelCopyWith<$Res> {
|
||||
_$VideoPlayerSettingsModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final VideoPlayerSettingsModel _self;
|
||||
final $Res Function(VideoPlayerSettingsModel) _then;
|
||||
|
||||
/// Create a copy of VideoPlayerSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
|
|
@ -229,76 +121,326 @@ class __$$VideoPlayerSettingsModelImplCopyWithImpl<$Res>
|
|||
Object? segmentSkipSettings = null,
|
||||
Object? hotKeys = null,
|
||||
}) {
|
||||
return _then(_$VideoPlayerSettingsModelImpl(
|
||||
return _then(_self.copyWith(
|
||||
screenBrightness: freezed == screenBrightness
|
||||
? _value.screenBrightness
|
||||
? _self.screenBrightness
|
||||
: screenBrightness // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
videoFit: null == videoFit
|
||||
? _value.videoFit
|
||||
? _self.videoFit
|
||||
: videoFit // ignore: cast_nullable_to_non_nullable
|
||||
as BoxFit,
|
||||
fillScreen: null == fillScreen
|
||||
? _value.fillScreen
|
||||
? _self.fillScreen
|
||||
: fillScreen // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
hardwareAccel: null == hardwareAccel
|
||||
? _value.hardwareAccel
|
||||
? _self.hardwareAccel
|
||||
: hardwareAccel // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
useLibass: null == useLibass
|
||||
? _value.useLibass
|
||||
? _self.useLibass
|
||||
: useLibass // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
bufferSize: null == bufferSize
|
||||
? _value.bufferSize
|
||||
? _self.bufferSize
|
||||
: bufferSize // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
playerOptions: freezed == playerOptions
|
||||
? _value.playerOptions
|
||||
? _self.playerOptions
|
||||
: playerOptions // ignore: cast_nullable_to_non_nullable
|
||||
as PlayerOptions?,
|
||||
internalVolume: null == internalVolume
|
||||
? _value.internalVolume
|
||||
? _self.internalVolume
|
||||
: internalVolume // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
allowedOrientations: freezed == allowedOrientations
|
||||
? _value._allowedOrientations
|
||||
? _self.allowedOrientations
|
||||
: allowedOrientations // ignore: cast_nullable_to_non_nullable
|
||||
as Set<DeviceOrientation>?,
|
||||
nextVideoType: null == nextVideoType
|
||||
? _value.nextVideoType
|
||||
? _self.nextVideoType
|
||||
: nextVideoType // ignore: cast_nullable_to_non_nullable
|
||||
as AutoNextType,
|
||||
maxHomeBitrate: null == maxHomeBitrate
|
||||
? _value.maxHomeBitrate
|
||||
? _self.maxHomeBitrate
|
||||
: maxHomeBitrate // ignore: cast_nullable_to_non_nullable
|
||||
as Bitrate,
|
||||
maxInternetBitrate: null == maxInternetBitrate
|
||||
? _value.maxInternetBitrate
|
||||
? _self.maxInternetBitrate
|
||||
: maxInternetBitrate // ignore: cast_nullable_to_non_nullable
|
||||
as Bitrate,
|
||||
audioDevice: freezed == audioDevice
|
||||
? _value.audioDevice
|
||||
? _self.audioDevice
|
||||
: audioDevice // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
segmentSkipSettings: null == segmentSkipSettings
|
||||
? _value._segmentSkipSettings
|
||||
? _self.segmentSkipSettings
|
||||
: segmentSkipSettings // ignore: cast_nullable_to_non_nullable
|
||||
as Map<MediaSegmentType, SegmentSkip>,
|
||||
hotKeys: null == hotKeys
|
||||
? _value._hotKeys
|
||||
? _self.hotKeys
|
||||
: hotKeys // ignore: cast_nullable_to_non_nullable
|
||||
as Map<VideoHotKeys, KeyCombination>,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// Adds pattern-matching-related methods to [VideoPlayerSettingsModel].
|
||||
extension VideoPlayerSettingsModelPatterns on VideoPlayerSettingsModel {
|
||||
/// 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(_VideoPlayerSettingsModel value)? $default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _VideoPlayerSettingsModel() 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(_VideoPlayerSettingsModel value) $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _VideoPlayerSettingsModel():
|
||||
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(_VideoPlayerSettingsModel value)? $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _VideoPlayerSettingsModel() 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(
|
||||
double? screenBrightness,
|
||||
BoxFit videoFit,
|
||||
bool fillScreen,
|
||||
bool hardwareAccel,
|
||||
bool useLibass,
|
||||
int bufferSize,
|
||||
PlayerOptions? playerOptions,
|
||||
double internalVolume,
|
||||
Set<DeviceOrientation>? allowedOrientations,
|
||||
AutoNextType nextVideoType,
|
||||
Bitrate maxHomeBitrate,
|
||||
Bitrate maxInternetBitrate,
|
||||
String? audioDevice,
|
||||
Map<MediaSegmentType, SegmentSkip> segmentSkipSettings,
|
||||
Map<VideoHotKeys, KeyCombination> hotKeys)?
|
||||
$default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _VideoPlayerSettingsModel() when $default != null:
|
||||
return $default(
|
||||
_that.screenBrightness,
|
||||
_that.videoFit,
|
||||
_that.fillScreen,
|
||||
_that.hardwareAccel,
|
||||
_that.useLibass,
|
||||
_that.bufferSize,
|
||||
_that.playerOptions,
|
||||
_that.internalVolume,
|
||||
_that.allowedOrientations,
|
||||
_that.nextVideoType,
|
||||
_that.maxHomeBitrate,
|
||||
_that.maxInternetBitrate,
|
||||
_that.audioDevice,
|
||||
_that.segmentSkipSettings,
|
||||
_that.hotKeys);
|
||||
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(
|
||||
double? screenBrightness,
|
||||
BoxFit videoFit,
|
||||
bool fillScreen,
|
||||
bool hardwareAccel,
|
||||
bool useLibass,
|
||||
int bufferSize,
|
||||
PlayerOptions? playerOptions,
|
||||
double internalVolume,
|
||||
Set<DeviceOrientation>? allowedOrientations,
|
||||
AutoNextType nextVideoType,
|
||||
Bitrate maxHomeBitrate,
|
||||
Bitrate maxInternetBitrate,
|
||||
String? audioDevice,
|
||||
Map<MediaSegmentType, SegmentSkip> segmentSkipSettings,
|
||||
Map<VideoHotKeys, KeyCombination> hotKeys)
|
||||
$default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _VideoPlayerSettingsModel():
|
||||
return $default(
|
||||
_that.screenBrightness,
|
||||
_that.videoFit,
|
||||
_that.fillScreen,
|
||||
_that.hardwareAccel,
|
||||
_that.useLibass,
|
||||
_that.bufferSize,
|
||||
_that.playerOptions,
|
||||
_that.internalVolume,
|
||||
_that.allowedOrientations,
|
||||
_that.nextVideoType,
|
||||
_that.maxHomeBitrate,
|
||||
_that.maxInternetBitrate,
|
||||
_that.audioDevice,
|
||||
_that.segmentSkipSettings,
|
||||
_that.hotKeys);
|
||||
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(
|
||||
double? screenBrightness,
|
||||
BoxFit videoFit,
|
||||
bool fillScreen,
|
||||
bool hardwareAccel,
|
||||
bool useLibass,
|
||||
int bufferSize,
|
||||
PlayerOptions? playerOptions,
|
||||
double internalVolume,
|
||||
Set<DeviceOrientation>? allowedOrientations,
|
||||
AutoNextType nextVideoType,
|
||||
Bitrate maxHomeBitrate,
|
||||
Bitrate maxInternetBitrate,
|
||||
String? audioDevice,
|
||||
Map<MediaSegmentType, SegmentSkip> segmentSkipSettings,
|
||||
Map<VideoHotKeys, KeyCombination> hotKeys)?
|
||||
$default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _VideoPlayerSettingsModel() when $default != null:
|
||||
return $default(
|
||||
_that.screenBrightness,
|
||||
_that.videoFit,
|
||||
_that.fillScreen,
|
||||
_that.hardwareAccel,
|
||||
_that.useLibass,
|
||||
_that.bufferSize,
|
||||
_that.playerOptions,
|
||||
_that.internalVolume,
|
||||
_that.allowedOrientations,
|
||||
_that.nextVideoType,
|
||||
_that.maxHomeBitrate,
|
||||
_that.maxInternetBitrate,
|
||||
_that.audioDevice,
|
||||
_that.segmentSkipSettings,
|
||||
_that.hotKeys);
|
||||
case _:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$VideoPlayerSettingsModelImpl extends _VideoPlayerSettingsModel
|
||||
class _VideoPlayerSettingsModel extends VideoPlayerSettingsModel
|
||||
with DiagnosticableTreeMixin {
|
||||
_$VideoPlayerSettingsModelImpl(
|
||||
_VideoPlayerSettingsModel(
|
||||
{this.screenBrightness,
|
||||
this.videoFit = BoxFit.contain,
|
||||
this.fillScreen = false,
|
||||
|
|
@ -319,9 +461,8 @@ class _$VideoPlayerSettingsModelImpl extends _VideoPlayerSettingsModel
|
|||
_segmentSkipSettings = segmentSkipSettings,
|
||||
_hotKeys = hotKeys,
|
||||
super._();
|
||||
|
||||
factory _$VideoPlayerSettingsModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$VideoPlayerSettingsModelImplFromJson(json);
|
||||
factory _VideoPlayerSettingsModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$VideoPlayerSettingsModelFromJson(json);
|
||||
|
||||
@override
|
||||
final double? screenBrightness;
|
||||
|
|
@ -386,14 +527,24 @@ class _$VideoPlayerSettingsModelImpl extends _VideoPlayerSettingsModel
|
|||
return EqualUnmodifiableMapView(_hotKeys);
|
||||
}
|
||||
|
||||
/// Create a copy of VideoPlayerSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
|
||||
return 'VideoPlayerSettingsModel(screenBrightness: $screenBrightness, videoFit: $videoFit, fillScreen: $fillScreen, hardwareAccel: $hardwareAccel, useLibass: $useLibass, bufferSize: $bufferSize, playerOptions: $playerOptions, internalVolume: $internalVolume, allowedOrientations: $allowedOrientations, nextVideoType: $nextVideoType, maxHomeBitrate: $maxHomeBitrate, maxInternetBitrate: $maxInternetBitrate, audioDevice: $audioDevice, segmentSkipSettings: $segmentSkipSettings, hotKeys: $hotKeys)';
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$VideoPlayerSettingsModelCopyWith<_VideoPlayerSettingsModel> get copyWith =>
|
||||
__$VideoPlayerSettingsModelCopyWithImpl<_VideoPlayerSettingsModel>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$VideoPlayerSettingsModelToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
||||
super.debugFillProperties(properties);
|
||||
properties
|
||||
..add(DiagnosticsProperty('type', 'VideoPlayerSettingsModel'))
|
||||
..add(DiagnosticsProperty('screenBrightness', screenBrightness))
|
||||
|
|
@ -413,81 +564,130 @@ class _$VideoPlayerSettingsModelImpl extends _VideoPlayerSettingsModel
|
|||
..add(DiagnosticsProperty('hotKeys', hotKeys));
|
||||
}
|
||||
|
||||
/// Create a copy of VideoPlayerSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$VideoPlayerSettingsModelImplCopyWith<_$VideoPlayerSettingsModelImpl>
|
||||
get copyWith => __$$VideoPlayerSettingsModelImplCopyWithImpl<
|
||||
_$VideoPlayerSettingsModelImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$VideoPlayerSettingsModelImplToJson(
|
||||
this,
|
||||
);
|
||||
String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
|
||||
return 'VideoPlayerSettingsModel(screenBrightness: $screenBrightness, videoFit: $videoFit, fillScreen: $fillScreen, hardwareAccel: $hardwareAccel, useLibass: $useLibass, bufferSize: $bufferSize, playerOptions: $playerOptions, internalVolume: $internalVolume, allowedOrientations: $allowedOrientations, nextVideoType: $nextVideoType, maxHomeBitrate: $maxHomeBitrate, maxInternetBitrate: $maxInternetBitrate, audioDevice: $audioDevice, segmentSkipSettings: $segmentSkipSettings, hotKeys: $hotKeys)';
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _VideoPlayerSettingsModel extends VideoPlayerSettingsModel {
|
||||
factory _VideoPlayerSettingsModel(
|
||||
{final double? screenBrightness,
|
||||
final BoxFit videoFit,
|
||||
final bool fillScreen,
|
||||
final bool hardwareAccel,
|
||||
final bool useLibass,
|
||||
final int bufferSize,
|
||||
final PlayerOptions? playerOptions,
|
||||
final double internalVolume,
|
||||
final Set<DeviceOrientation>? allowedOrientations,
|
||||
final AutoNextType nextVideoType,
|
||||
final Bitrate maxHomeBitrate,
|
||||
final Bitrate maxInternetBitrate,
|
||||
final String? audioDevice,
|
||||
final Map<MediaSegmentType, SegmentSkip> segmentSkipSettings,
|
||||
final Map<VideoHotKeys, KeyCombination> hotKeys}) =
|
||||
_$VideoPlayerSettingsModelImpl;
|
||||
_VideoPlayerSettingsModel._() : super._();
|
||||
/// @nodoc
|
||||
abstract mixin class _$VideoPlayerSettingsModelCopyWith<$Res>
|
||||
implements $VideoPlayerSettingsModelCopyWith<$Res> {
|
||||
factory _$VideoPlayerSettingsModelCopyWith(_VideoPlayerSettingsModel value,
|
||||
$Res Function(_VideoPlayerSettingsModel) _then) =
|
||||
__$VideoPlayerSettingsModelCopyWithImpl;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{double? screenBrightness,
|
||||
BoxFit videoFit,
|
||||
bool fillScreen,
|
||||
bool hardwareAccel,
|
||||
bool useLibass,
|
||||
int bufferSize,
|
||||
PlayerOptions? playerOptions,
|
||||
double internalVolume,
|
||||
Set<DeviceOrientation>? allowedOrientations,
|
||||
AutoNextType nextVideoType,
|
||||
Bitrate maxHomeBitrate,
|
||||
Bitrate maxInternetBitrate,
|
||||
String? audioDevice,
|
||||
Map<MediaSegmentType, SegmentSkip> segmentSkipSettings,
|
||||
Map<VideoHotKeys, KeyCombination> hotKeys});
|
||||
}
|
||||
|
||||
factory _VideoPlayerSettingsModel.fromJson(Map<String, dynamic> json) =
|
||||
_$VideoPlayerSettingsModelImpl.fromJson;
|
||||
/// @nodoc
|
||||
class __$VideoPlayerSettingsModelCopyWithImpl<$Res>
|
||||
implements _$VideoPlayerSettingsModelCopyWith<$Res> {
|
||||
__$VideoPlayerSettingsModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
@override
|
||||
double? get screenBrightness;
|
||||
@override
|
||||
BoxFit get videoFit;
|
||||
@override
|
||||
bool get fillScreen;
|
||||
@override
|
||||
bool get hardwareAccel;
|
||||
@override
|
||||
bool get useLibass;
|
||||
@override
|
||||
int get bufferSize;
|
||||
@override
|
||||
PlayerOptions? get playerOptions;
|
||||
@override
|
||||
double get internalVolume;
|
||||
@override
|
||||
Set<DeviceOrientation>? get allowedOrientations;
|
||||
@override
|
||||
AutoNextType get nextVideoType;
|
||||
@override
|
||||
Bitrate get maxHomeBitrate;
|
||||
@override
|
||||
Bitrate get maxInternetBitrate;
|
||||
@override
|
||||
String? get audioDevice;
|
||||
@override
|
||||
Map<MediaSegmentType, SegmentSkip> get segmentSkipSettings;
|
||||
@override
|
||||
Map<VideoHotKeys, KeyCombination> get hotKeys;
|
||||
final _VideoPlayerSettingsModel _self;
|
||||
final $Res Function(_VideoPlayerSettingsModel) _then;
|
||||
|
||||
/// Create a copy of VideoPlayerSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$VideoPlayerSettingsModelImplCopyWith<_$VideoPlayerSettingsModelImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
@pragma('vm:prefer-inline')
|
||||
$Res call({
|
||||
Object? screenBrightness = freezed,
|
||||
Object? videoFit = null,
|
||||
Object? fillScreen = null,
|
||||
Object? hardwareAccel = null,
|
||||
Object? useLibass = null,
|
||||
Object? bufferSize = null,
|
||||
Object? playerOptions = freezed,
|
||||
Object? internalVolume = null,
|
||||
Object? allowedOrientations = freezed,
|
||||
Object? nextVideoType = null,
|
||||
Object? maxHomeBitrate = null,
|
||||
Object? maxInternetBitrate = null,
|
||||
Object? audioDevice = freezed,
|
||||
Object? segmentSkipSettings = null,
|
||||
Object? hotKeys = null,
|
||||
}) {
|
||||
return _then(_VideoPlayerSettingsModel(
|
||||
screenBrightness: freezed == screenBrightness
|
||||
? _self.screenBrightness
|
||||
: screenBrightness // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
videoFit: null == videoFit
|
||||
? _self.videoFit
|
||||
: videoFit // ignore: cast_nullable_to_non_nullable
|
||||
as BoxFit,
|
||||
fillScreen: null == fillScreen
|
||||
? _self.fillScreen
|
||||
: fillScreen // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
hardwareAccel: null == hardwareAccel
|
||||
? _self.hardwareAccel
|
||||
: hardwareAccel // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
useLibass: null == useLibass
|
||||
? _self.useLibass
|
||||
: useLibass // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
bufferSize: null == bufferSize
|
||||
? _self.bufferSize
|
||||
: bufferSize // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
playerOptions: freezed == playerOptions
|
||||
? _self.playerOptions
|
||||
: playerOptions // ignore: cast_nullable_to_non_nullable
|
||||
as PlayerOptions?,
|
||||
internalVolume: null == internalVolume
|
||||
? _self.internalVolume
|
||||
: internalVolume // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
allowedOrientations: freezed == allowedOrientations
|
||||
? _self._allowedOrientations
|
||||
: allowedOrientations // ignore: cast_nullable_to_non_nullable
|
||||
as Set<DeviceOrientation>?,
|
||||
nextVideoType: null == nextVideoType
|
||||
? _self.nextVideoType
|
||||
: nextVideoType // ignore: cast_nullable_to_non_nullable
|
||||
as AutoNextType,
|
||||
maxHomeBitrate: null == maxHomeBitrate
|
||||
? _self.maxHomeBitrate
|
||||
: maxHomeBitrate // ignore: cast_nullable_to_non_nullable
|
||||
as Bitrate,
|
||||
maxInternetBitrate: null == maxInternetBitrate
|
||||
? _self.maxInternetBitrate
|
||||
: maxInternetBitrate // ignore: cast_nullable_to_non_nullable
|
||||
as Bitrate,
|
||||
audioDevice: freezed == audioDevice
|
||||
? _self.audioDevice
|
||||
: audioDevice // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
segmentSkipSettings: null == segmentSkipSettings
|
||||
? _self._segmentSkipSettings
|
||||
: segmentSkipSettings // ignore: cast_nullable_to_non_nullable
|
||||
as Map<MediaSegmentType, SegmentSkip>,
|
||||
hotKeys: null == hotKeys
|
||||
? _self._hotKeys
|
||||
: hotKeys // ignore: cast_nullable_to_non_nullable
|
||||
as Map<VideoHotKeys, KeyCombination>,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
// dart format on
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ part of 'video_player_settings.dart';
|
|||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$VideoPlayerSettingsModelImpl _$$VideoPlayerSettingsModelImplFromJson(
|
||||
_VideoPlayerSettingsModel _$VideoPlayerSettingsModelFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$VideoPlayerSettingsModelImpl(
|
||||
_VideoPlayerSettingsModel(
|
||||
screenBrightness: (json['screenBrightness'] as num?)?.toDouble(),
|
||||
videoFit: $enumDecodeNullable(_$BoxFitEnumMap, json['videoFit']) ??
|
||||
BoxFit.contain,
|
||||
|
|
@ -45,8 +45,8 @@ _$VideoPlayerSettingsModelImpl _$$VideoPlayerSettingsModelImplFromJson(
|
|||
const {},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$VideoPlayerSettingsModelImplToJson(
|
||||
_$VideoPlayerSettingsModelImpl instance) =>
|
||||
Map<String, dynamic> _$VideoPlayerSettingsModelToJson(
|
||||
_VideoPlayerSettingsModel instance) =>
|
||||
<String, dynamic>{
|
||||
'screenBrightness': instance.screenBrightness,
|
||||
'videoFit': _$BoxFitEnumMap[instance.videoFit]!,
|
||||
|
|
|
|||
|
|
@ -1,61 +0,0 @@
|
|||
import 'dart:convert';
|
||||
|
||||
import 'package:isar/isar.dart';
|
||||
|
||||
import 'package:fladder/models/syncing/sync_item.dart';
|
||||
|
||||
part 'i_synced_item.g.dart';
|
||||
|
||||
@collection
|
||||
class ISyncedItem {
|
||||
String? userId;
|
||||
String id;
|
||||
bool syncing;
|
||||
String? sortName;
|
||||
@Index()
|
||||
String? parentId;
|
||||
String? path;
|
||||
int? fileSize;
|
||||
String? videoFileName;
|
||||
String? trickPlayModel;
|
||||
String? mediaSegments;
|
||||
String? images;
|
||||
List<String>? chapters;
|
||||
List<String>? subtitles;
|
||||
String? userData;
|
||||
ISyncedItem({
|
||||
this.userId,
|
||||
required this.id,
|
||||
required this.syncing,
|
||||
this.sortName,
|
||||
this.parentId,
|
||||
this.path,
|
||||
this.fileSize,
|
||||
this.videoFileName,
|
||||
this.trickPlayModel,
|
||||
this.mediaSegments,
|
||||
this.images,
|
||||
this.chapters,
|
||||
this.subtitles,
|
||||
this.userData,
|
||||
});
|
||||
|
||||
factory ISyncedItem.fromSynced(SyncedItem syncedItem, String? path) {
|
||||
return ISyncedItem(
|
||||
id: syncedItem.id,
|
||||
parentId: syncedItem.parentId,
|
||||
syncing: syncedItem.syncing,
|
||||
userId: syncedItem.userId,
|
||||
path: syncedItem.path?.replaceAll(path ?? "", '').substring(1),
|
||||
fileSize: syncedItem.fileSize,
|
||||
sortName: syncedItem.sortName,
|
||||
videoFileName: syncedItem.videoFileName,
|
||||
trickPlayModel: syncedItem.fTrickPlayModel != null ? jsonEncode(syncedItem.fTrickPlayModel?.toJson()) : null,
|
||||
mediaSegments: syncedItem.mediaSegments != null ? jsonEncode(syncedItem.mediaSegments?.toJson()) : null,
|
||||
images: syncedItem.fImages != null ? jsonEncode(syncedItem.fImages?.toJson()) : null,
|
||||
chapters: syncedItem.fChapters.map((e) => jsonEncode(e.toJson())).toList(),
|
||||
subtitles: syncedItem.subtitles.map((e) => jsonEncode(e.toJson())).toList(),
|
||||
userData: syncedItem.userData != null ? jsonEncode(syncedItem.userData?.toJson()) : null,
|
||||
);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -17,13 +17,12 @@ import 'package:fladder/models/items/item_shared_models.dart';
|
|||
import 'package:fladder/models/items/media_segments_model.dart';
|
||||
import 'package:fladder/models/items/media_streams_model.dart';
|
||||
import 'package:fladder/models/items/trick_play_model.dart';
|
||||
import 'package:fladder/models/syncing/i_synced_item.dart';
|
||||
import 'package:fladder/util/localization_helper.dart';
|
||||
|
||||
part 'sync_item.freezed.dart';
|
||||
|
||||
@Freezed(copyWith: true)
|
||||
class SyncedItem with _$SyncedItem {
|
||||
abstract class SyncedItem with _$SyncedItem {
|
||||
const SyncedItem._();
|
||||
|
||||
factory SyncedItem({
|
||||
|
|
@ -126,39 +125,6 @@ class SyncedItem with _$SyncedItem {
|
|||
userData: userData,
|
||||
);
|
||||
}
|
||||
|
||||
factory SyncedItem.fromIsar(ISyncedItem isarSyncedItem, String savePath) {
|
||||
return SyncedItem(
|
||||
id: isarSyncedItem.id,
|
||||
parentId: isarSyncedItem.parentId,
|
||||
userId: isarSyncedItem.userId ?? "",
|
||||
sortName: isarSyncedItem.sortName,
|
||||
syncing: isarSyncedItem.syncing,
|
||||
path: joinAll([savePath, isarSyncedItem.path ?? ""]),
|
||||
fileSize: isarSyncedItem.fileSize,
|
||||
videoFileName: isarSyncedItem.videoFileName,
|
||||
mediaSegments: isarSyncedItem.mediaSegments != null
|
||||
? MediaSegmentsModel.fromJson(jsonDecode(isarSyncedItem.mediaSegments!))
|
||||
: null,
|
||||
fTrickPlayModel: isarSyncedItem.trickPlayModel != null
|
||||
? TrickPlayModel.fromJson(jsonDecode(isarSyncedItem.trickPlayModel!))
|
||||
: null,
|
||||
fImages: isarSyncedItem.images != null ? ImagesData.fromJson(jsonDecode(isarSyncedItem.images!)) : null,
|
||||
fChapters: isarSyncedItem.chapters
|
||||
?.map(
|
||||
(e) => Chapter.fromJson(jsonDecode(e)),
|
||||
)
|
||||
.toList() ??
|
||||
[],
|
||||
subtitles: isarSyncedItem.subtitles
|
||||
?.map(
|
||||
(e) => SubStreamModel.fromJson(jsonDecode(e)),
|
||||
)
|
||||
.toList() ??
|
||||
[],
|
||||
userData: isarSyncedItem.userData != null ? UserData.fromJson(jsonDecode(isarSyncedItem.userData!)) : null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension StatusExtension on TaskStatus {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint
|
||||
// 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
|
||||
|
||||
|
|
@ -9,46 +9,49 @@ part of 'sync_item.dart';
|
|||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$SyncedItem {
|
||||
String get id => throw _privateConstructorUsedError;
|
||||
bool get syncing => throw _privateConstructorUsedError;
|
||||
String? get parentId => throw _privateConstructorUsedError;
|
||||
String get userId => throw _privateConstructorUsedError;
|
||||
String? get path => throw _privateConstructorUsedError;
|
||||
bool get markedForDelete => throw _privateConstructorUsedError;
|
||||
String? get sortName => throw _privateConstructorUsedError;
|
||||
int? get fileSize => throw _privateConstructorUsedError;
|
||||
String? get videoFileName => throw _privateConstructorUsedError;
|
||||
MediaSegmentsModel? get mediaSegments => throw _privateConstructorUsedError;
|
||||
TrickPlayModel? get fTrickPlayModel => throw _privateConstructorUsedError;
|
||||
ImagesData? get fImages => throw _privateConstructorUsedError;
|
||||
List<Chapter> get fChapters => throw _privateConstructorUsedError;
|
||||
List<SubStreamModel> get subtitles => throw _privateConstructorUsedError;
|
||||
bool get unSyncedData => throw _privateConstructorUsedError;
|
||||
String get id;
|
||||
bool get syncing;
|
||||
String? get parentId;
|
||||
String get userId;
|
||||
String? get path;
|
||||
bool get markedForDelete;
|
||||
String? get sortName;
|
||||
int? get fileSize;
|
||||
String? get videoFileName;
|
||||
MediaSegmentsModel? get mediaSegments;
|
||||
TrickPlayModel? get fTrickPlayModel;
|
||||
ImagesData? get fImages;
|
||||
List<Chapter> get fChapters;
|
||||
List<SubStreamModel> get subtitles;
|
||||
bool get unSyncedData;
|
||||
@UserDataJsonSerializer()
|
||||
UserData? get userData =>
|
||||
throw _privateConstructorUsedError; // ignore: invalid_annotation_target
|
||||
UserData? get userData; // ignore: invalid_annotation_target
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
ItemBaseModel? get itemModel => throw _privateConstructorUsedError;
|
||||
ItemBaseModel? get itemModel;
|
||||
|
||||
/// Create a copy of SyncedItem
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$SyncedItemCopyWith<SyncedItem> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
_$SyncedItemCopyWithImpl<SyncedItem>(this as SyncedItem, _$identity);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SyncedItem(id: $id, syncing: $syncing, parentId: $parentId, userId: $userId, path: $path, markedForDelete: $markedForDelete, sortName: $sortName, fileSize: $fileSize, videoFileName: $videoFileName, mediaSegments: $mediaSegments, fTrickPlayModel: $fTrickPlayModel, fImages: $fImages, fChapters: $fChapters, subtitles: $subtitles, unSyncedData: $unSyncedData, userData: $userData, itemModel: $itemModel)';
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $SyncedItemCopyWith<$Res> {
|
||||
abstract mixin class $SyncedItemCopyWith<$Res> {
|
||||
factory $SyncedItemCopyWith(
|
||||
SyncedItem value, $Res Function(SyncedItem) then) =
|
||||
_$SyncedItemCopyWithImpl<$Res, SyncedItem>;
|
||||
SyncedItem value, $Res Function(SyncedItem) _then) =
|
||||
_$SyncedItemCopyWithImpl;
|
||||
@useResult
|
||||
$Res call(
|
||||
{String id,
|
||||
|
|
@ -74,14 +77,11 @@ abstract class $SyncedItemCopyWith<$Res> {
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$SyncedItemCopyWithImpl<$Res, $Val extends SyncedItem>
|
||||
implements $SyncedItemCopyWith<$Res> {
|
||||
_$SyncedItemCopyWithImpl(this._value, this._then);
|
||||
class _$SyncedItemCopyWithImpl<$Res> implements $SyncedItemCopyWith<$Res> {
|
||||
_$SyncedItemCopyWithImpl(this._self, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
final SyncedItem _self;
|
||||
final $Res Function(SyncedItem) _then;
|
||||
|
||||
/// Create a copy of SyncedItem
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
|
|
@ -106,76 +106,76 @@ class _$SyncedItemCopyWithImpl<$Res, $Val extends SyncedItem>
|
|||
Object? userData = freezed,
|
||||
Object? itemModel = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
return _then(_self.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
? _self.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
syncing: null == syncing
|
||||
? _value.syncing
|
||||
? _self.syncing
|
||||
: syncing // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
parentId: freezed == parentId
|
||||
? _value.parentId
|
||||
? _self.parentId
|
||||
: parentId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
userId: null == userId
|
||||
? _value.userId
|
||||
? _self.userId
|
||||
: userId // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
path: freezed == path
|
||||
? _value.path
|
||||
? _self.path
|
||||
: path // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
markedForDelete: null == markedForDelete
|
||||
? _value.markedForDelete
|
||||
? _self.markedForDelete
|
||||
: markedForDelete // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
sortName: freezed == sortName
|
||||
? _value.sortName
|
||||
? _self.sortName
|
||||
: sortName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
fileSize: freezed == fileSize
|
||||
? _value.fileSize
|
||||
? _self.fileSize
|
||||
: fileSize // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
videoFileName: freezed == videoFileName
|
||||
? _value.videoFileName
|
||||
? _self.videoFileName
|
||||
: videoFileName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
mediaSegments: freezed == mediaSegments
|
||||
? _value.mediaSegments
|
||||
? _self.mediaSegments
|
||||
: mediaSegments // ignore: cast_nullable_to_non_nullable
|
||||
as MediaSegmentsModel?,
|
||||
fTrickPlayModel: freezed == fTrickPlayModel
|
||||
? _value.fTrickPlayModel
|
||||
? _self.fTrickPlayModel
|
||||
: fTrickPlayModel // ignore: cast_nullable_to_non_nullable
|
||||
as TrickPlayModel?,
|
||||
fImages: freezed == fImages
|
||||
? _value.fImages
|
||||
? _self.fImages
|
||||
: fImages // ignore: cast_nullable_to_non_nullable
|
||||
as ImagesData?,
|
||||
fChapters: null == fChapters
|
||||
? _value.fChapters
|
||||
? _self.fChapters
|
||||
: fChapters // ignore: cast_nullable_to_non_nullable
|
||||
as List<Chapter>,
|
||||
subtitles: null == subtitles
|
||||
? _value.subtitles
|
||||
? _self.subtitles
|
||||
: subtitles // ignore: cast_nullable_to_non_nullable
|
||||
as List<SubStreamModel>,
|
||||
unSyncedData: null == unSyncedData
|
||||
? _value.unSyncedData
|
||||
? _self.unSyncedData
|
||||
: unSyncedData // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
userData: freezed == userData
|
||||
? _value.userData
|
||||
? _self.userData
|
||||
: userData // ignore: cast_nullable_to_non_nullable
|
||||
as UserData?,
|
||||
itemModel: freezed == itemModel
|
||||
? _value.itemModel
|
||||
? _self.itemModel
|
||||
: itemModel // ignore: cast_nullable_to_non_nullable
|
||||
as ItemBaseModel?,
|
||||
) as $Val);
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of SyncedItem
|
||||
|
|
@ -183,156 +183,285 @@ class _$SyncedItemCopyWithImpl<$Res, $Val extends SyncedItem>
|
|||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$TrickPlayModelCopyWith<$Res>? get fTrickPlayModel {
|
||||
if (_value.fTrickPlayModel == null) {
|
||||
if (_self.fTrickPlayModel == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $TrickPlayModelCopyWith<$Res>(_value.fTrickPlayModel!, (value) {
|
||||
return _then(_value.copyWith(fTrickPlayModel: value) as $Val);
|
||||
return $TrickPlayModelCopyWith<$Res>(_self.fTrickPlayModel!, (value) {
|
||||
return _then(_self.copyWith(fTrickPlayModel: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$SyncItemImplCopyWith<$Res>
|
||||
implements $SyncedItemCopyWith<$Res> {
|
||||
factory _$$SyncItemImplCopyWith(
|
||||
_$SyncItemImpl value, $Res Function(_$SyncItemImpl) then) =
|
||||
__$$SyncItemImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String id,
|
||||
bool syncing,
|
||||
String? parentId,
|
||||
String userId,
|
||||
String? path,
|
||||
bool markedForDelete,
|
||||
String? sortName,
|
||||
int? fileSize,
|
||||
String? videoFileName,
|
||||
MediaSegmentsModel? mediaSegments,
|
||||
TrickPlayModel? fTrickPlayModel,
|
||||
ImagesData? fImages,
|
||||
List<Chapter> fChapters,
|
||||
List<SubStreamModel> subtitles,
|
||||
bool unSyncedData,
|
||||
@UserDataJsonSerializer() UserData? userData,
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
ItemBaseModel? itemModel});
|
||||
/// Adds pattern-matching-related methods to [SyncedItem].
|
||||
extension SyncedItemPatterns on SyncedItem {
|
||||
/// 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();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@override
|
||||
$TrickPlayModelCopyWith<$Res>? get fTrickPlayModel;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$SyncItemImplCopyWithImpl<$Res>
|
||||
extends _$SyncedItemCopyWithImpl<$Res, _$SyncItemImpl>
|
||||
implements _$$SyncItemImplCopyWith<$Res> {
|
||||
__$$SyncItemImplCopyWithImpl(
|
||||
_$SyncItemImpl _value, $Res Function(_$SyncItemImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of SyncedItem
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? syncing = null,
|
||||
Object? parentId = freezed,
|
||||
Object? userId = null,
|
||||
Object? path = freezed,
|
||||
Object? markedForDelete = null,
|
||||
Object? sortName = freezed,
|
||||
Object? fileSize = freezed,
|
||||
Object? videoFileName = freezed,
|
||||
Object? mediaSegments = freezed,
|
||||
Object? fTrickPlayModel = freezed,
|
||||
Object? fImages = freezed,
|
||||
Object? fChapters = null,
|
||||
Object? subtitles = null,
|
||||
Object? unSyncedData = null,
|
||||
Object? userData = freezed,
|
||||
Object? itemModel = freezed,
|
||||
@optionalTypeArgs
|
||||
TResult maybeMap<TResult extends Object?>(
|
||||
TResult Function(_SyncItem value)? $default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
return _then(_$SyncItemImpl(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
syncing: null == syncing
|
||||
? _value.syncing
|
||||
: syncing // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
parentId: freezed == parentId
|
||||
? _value.parentId
|
||||
: parentId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
userId: null == userId
|
||||
? _value.userId
|
||||
: userId // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
path: freezed == path
|
||||
? _value.path
|
||||
: path // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
markedForDelete: null == markedForDelete
|
||||
? _value.markedForDelete
|
||||
: markedForDelete // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
sortName: freezed == sortName
|
||||
? _value.sortName
|
||||
: sortName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
fileSize: freezed == fileSize
|
||||
? _value.fileSize
|
||||
: fileSize // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
videoFileName: freezed == videoFileName
|
||||
? _value.videoFileName
|
||||
: videoFileName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
mediaSegments: freezed == mediaSegments
|
||||
? _value.mediaSegments
|
||||
: mediaSegments // ignore: cast_nullable_to_non_nullable
|
||||
as MediaSegmentsModel?,
|
||||
fTrickPlayModel: freezed == fTrickPlayModel
|
||||
? _value.fTrickPlayModel
|
||||
: fTrickPlayModel // ignore: cast_nullable_to_non_nullable
|
||||
as TrickPlayModel?,
|
||||
fImages: freezed == fImages
|
||||
? _value.fImages
|
||||
: fImages // ignore: cast_nullable_to_non_nullable
|
||||
as ImagesData?,
|
||||
fChapters: null == fChapters
|
||||
? _value._fChapters
|
||||
: fChapters // ignore: cast_nullable_to_non_nullable
|
||||
as List<Chapter>,
|
||||
subtitles: null == subtitles
|
||||
? _value._subtitles
|
||||
: subtitles // ignore: cast_nullable_to_non_nullable
|
||||
as List<SubStreamModel>,
|
||||
unSyncedData: null == unSyncedData
|
||||
? _value.unSyncedData
|
||||
: unSyncedData // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
userData: freezed == userData
|
||||
? _value.userData
|
||||
: userData // ignore: cast_nullable_to_non_nullable
|
||||
as UserData?,
|
||||
itemModel: freezed == itemModel
|
||||
? _value.itemModel
|
||||
: itemModel // ignore: cast_nullable_to_non_nullable
|
||||
as ItemBaseModel?,
|
||||
));
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SyncItem() 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(_SyncItem value) $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SyncItem():
|
||||
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(_SyncItem value)? $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SyncItem() 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,
|
||||
bool syncing,
|
||||
String? parentId,
|
||||
String userId,
|
||||
String? path,
|
||||
bool markedForDelete,
|
||||
String? sortName,
|
||||
int? fileSize,
|
||||
String? videoFileName,
|
||||
MediaSegmentsModel? mediaSegments,
|
||||
TrickPlayModel? fTrickPlayModel,
|
||||
ImagesData? fImages,
|
||||
List<Chapter> fChapters,
|
||||
List<SubStreamModel> subtitles,
|
||||
bool unSyncedData,
|
||||
@UserDataJsonSerializer() UserData? userData,
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
ItemBaseModel? itemModel)?
|
||||
$default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SyncItem() when $default != null:
|
||||
return $default(
|
||||
_that.id,
|
||||
_that.syncing,
|
||||
_that.parentId,
|
||||
_that.userId,
|
||||
_that.path,
|
||||
_that.markedForDelete,
|
||||
_that.sortName,
|
||||
_that.fileSize,
|
||||
_that.videoFileName,
|
||||
_that.mediaSegments,
|
||||
_that.fTrickPlayModel,
|
||||
_that.fImages,
|
||||
_that.fChapters,
|
||||
_that.subtitles,
|
||||
_that.unSyncedData,
|
||||
_that.userData,
|
||||
_that.itemModel);
|
||||
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,
|
||||
bool syncing,
|
||||
String? parentId,
|
||||
String userId,
|
||||
String? path,
|
||||
bool markedForDelete,
|
||||
String? sortName,
|
||||
int? fileSize,
|
||||
String? videoFileName,
|
||||
MediaSegmentsModel? mediaSegments,
|
||||
TrickPlayModel? fTrickPlayModel,
|
||||
ImagesData? fImages,
|
||||
List<Chapter> fChapters,
|
||||
List<SubStreamModel> subtitles,
|
||||
bool unSyncedData,
|
||||
@UserDataJsonSerializer() UserData? userData,
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
ItemBaseModel? itemModel)
|
||||
$default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SyncItem():
|
||||
return $default(
|
||||
_that.id,
|
||||
_that.syncing,
|
||||
_that.parentId,
|
||||
_that.userId,
|
||||
_that.path,
|
||||
_that.markedForDelete,
|
||||
_that.sortName,
|
||||
_that.fileSize,
|
||||
_that.videoFileName,
|
||||
_that.mediaSegments,
|
||||
_that.fTrickPlayModel,
|
||||
_that.fImages,
|
||||
_that.fChapters,
|
||||
_that.subtitles,
|
||||
_that.unSyncedData,
|
||||
_that.userData,
|
||||
_that.itemModel);
|
||||
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,
|
||||
bool syncing,
|
||||
String? parentId,
|
||||
String userId,
|
||||
String? path,
|
||||
bool markedForDelete,
|
||||
String? sortName,
|
||||
int? fileSize,
|
||||
String? videoFileName,
|
||||
MediaSegmentsModel? mediaSegments,
|
||||
TrickPlayModel? fTrickPlayModel,
|
||||
ImagesData? fImages,
|
||||
List<Chapter> fChapters,
|
||||
List<SubStreamModel> subtitles,
|
||||
bool unSyncedData,
|
||||
@UserDataJsonSerializer() UserData? userData,
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
ItemBaseModel? itemModel)?
|
||||
$default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SyncItem() when $default != null:
|
||||
return $default(
|
||||
_that.id,
|
||||
_that.syncing,
|
||||
_that.parentId,
|
||||
_that.userId,
|
||||
_that.path,
|
||||
_that.markedForDelete,
|
||||
_that.sortName,
|
||||
_that.fileSize,
|
||||
_that.videoFileName,
|
||||
_that.mediaSegments,
|
||||
_that.fTrickPlayModel,
|
||||
_that.fImages,
|
||||
_that.fChapters,
|
||||
_that.subtitles,
|
||||
_that.unSyncedData,
|
||||
_that.userData,
|
||||
_that.itemModel);
|
||||
case _:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$SyncItemImpl extends _SyncItem {
|
||||
_$SyncItemImpl(
|
||||
class _SyncItem extends SyncedItem {
|
||||
_SyncItem(
|
||||
{required this.id,
|
||||
this.syncing = false,
|
||||
this.parentId,
|
||||
|
|
@ -409,83 +538,166 @@ class _$SyncItemImpl extends _SyncItem {
|
|||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
final ItemBaseModel? itemModel;
|
||||
|
||||
/// Create a copy of SyncedItem
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$SyncItemCopyWith<_SyncItem> get copyWith =>
|
||||
__$SyncItemCopyWithImpl<_SyncItem>(this, _$identity);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SyncedItem(id: $id, syncing: $syncing, parentId: $parentId, userId: $userId, path: $path, markedForDelete: $markedForDelete, sortName: $sortName, fileSize: $fileSize, videoFileName: $videoFileName, mediaSegments: $mediaSegments, fTrickPlayModel: $fTrickPlayModel, fImages: $fImages, fChapters: $fChapters, subtitles: $subtitles, unSyncedData: $unSyncedData, userData: $userData, itemModel: $itemModel)';
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$SyncItemCopyWith<$Res>
|
||||
implements $SyncedItemCopyWith<$Res> {
|
||||
factory _$SyncItemCopyWith(_SyncItem value, $Res Function(_SyncItem) _then) =
|
||||
__$SyncItemCopyWithImpl;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{String id,
|
||||
bool syncing,
|
||||
String? parentId,
|
||||
String userId,
|
||||
String? path,
|
||||
bool markedForDelete,
|
||||
String? sortName,
|
||||
int? fileSize,
|
||||
String? videoFileName,
|
||||
MediaSegmentsModel? mediaSegments,
|
||||
TrickPlayModel? fTrickPlayModel,
|
||||
ImagesData? fImages,
|
||||
List<Chapter> fChapters,
|
||||
List<SubStreamModel> subtitles,
|
||||
bool unSyncedData,
|
||||
@UserDataJsonSerializer() UserData? userData,
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
ItemBaseModel? itemModel});
|
||||
|
||||
@override
|
||||
$TrickPlayModelCopyWith<$Res>? get fTrickPlayModel;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$SyncItemCopyWithImpl<$Res> implements _$SyncItemCopyWith<$Res> {
|
||||
__$SyncItemCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _SyncItem _self;
|
||||
final $Res Function(_SyncItem) _then;
|
||||
|
||||
/// Create a copy of SyncedItem
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$SyncItemImplCopyWith<_$SyncItemImpl> get copyWith =>
|
||||
__$$SyncItemImplCopyWithImpl<_$SyncItemImpl>(this, _$identity);
|
||||
}
|
||||
|
||||
abstract class _SyncItem extends SyncedItem {
|
||||
factory _SyncItem(
|
||||
{required final String id,
|
||||
final bool syncing,
|
||||
final String? parentId,
|
||||
required final String userId,
|
||||
final String? path,
|
||||
final bool markedForDelete,
|
||||
final String? sortName,
|
||||
final int? fileSize,
|
||||
final String? videoFileName,
|
||||
final MediaSegmentsModel? mediaSegments,
|
||||
final TrickPlayModel? fTrickPlayModel,
|
||||
final ImagesData? fImages,
|
||||
final List<Chapter> fChapters,
|
||||
final List<SubStreamModel> subtitles,
|
||||
final bool unSyncedData,
|
||||
@UserDataJsonSerializer() final UserData? userData,
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
final ItemBaseModel? itemModel}) = _$SyncItemImpl;
|
||||
_SyncItem._() : super._();
|
||||
|
||||
@override
|
||||
String get id;
|
||||
@override
|
||||
bool get syncing;
|
||||
@override
|
||||
String? get parentId;
|
||||
@override
|
||||
String get userId;
|
||||
@override
|
||||
String? get path;
|
||||
@override
|
||||
bool get markedForDelete;
|
||||
@override
|
||||
String? get sortName;
|
||||
@override
|
||||
int? get fileSize;
|
||||
@override
|
||||
String? get videoFileName;
|
||||
@override
|
||||
MediaSegmentsModel? get mediaSegments;
|
||||
@override
|
||||
TrickPlayModel? get fTrickPlayModel;
|
||||
@override
|
||||
ImagesData? get fImages;
|
||||
@override
|
||||
List<Chapter> get fChapters;
|
||||
@override
|
||||
List<SubStreamModel> get subtitles;
|
||||
@override
|
||||
bool get unSyncedData;
|
||||
@override
|
||||
@UserDataJsonSerializer()
|
||||
UserData? get userData; // ignore: invalid_annotation_target
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
ItemBaseModel? get itemModel;
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? syncing = null,
|
||||
Object? parentId = freezed,
|
||||
Object? userId = null,
|
||||
Object? path = freezed,
|
||||
Object? markedForDelete = null,
|
||||
Object? sortName = freezed,
|
||||
Object? fileSize = freezed,
|
||||
Object? videoFileName = freezed,
|
||||
Object? mediaSegments = freezed,
|
||||
Object? fTrickPlayModel = freezed,
|
||||
Object? fImages = freezed,
|
||||
Object? fChapters = null,
|
||||
Object? subtitles = null,
|
||||
Object? unSyncedData = null,
|
||||
Object? userData = freezed,
|
||||
Object? itemModel = freezed,
|
||||
}) {
|
||||
return _then(_SyncItem(
|
||||
id: null == id
|
||||
? _self.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
syncing: null == syncing
|
||||
? _self.syncing
|
||||
: syncing // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
parentId: freezed == parentId
|
||||
? _self.parentId
|
||||
: parentId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
userId: null == userId
|
||||
? _self.userId
|
||||
: userId // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
path: freezed == path
|
||||
? _self.path
|
||||
: path // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
markedForDelete: null == markedForDelete
|
||||
? _self.markedForDelete
|
||||
: markedForDelete // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
sortName: freezed == sortName
|
||||
? _self.sortName
|
||||
: sortName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
fileSize: freezed == fileSize
|
||||
? _self.fileSize
|
||||
: fileSize // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
videoFileName: freezed == videoFileName
|
||||
? _self.videoFileName
|
||||
: videoFileName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
mediaSegments: freezed == mediaSegments
|
||||
? _self.mediaSegments
|
||||
: mediaSegments // ignore: cast_nullable_to_non_nullable
|
||||
as MediaSegmentsModel?,
|
||||
fTrickPlayModel: freezed == fTrickPlayModel
|
||||
? _self.fTrickPlayModel
|
||||
: fTrickPlayModel // ignore: cast_nullable_to_non_nullable
|
||||
as TrickPlayModel?,
|
||||
fImages: freezed == fImages
|
||||
? _self.fImages
|
||||
: fImages // ignore: cast_nullable_to_non_nullable
|
||||
as ImagesData?,
|
||||
fChapters: null == fChapters
|
||||
? _self._fChapters
|
||||
: fChapters // ignore: cast_nullable_to_non_nullable
|
||||
as List<Chapter>,
|
||||
subtitles: null == subtitles
|
||||
? _self._subtitles
|
||||
: subtitles // ignore: cast_nullable_to_non_nullable
|
||||
as List<SubStreamModel>,
|
||||
unSyncedData: null == unSyncedData
|
||||
? _self.unSyncedData
|
||||
: unSyncedData // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
userData: freezed == userData
|
||||
? _self.userData
|
||||
: userData // ignore: cast_nullable_to_non_nullable
|
||||
as UserData?,
|
||||
itemModel: freezed == itemModel
|
||||
? _self.itemModel
|
||||
: itemModel // ignore: cast_nullable_to_non_nullable
|
||||
as ItemBaseModel?,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of SyncedItem
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$SyncItemImplCopyWith<_$SyncItemImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
@pragma('vm:prefer-inline')
|
||||
$TrickPlayModelCopyWith<$Res>? get fTrickPlayModel {
|
||||
if (_self.fTrickPlayModel == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $TrickPlayModelCopyWith<$Res>(_self.fTrickPlayModel!, (value) {
|
||||
return _then(_self.copyWith(fTrickPlayModel: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// dart format on
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import 'package:fladder/models/syncing/sync_item.dart';
|
|||
part 'sync_settings_model.freezed.dart';
|
||||
|
||||
@Freezed(toJson: false, fromJson: false, copyWith: true)
|
||||
class SyncSettingsModel with _$SyncSettingsModel {
|
||||
abstract class SyncSettingsModel with _$SyncSettingsModel {
|
||||
const SyncSettingsModel._();
|
||||
|
||||
factory SyncSettingsModel({
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint
|
||||
// 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
|
||||
|
||||
|
|
@ -9,75 +9,43 @@ part of 'sync_settings_model.dart';
|
|||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$SyncSettingsModel {
|
||||
List<SyncedItem> get items => throw _privateConstructorUsedError;
|
||||
List<SyncedItem> get items;
|
||||
|
||||
/// Create a copy of SyncSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$SyncSettingsModelCopyWith<SyncSettingsModel> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $SyncSettingsModelCopyWith<$Res> {
|
||||
factory $SyncSettingsModelCopyWith(
|
||||
SyncSettingsModel value, $Res Function(SyncSettingsModel) then) =
|
||||
_$SyncSettingsModelCopyWithImpl<$Res, SyncSettingsModel>;
|
||||
@useResult
|
||||
$Res call({List<SyncedItem> items});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$SyncSettingsModelCopyWithImpl<$Res, $Val extends SyncSettingsModel>
|
||||
implements $SyncSettingsModelCopyWith<$Res> {
|
||||
_$SyncSettingsModelCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of SyncSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
$SyncSettingsModelCopyWith<SyncSettingsModel> get copyWith =>
|
||||
_$SyncSettingsModelCopyWithImpl<SyncSettingsModel>(
|
||||
this as SyncSettingsModel, _$identity);
|
||||
|
||||
@override
|
||||
$Res call({
|
||||
Object? items = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
items: null == items
|
||||
? _value.items
|
||||
: items // ignore: cast_nullable_to_non_nullable
|
||||
as List<SyncedItem>,
|
||||
) as $Val);
|
||||
String toString() {
|
||||
return 'SyncSettingsModel(items: $items)';
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$SyncSettignsModelImplCopyWith<$Res>
|
||||
implements $SyncSettingsModelCopyWith<$Res> {
|
||||
factory _$$SyncSettignsModelImplCopyWith(_$SyncSettignsModelImpl value,
|
||||
$Res Function(_$SyncSettignsModelImpl) then) =
|
||||
__$$SyncSettignsModelImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
abstract mixin class $SyncSettingsModelCopyWith<$Res> {
|
||||
factory $SyncSettingsModelCopyWith(
|
||||
SyncSettingsModel value, $Res Function(SyncSettingsModel) _then) =
|
||||
_$SyncSettingsModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({List<SyncedItem> items});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$SyncSettignsModelImplCopyWithImpl<$Res>
|
||||
extends _$SyncSettingsModelCopyWithImpl<$Res, _$SyncSettignsModelImpl>
|
||||
implements _$$SyncSettignsModelImplCopyWith<$Res> {
|
||||
__$$SyncSettignsModelImplCopyWithImpl(_$SyncSettignsModelImpl _value,
|
||||
$Res Function(_$SyncSettignsModelImpl) _then)
|
||||
: super(_value, _then);
|
||||
class _$SyncSettingsModelCopyWithImpl<$Res>
|
||||
implements $SyncSettingsModelCopyWith<$Res> {
|
||||
_$SyncSettingsModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final SyncSettingsModel _self;
|
||||
final $Res Function(SyncSettingsModel) _then;
|
||||
|
||||
/// Create a copy of SyncSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
|
|
@ -86,19 +54,176 @@ class __$$SyncSettignsModelImplCopyWithImpl<$Res>
|
|||
$Res call({
|
||||
Object? items = null,
|
||||
}) {
|
||||
return _then(_$SyncSettignsModelImpl(
|
||||
return _then(_self.copyWith(
|
||||
items: null == items
|
||||
? _value._items
|
||||
? _self.items
|
||||
: items // ignore: cast_nullable_to_non_nullable
|
||||
as List<SyncedItem>,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// Adds pattern-matching-related methods to [SyncSettingsModel].
|
||||
extension SyncSettingsModelPatterns on SyncSettingsModel {
|
||||
/// 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(_SyncSettignsModel value)? $default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SyncSettignsModel() 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(_SyncSettignsModel value) $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SyncSettignsModel():
|
||||
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(_SyncSettignsModel value)? $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SyncSettignsModel() 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<SyncedItem> items)? $default, {
|
||||
required TResult orElse(),
|
||||
}) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SyncSettignsModel() when $default != null:
|
||||
return $default(_that.items);
|
||||
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<SyncedItem> items) $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SyncSettignsModel():
|
||||
return $default(_that.items);
|
||||
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<SyncedItem> items)? $default,
|
||||
) {
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SyncSettignsModel() when $default != null:
|
||||
return $default(_that.items);
|
||||
case _:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$SyncSettignsModelImpl extends _SyncSettignsModel {
|
||||
_$SyncSettignsModelImpl({final List<SyncedItem> items = const []})
|
||||
class _SyncSettignsModel extends SyncSettingsModel {
|
||||
_SyncSettignsModel({final List<SyncedItem> items = const []})
|
||||
: _items = items,
|
||||
super._();
|
||||
|
||||
|
|
@ -111,33 +236,53 @@ class _$SyncSettignsModelImpl extends _SyncSettignsModel {
|
|||
return EqualUnmodifiableListView(_items);
|
||||
}
|
||||
|
||||
/// Create a copy of SyncSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$SyncSettignsModelCopyWith<_SyncSettignsModel> get copyWith =>
|
||||
__$SyncSettignsModelCopyWithImpl<_SyncSettignsModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SyncSettingsModel(items: $items)';
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$SyncSettignsModelCopyWith<$Res>
|
||||
implements $SyncSettingsModelCopyWith<$Res> {
|
||||
factory _$SyncSettignsModelCopyWith(
|
||||
_SyncSettignsModel value, $Res Function(_SyncSettignsModel) _then) =
|
||||
__$SyncSettignsModelCopyWithImpl;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({List<SyncedItem> items});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$SyncSettignsModelCopyWithImpl<$Res>
|
||||
implements _$SyncSettignsModelCopyWith<$Res> {
|
||||
__$SyncSettignsModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _SyncSettignsModel _self;
|
||||
final $Res Function(_SyncSettignsModel) _then;
|
||||
|
||||
/// Create a copy of SyncSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$SyncSettignsModelImplCopyWith<_$SyncSettignsModelImpl> get copyWith =>
|
||||
__$$SyncSettignsModelImplCopyWithImpl<_$SyncSettignsModelImpl>(
|
||||
this, _$identity);
|
||||
$Res call({
|
||||
Object? items = null,
|
||||
}) {
|
||||
return _then(_SyncSettignsModel(
|
||||
items: null == items
|
||||
? _self._items
|
||||
: items // ignore: cast_nullable_to_non_nullable
|
||||
as List<SyncedItem>,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
abstract class _SyncSettignsModel extends SyncSettingsModel {
|
||||
factory _SyncSettignsModel({final List<SyncedItem> items}) =
|
||||
_$SyncSettignsModelImpl;
|
||||
_SyncSettignsModel._() : super._();
|
||||
|
||||
@override
|
||||
List<SyncedItem> get items;
|
||||
|
||||
/// Create a copy of SyncSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$SyncSettignsModelImplCopyWith<_$SyncSettignsModelImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
// dart format on
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue