chore:cleanup-packages breaking: remove isar (#474)

Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
PartyDonut 2025-08-24 21:16:51 +02:00 committed by GitHub
parent ab6182f69d
commit 6357b9843c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
81 changed files with 31400 additions and 25673 deletions

View file

@ -2565,7 +2565,8 @@ enum AudioItemIdHls1PlaylistIdSegmentIdContainerGetSubtitleMethod {
final String? value;
const AudioItemIdHls1PlaylistIdSegmentIdContainerGetSubtitleMethod(
this.value);
this.value,
);
}
enum AudioItemIdHls1PlaylistIdSegmentIdContainerGetContext {
@ -2702,7 +2703,8 @@ enum VideosItemIdHls1PlaylistIdSegmentIdContainerGetSubtitleMethod {
final String? value;
const VideosItemIdHls1PlaylistIdSegmentIdContainerGetSubtitleMethod(
this.value);
this.value,
);
}
enum VideosItemIdHls1PlaylistIdSegmentIdContainerGetContext {
@ -3635,7 +3637,8 @@ enum ItemsItemIdImagesImageTypeImageIndexTagFormatMaxWidthMaxHeightPercentPlayed
final String? value;
const ItemsItemIdImagesImageTypeImageIndexTagFormatMaxWidthMaxHeightPercentPlayedUnplayedCountGetImageType(
this.value);
this.value,
);
}
enum ItemsItemIdImagesImageTypeImageIndexTagFormatMaxWidthMaxHeightPercentPlayedUnplayedCountGetFormat {
@ -3658,7 +3661,8 @@ enum ItemsItemIdImagesImageTypeImageIndexTagFormatMaxWidthMaxHeightPercentPlayed
final String? value;
const ItemsItemIdImagesImageTypeImageIndexTagFormatMaxWidthMaxHeightPercentPlayedUnplayedCountGetFormat(
this.value);
this.value,
);
}
enum ItemsItemIdImagesImageTypeImageIndexTagFormatMaxWidthMaxHeightPercentPlayedUnplayedCountHeadImageType {
@ -3695,7 +3699,8 @@ enum ItemsItemIdImagesImageTypeImageIndexTagFormatMaxWidthMaxHeightPercentPlayed
final String? value;
const ItemsItemIdImagesImageTypeImageIndexTagFormatMaxWidthMaxHeightPercentPlayedUnplayedCountHeadImageType(
this.value);
this.value,
);
}
enum ItemsItemIdImagesImageTypeImageIndexTagFormatMaxWidthMaxHeightPercentPlayedUnplayedCountHeadFormat {
@ -3718,7 +3723,8 @@ enum ItemsItemIdImagesImageTypeImageIndexTagFormatMaxWidthMaxHeightPercentPlayed
final String? value;
const ItemsItemIdImagesImageTypeImageIndexTagFormatMaxWidthMaxHeightPercentPlayedUnplayedCountHeadFormat(
this.value);
this.value,
);
}
enum ItemsItemIdImagesImageTypeImageIndexIndexPostImageType {

View file

@ -1,3 +1,4 @@
// dart format width=80
//Generated jellyfin api code
part of 'jellyfin_open_api.swagger.dart';

File diff suppressed because it is too large Load diff

View file

@ -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

View file

@ -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,

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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({

View file

@ -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

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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({

View file

@ -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

View file

@ -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,

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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,

View file

@ -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

View file

@ -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,

View file

@ -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,

View file

@ -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

View file

@ -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,

View file

@ -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);
}

View file

@ -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({

View file

@ -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

View file

@ -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

View file

@ -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,

View file

@ -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,

View file

@ -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

View file

@ -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(),

View file

@ -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({

View file

@ -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

View file

@ -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),

View file

@ -50,7 +50,7 @@ enum VideoHotKeys {
}
@Freezed(copyWith: true)
class VideoPlayerSettingsModel with _$VideoPlayerSettingsModel {
abstract class VideoPlayerSettingsModel with _$VideoPlayerSettingsModel {
const VideoPlayerSettingsModel._();
factory VideoPlayerSettingsModel({

View file

@ -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

View file

@ -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]!,

View file

@ -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

View file

@ -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 {

View file

@ -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

View file

@ -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({

View file

@ -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

View file

@ -46,7 +46,7 @@ enum LibraryViewType {
}
@Freezed(fromJson: false, toJson: false, copyWith: true)
class LibraryScreenModel with _$LibraryScreenModel {
abstract class LibraryScreenModel with _$LibraryScreenModel {
factory LibraryScreenModel({
@Default([]) List<ViewModel> views,
ViewModel? selectedViewModel,

View file

@ -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,37 @@ part of 'library_screen_provider.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 _$LibraryScreenModel {
List<ViewModel> get views => throw _privateConstructorUsedError;
ViewModel? get selectedViewModel => throw _privateConstructorUsedError;
Set<LibraryViewType> get viewType => throw _privateConstructorUsedError;
List<RecommendedModel> get recommendations =>
throw _privateConstructorUsedError;
List<RecommendedModel> get genres => throw _privateConstructorUsedError;
List<ItemBaseModel> get favourites => throw _privateConstructorUsedError;
List<ViewModel> get views;
ViewModel? get selectedViewModel;
Set<LibraryViewType> get viewType;
List<RecommendedModel> get recommendations;
List<RecommendedModel> get genres;
List<ItemBaseModel> get favourites;
/// Create a copy of LibraryScreenModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$LibraryScreenModelCopyWith<LibraryScreenModel> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $LibraryScreenModelCopyWith<$Res> {
factory $LibraryScreenModelCopyWith(
LibraryScreenModel value, $Res Function(LibraryScreenModel) then) =
_$LibraryScreenModelCopyWithImpl<$Res, LibraryScreenModel>;
@useResult
$Res call(
{List<ViewModel> views,
ViewModel? selectedViewModel,
Set<LibraryViewType> viewType,
List<RecommendedModel> recommendations,
List<RecommendedModel> genres,
List<ItemBaseModel> favourites});
}
/// @nodoc
class _$LibraryScreenModelCopyWithImpl<$Res, $Val extends LibraryScreenModel>
implements $LibraryScreenModelCopyWith<$Res> {
_$LibraryScreenModelCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of LibraryScreenModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
$LibraryScreenModelCopyWith<LibraryScreenModel> get copyWith =>
_$LibraryScreenModelCopyWithImpl<LibraryScreenModel>(
this as LibraryScreenModel, _$identity);
@override
$Res call({
Object? views = null,
Object? selectedViewModel = freezed,
Object? viewType = null,
Object? recommendations = null,
Object? genres = null,
Object? favourites = null,
}) {
return _then(_value.copyWith(
views: null == views
? _value.views
: views // ignore: cast_nullable_to_non_nullable
as List<ViewModel>,
selectedViewModel: freezed == selectedViewModel
? _value.selectedViewModel
: selectedViewModel // ignore: cast_nullable_to_non_nullable
as ViewModel?,
viewType: null == viewType
? _value.viewType
: viewType // ignore: cast_nullable_to_non_nullable
as Set<LibraryViewType>,
recommendations: null == recommendations
? _value.recommendations
: recommendations // ignore: cast_nullable_to_non_nullable
as List<RecommendedModel>,
genres: null == genres
? _value.genres
: genres // ignore: cast_nullable_to_non_nullable
as List<RecommendedModel>,
favourites: null == favourites
? _value.favourites
: favourites // ignore: cast_nullable_to_non_nullable
as List<ItemBaseModel>,
) as $Val);
String toString() {
return 'LibraryScreenModel(views: $views, selectedViewModel: $selectedViewModel, viewType: $viewType, recommendations: $recommendations, genres: $genres, favourites: $favourites)';
}
}
/// @nodoc
abstract class _$$LibraryScreenModelImplCopyWith<$Res>
implements $LibraryScreenModelCopyWith<$Res> {
factory _$$LibraryScreenModelImplCopyWith(_$LibraryScreenModelImpl value,
$Res Function(_$LibraryScreenModelImpl) then) =
__$$LibraryScreenModelImplCopyWithImpl<$Res>;
@override
abstract mixin class $LibraryScreenModelCopyWith<$Res> {
factory $LibraryScreenModelCopyWith(
LibraryScreenModel value, $Res Function(LibraryScreenModel) _then) =
_$LibraryScreenModelCopyWithImpl;
@useResult
$Res call(
{List<ViewModel> views,
@ -115,12 +51,12 @@ abstract class _$$LibraryScreenModelImplCopyWith<$Res>
}
/// @nodoc
class __$$LibraryScreenModelImplCopyWithImpl<$Res>
extends _$LibraryScreenModelCopyWithImpl<$Res, _$LibraryScreenModelImpl>
implements _$$LibraryScreenModelImplCopyWith<$Res> {
__$$LibraryScreenModelImplCopyWithImpl(_$LibraryScreenModelImpl _value,
$Res Function(_$LibraryScreenModelImpl) _then)
: super(_value, _then);
class _$LibraryScreenModelCopyWithImpl<$Res>
implements $LibraryScreenModelCopyWith<$Res> {
_$LibraryScreenModelCopyWithImpl(this._self, this._then);
final LibraryScreenModel _self;
final $Res Function(LibraryScreenModel) _then;
/// Create a copy of LibraryScreenModel
/// with the given fields replaced by the non-null parameter values.
@ -134,39 +70,220 @@ class __$$LibraryScreenModelImplCopyWithImpl<$Res>
Object? genres = null,
Object? favourites = null,
}) {
return _then(_$LibraryScreenModelImpl(
return _then(_self.copyWith(
views: null == views
? _value._views
? _self.views
: views // ignore: cast_nullable_to_non_nullable
as List<ViewModel>,
selectedViewModel: freezed == selectedViewModel
? _value.selectedViewModel
? _self.selectedViewModel
: selectedViewModel // ignore: cast_nullable_to_non_nullable
as ViewModel?,
viewType: null == viewType
? _value._viewType
? _self.viewType
: viewType // ignore: cast_nullable_to_non_nullable
as Set<LibraryViewType>,
recommendations: null == recommendations
? _value._recommendations
? _self.recommendations
: recommendations // ignore: cast_nullable_to_non_nullable
as List<RecommendedModel>,
genres: null == genres
? _value._genres
? _self.genres
: genres // ignore: cast_nullable_to_non_nullable
as List<RecommendedModel>,
favourites: null == favourites
? _value._favourites
? _self.favourites
: favourites // ignore: cast_nullable_to_non_nullable
as List<ItemBaseModel>,
));
}
}
/// Adds pattern-matching-related methods to [LibraryScreenModel].
extension LibraryScreenModelPatterns on LibraryScreenModel {
/// 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(_LibraryScreenModel value)? $default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _LibraryScreenModel() 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(_LibraryScreenModel value) $default,
) {
final _that = this;
switch (_that) {
case _LibraryScreenModel():
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(_LibraryScreenModel value)? $default,
) {
final _that = this;
switch (_that) {
case _LibraryScreenModel() 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<ViewModel> views,
ViewModel? selectedViewModel,
Set<LibraryViewType> viewType,
List<RecommendedModel> recommendations,
List<RecommendedModel> genres,
List<ItemBaseModel> favourites)?
$default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _LibraryScreenModel() when $default != null:
return $default(_that.views, _that.selectedViewModel, _that.viewType,
_that.recommendations, _that.genres, _that.favourites);
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<ViewModel> views,
ViewModel? selectedViewModel,
Set<LibraryViewType> viewType,
List<RecommendedModel> recommendations,
List<RecommendedModel> genres,
List<ItemBaseModel> favourites)
$default,
) {
final _that = this;
switch (_that) {
case _LibraryScreenModel():
return $default(_that.views, _that.selectedViewModel, _that.viewType,
_that.recommendations, _that.genres, _that.favourites);
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<ViewModel> views,
ViewModel? selectedViewModel,
Set<LibraryViewType> viewType,
List<RecommendedModel> recommendations,
List<RecommendedModel> genres,
List<ItemBaseModel> favourites)?
$default,
) {
final _that = this;
switch (_that) {
case _LibraryScreenModel() when $default != null:
return $default(_that.views, _that.selectedViewModel, _that.viewType,
_that.recommendations, _that.genres, _that.favourites);
case _:
return null;
}
}
}
/// @nodoc
class _$LibraryScreenModelImpl implements _LibraryScreenModel {
_$LibraryScreenModelImpl(
class _LibraryScreenModel implements LibraryScreenModel {
_LibraryScreenModel(
{final List<ViewModel> views = const [],
this.selectedViewModel,
final Set<LibraryViewType> viewType = const {
@ -229,47 +346,84 @@ class _$LibraryScreenModelImpl implements _LibraryScreenModel {
return EqualUnmodifiableListView(_favourites);
}
/// Create a copy of LibraryScreenModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$LibraryScreenModelCopyWith<_LibraryScreenModel> get copyWith =>
__$LibraryScreenModelCopyWithImpl<_LibraryScreenModel>(this, _$identity);
@override
String toString() {
return 'LibraryScreenModel(views: $views, selectedViewModel: $selectedViewModel, viewType: $viewType, recommendations: $recommendations, genres: $genres, favourites: $favourites)';
}
}
/// @nodoc
abstract mixin class _$LibraryScreenModelCopyWith<$Res>
implements $LibraryScreenModelCopyWith<$Res> {
factory _$LibraryScreenModelCopyWith(
_LibraryScreenModel value, $Res Function(_LibraryScreenModel) _then) =
__$LibraryScreenModelCopyWithImpl;
@override
@useResult
$Res call(
{List<ViewModel> views,
ViewModel? selectedViewModel,
Set<LibraryViewType> viewType,
List<RecommendedModel> recommendations,
List<RecommendedModel> genres,
List<ItemBaseModel> favourites});
}
/// @nodoc
class __$LibraryScreenModelCopyWithImpl<$Res>
implements _$LibraryScreenModelCopyWith<$Res> {
__$LibraryScreenModelCopyWithImpl(this._self, this._then);
final _LibraryScreenModel _self;
final $Res Function(_LibraryScreenModel) _then;
/// Create a copy of LibraryScreenModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$LibraryScreenModelImplCopyWith<_$LibraryScreenModelImpl> get copyWith =>
__$$LibraryScreenModelImplCopyWithImpl<_$LibraryScreenModelImpl>(
this, _$identity);
$Res call({
Object? views = null,
Object? selectedViewModel = freezed,
Object? viewType = null,
Object? recommendations = null,
Object? genres = null,
Object? favourites = null,
}) {
return _then(_LibraryScreenModel(
views: null == views
? _self._views
: views // ignore: cast_nullable_to_non_nullable
as List<ViewModel>,
selectedViewModel: freezed == selectedViewModel
? _self.selectedViewModel
: selectedViewModel // ignore: cast_nullable_to_non_nullable
as ViewModel?,
viewType: null == viewType
? _self._viewType
: viewType // ignore: cast_nullable_to_non_nullable
as Set<LibraryViewType>,
recommendations: null == recommendations
? _self._recommendations
: recommendations // ignore: cast_nullable_to_non_nullable
as List<RecommendedModel>,
genres: null == genres
? _self._genres
: genres // ignore: cast_nullable_to_non_nullable
as List<RecommendedModel>,
favourites: null == favourites
? _self._favourites
: favourites // ignore: cast_nullable_to_non_nullable
as List<ItemBaseModel>,
));
}
}
abstract class _LibraryScreenModel implements LibraryScreenModel {
factory _LibraryScreenModel(
{final List<ViewModel> views,
final ViewModel? selectedViewModel,
final Set<LibraryViewType> viewType,
final List<RecommendedModel> recommendations,
final List<RecommendedModel> genres,
final List<ItemBaseModel> favourites}) = _$LibraryScreenModelImpl;
@override
List<ViewModel> get views;
@override
ViewModel? get selectedViewModel;
@override
Set<LibraryViewType> get viewType;
@override
List<RecommendedModel> get recommendations;
@override
List<RecommendedModel> get genres;
@override
List<ItemBaseModel> get favourites;
/// Create a copy of LibraryScreenModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$LibraryScreenModelImplCopyWith<_$LibraryScreenModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}
// dart format on

View file

@ -52,7 +52,7 @@ class SessionInfo extends _$SessionInfo {
}
@freezed
class SessionInfoModel with _$SessionInfoModel {
abstract class SessionInfoModel with _$SessionInfoModel {
const SessionInfoModel._();
factory SessionInfoModel({

View file

@ -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,61 +9,206 @@ part of 'session_info_provider.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');
SessionInfoModel _$SessionInfoModelFromJson(Map<String, dynamic> json) {
return _SessionInfoModel.fromJson(json);
}
/// @nodoc
mixin _$SessionInfoModel {
String? get playbackModel => throw _privateConstructorUsedError;
TranscodingInfo? get transCodeInfo => throw _privateConstructorUsedError;
String? get playbackModel;
TranscodingInfo? get transCodeInfo;
/// Serializes this SessionInfoModel to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
Map<String, dynamic> toJson();
@override
String toString() {
return 'SessionInfoModel(playbackModel: $playbackModel, transCodeInfo: $transCodeInfo)';
}
}
/// Adds pattern-matching-related methods to [SessionInfoModel].
extension SessionInfoModelPatterns on SessionInfoModel {
/// 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(_SessionInfoModel value)? $default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _SessionInfoModel() 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(_SessionInfoModel value) $default,
) {
final _that = this;
switch (_that) {
case _SessionInfoModel():
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(_SessionInfoModel value)? $default,
) {
final _that = this;
switch (_that) {
case _SessionInfoModel() 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? playbackModel, TranscodingInfo? transCodeInfo)?
$default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _SessionInfoModel() when $default != null:
return $default(_that.playbackModel, _that.transCodeInfo);
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? playbackModel, TranscodingInfo? transCodeInfo)
$default,
) {
final _that = this;
switch (_that) {
case _SessionInfoModel():
return $default(_that.playbackModel, _that.transCodeInfo);
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? playbackModel, TranscodingInfo? transCodeInfo)?
$default,
) {
final _that = this;
switch (_that) {
case _SessionInfoModel() when $default != null:
return $default(_that.playbackModel, _that.transCodeInfo);
case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _$SessionInfoModelImpl extends _SessionInfoModel {
_$SessionInfoModelImpl({this.playbackModel, this.transCodeInfo}) : super._();
factory _$SessionInfoModelImpl.fromJson(Map<String, dynamic> json) =>
_$$SessionInfoModelImplFromJson(json);
class _SessionInfoModel extends SessionInfoModel {
_SessionInfoModel({this.playbackModel, this.transCodeInfo}) : super._();
factory _SessionInfoModel.fromJson(Map<String, dynamic> json) =>
_$SessionInfoModelFromJson(json);
@override
final String? playbackModel;
@override
final TranscodingInfo? transCodeInfo;
@override
String toString() {
return 'SessionInfoModel(playbackModel: $playbackModel, transCodeInfo: $transCodeInfo)';
}
@override
Map<String, dynamic> toJson() {
return _$$SessionInfoModelImplToJson(
return _$SessionInfoModelToJson(
this,
);
}
}
abstract class _SessionInfoModel extends SessionInfoModel {
factory _SessionInfoModel(
{final String? playbackModel,
final TranscodingInfo? transCodeInfo}) = _$SessionInfoModelImpl;
_SessionInfoModel._() : super._();
factory _SessionInfoModel.fromJson(Map<String, dynamic> json) =
_$SessionInfoModelImpl.fromJson;
@override
String? get playbackModel;
@override
TranscodingInfo? get transCodeInfo;
String toString() {
return 'SessionInfoModel(playbackModel: $playbackModel, transCodeInfo: $transCodeInfo)';
}
}
// dart format on

View file

@ -6,9 +6,8 @@ part of 'session_info_provider.dart';
// JsonSerializableGenerator
// **************************************************************************
_$SessionInfoModelImpl _$$SessionInfoModelImplFromJson(
Map<String, dynamic> json) =>
_$SessionInfoModelImpl(
_SessionInfoModel _$SessionInfoModelFromJson(Map<String, dynamic> json) =>
_SessionInfoModel(
playbackModel: json['playbackModel'] as String?,
transCodeInfo: json['transCodeInfo'] == null
? null
@ -16,8 +15,7 @@ _$SessionInfoModelImpl _$$SessionInfoModelImplFromJson(
json['transCodeInfo'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$SessionInfoModelImplToJson(
_$SessionInfoModelImpl instance) =>
Map<String, dynamic> _$SessionInfoModelToJson(_SessionInfoModel instance) =>
<String, dynamic>{
'playbackModel': instance.playbackModel,
'transCodeInfo': instance.transCodeInfo,

View file

@ -41,7 +41,6 @@ import 'package:fladder/providers/user_provider.dart';
import 'package:fladder/screens/shared/fladder_snackbar.dart';
import 'package:fladder/util/duration_extensions.dart';
import 'package:fladder/util/localization_helper.dart';
import 'package:fladder/util/migration/isar_drift_migration.dart';
final syncProvider = StateNotifierProvider<SyncNotifier, SyncSettingsModel>((ref) => throw UnimplementedError());
@ -67,11 +66,6 @@ class SyncNotifier extends StateNotifier<SyncSettingsModel> {
updateSyncStates();
}
void migrateFromIsar() async {
await isarMigration(ref, _db, mainDirectory.path);
_initializeQueryStream();
}
Future<void> updateSyncStates() async {
final lastState =
(await _db.getAllItems.get()).where((item) => item.unSyncedData && item.userData != null).toList();
@ -114,7 +108,7 @@ class SyncNotifier extends StateNotifier<SyncSettingsModel> {
updateSyncStates();
}
});
migrateFromIsar();
_initializeQueryStream();
}
void _initializeQueryStream({String? id}) async {

View file

@ -1,13 +0,0 @@
import 'dart:io';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:isar/isar.dart';
class AbstractSyncNotifier {
final Ref ref;
final Isar? isar;
final Directory mobileDirectory;
final String subPath = "Synced";
AbstractSyncNotifier(this.ref, this.isar, this.mobileDirectory);
}

View file

@ -77,7 +77,7 @@ class Update extends _$Update {
}
@Freezed(toJson: false, fromJson: false)
class UpdatesModel with _$UpdatesModel {
abstract class UpdatesModel with _$UpdatesModel {
const UpdatesModel._();
factory UpdatesModel({

View file

@ -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,187 @@ part of 'update_provider.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 _$UpdatesModel {
List<ReleaseInfo> get lastRelease => throw _privateConstructorUsedError;
mixin _$UpdatesModel implements DiagnosticableTreeMixin {
List<ReleaseInfo> get lastRelease;
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
properties
..add(DiagnosticsProperty('type', 'UpdatesModel'))
..add(DiagnosticsProperty('lastRelease', lastRelease));
}
@override
String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
return 'UpdatesModel(lastRelease: $lastRelease)';
}
}
/// Adds pattern-matching-related methods to [UpdatesModel].
extension UpdatesModelPatterns on UpdatesModel {
/// 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(_UpdatesModel value)? $default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _UpdatesModel() 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(_UpdatesModel value) $default,
) {
final _that = this;
switch (_that) {
case _UpdatesModel():
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(_UpdatesModel value)? $default,
) {
final _that = this;
switch (_that) {
case _UpdatesModel() 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<ReleaseInfo> lastRelease)? $default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _UpdatesModel() when $default != null:
return $default(_that.lastRelease);
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<ReleaseInfo> lastRelease) $default,
) {
final _that = this;
switch (_that) {
case _UpdatesModel():
return $default(_that.lastRelease);
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<ReleaseInfo> lastRelease)? $default,
) {
final _that = this;
switch (_that) {
case _UpdatesModel() when $default != null:
return $default(_that.lastRelease);
case _:
return null;
}
}
}
/// @nodoc
class _$UpdatesModelImpl extends _UpdatesModel with DiagnosticableTreeMixin {
_$UpdatesModelImpl({final List<ReleaseInfo> lastRelease = const []})
class _UpdatesModel extends UpdatesModel with DiagnosticableTreeMixin {
_UpdatesModel({final List<ReleaseInfo> lastRelease = const []})
: _lastRelease = lastRelease,
super._();
@ -35,25 +202,17 @@ class _$UpdatesModelImpl extends _UpdatesModel with DiagnosticableTreeMixin {
return EqualUnmodifiableListView(_lastRelease);
}
@override
String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
return 'UpdatesModel(lastRelease: $lastRelease)';
}
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties
..add(DiagnosticsProperty('type', 'UpdatesModel'))
..add(DiagnosticsProperty('lastRelease', lastRelease));
}
}
abstract class _UpdatesModel extends UpdatesModel {
factory _UpdatesModel({final List<ReleaseInfo> lastRelease}) =
_$UpdatesModelImpl;
_UpdatesModel._() : super._();
@override
List<ReleaseInfo> get lastRelease;
String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
return 'UpdatesModel(lastRelease: $lastRelease)';
}
}
// dart format on

View file

@ -136,7 +136,7 @@ class AuthGuard extends AutoRouteGuard {
return resolver.next(true);
}
resolver.redirect<bool>(SplashRoute(loggedIn: (value) {
resolver.redirectUntil<bool>(SplashRoute(loggedIn: (value) {
if (value) {
resolver.next(true);
} else {

View file

@ -1,3 +1,4 @@
// dart format width=80
// GENERATED CODE - DO NOT MODIFY BY HAND
// **************************************************************************
@ -8,9 +9,10 @@
// coverage:ignore-file
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i23;
import 'dart:async' as _i24;
import 'package:auto_route/auto_route.dart' as _i18;
import 'package:collection/collection.dart' as _i23;
import 'package:fladder/models/item_base_model.dart' as _i19;
import 'package:fladder/models/items/photos_model.dart' as _i22;
import 'package:fladder/models/library_search/library_search_options.dart'
@ -35,16 +37,13 @@ import 'package:fladder/screens/settings/settings_selection_screen.dart'
import 'package:fladder/screens/splash_screen.dart' as _i16;
import 'package:fladder/screens/syncing/synced_screen.dart' as _i17;
import 'package:flutter/foundation.dart' as _i20;
import 'package:flutter/material.dart' as _i24;
import 'package:flutter/material.dart' as _i25;
/// generated route for
/// [_i1.AboutSettingsPage]
class AboutSettingsRoute extends _i18.PageRouteInfo<void> {
const AboutSettingsRoute({List<_i18.PageRouteInfo>? children})
: super(
AboutSettingsRoute.name,
initialChildren: children,
);
: super(AboutSettingsRoute.name, initialChildren: children);
static const String name = 'AboutSettingsRoute';
@ -60,10 +59,7 @@ class AboutSettingsRoute extends _i18.PageRouteInfo<void> {
/// [_i2.ClientSettingsPage]
class ClientSettingsRoute extends _i18.PageRouteInfo<void> {
const ClientSettingsRoute({List<_i18.PageRouteInfo>? children})
: super(
ClientSettingsRoute.name,
initialChildren: children,
);
: super(ClientSettingsRoute.name, initialChildren: children);
static const String name = 'ClientSettingsRoute';
@ -79,10 +75,7 @@ class ClientSettingsRoute extends _i18.PageRouteInfo<void> {
/// [_i3.DashboardScreen]
class DashboardRoute extends _i18.PageRouteInfo<void> {
const DashboardRoute({List<_i18.PageRouteInfo>? children})
: super(
DashboardRoute.name,
initialChildren: children,
);
: super(DashboardRoute.name, initialChildren: children);
static const String name = 'DashboardRoute';
@ -104,11 +97,7 @@ class DetailsRoute extends _i18.PageRouteInfo<DetailsRouteArgs> {
List<_i18.PageRouteInfo>? children,
}) : super(
DetailsRoute.name,
args: DetailsRouteArgs(
id: id,
item: item,
key: key,
),
args: DetailsRouteArgs(id: id, item: item, key: key),
rawQueryParams: {'id': id},
initialChildren: children,
);
@ -120,26 +109,15 @@ class DetailsRoute extends _i18.PageRouteInfo<DetailsRouteArgs> {
builder: (data) {
final queryParams = data.queryParams;
final args = data.argsAs<DetailsRouteArgs>(
orElse: () => DetailsRouteArgs(
id: queryParams.getString(
'id',
'',
)));
return _i4.DetailsScreen(
id: args.id,
item: args.item,
key: args.key,
orElse: () => DetailsRouteArgs(id: queryParams.getString('id', '')),
);
return _i4.DetailsScreen(id: args.id, item: args.item, key: args.key);
},
);
}
class DetailsRouteArgs {
const DetailsRouteArgs({
this.id = '',
this.item,
this.key,
});
const DetailsRouteArgs({this.id = '', this.item, this.key});
final String id;
@ -151,16 +129,23 @@ class DetailsRouteArgs {
String toString() {
return 'DetailsRouteArgs{id: $id, item: $item, key: $key}';
}
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
if (other is! DetailsRouteArgs) return false;
return id == other.id && item == other.item && key == other.key;
}
@override
int get hashCode => id.hashCode ^ item.hashCode ^ key.hashCode;
}
/// generated route for
/// [_i5.FavouritesScreen]
class FavouritesRoute extends _i18.PageRouteInfo<void> {
const FavouritesRoute({List<_i18.PageRouteInfo>? children})
: super(
FavouritesRoute.name,
initialChildren: children,
);
: super(FavouritesRoute.name, initialChildren: children);
static const String name = 'FavouritesRoute';
@ -176,10 +161,7 @@ class FavouritesRoute extends _i18.PageRouteInfo<void> {
/// [_i6.HomeScreen]
class HomeRoute extends _i18.PageRouteInfo<void> {
const HomeRoute({List<_i18.PageRouteInfo>? children})
: super(
HomeRoute.name,
initialChildren: children,
);
: super(HomeRoute.name, initialChildren: children);
static const String name = 'HomeRoute';
@ -195,10 +177,7 @@ class HomeRoute extends _i18.PageRouteInfo<void> {
/// [_i7.LibraryScreen]
class LibraryRoute extends _i18.PageRouteInfo<void> {
const LibraryRoute({List<_i18.PageRouteInfo>? children})
: super(
LibraryRoute.name,
initialChildren: children,
);
: super(LibraryRoute.name, initialChildren: children);
static const String name = 'LibraryRoute';
@ -250,13 +229,14 @@ class LibrarySearchRoute extends _i18.PageRouteInfo<LibrarySearchRouteArgs> {
builder: (data) {
final queryParams = data.queryParams;
final args = data.argsAs<LibrarySearchRouteArgs>(
orElse: () => LibrarySearchRouteArgs(
viewModelId: queryParams.optString('parentId'),
folderId: queryParams.optList('folderId'),
favourites: queryParams.optBool('favourites'),
sortOrder: queryParams.get('sortOrder'),
sortingOptions: queryParams.get('sortOptions'),
));
orElse: () => LibrarySearchRouteArgs(
viewModelId: queryParams.optString('parentId'),
folderId: queryParams.optList('folderId'),
favourites: queryParams.optBool('favourites'),
sortOrder: queryParams.get('sortOrder'),
sortingOptions: queryParams.get('sortOptions'),
),
);
return _i8.LibrarySearchScreen(
viewModelId: args.viewModelId,
folderId: args.folderId,
@ -299,16 +279,36 @@ class LibrarySearchRouteArgs {
String toString() {
return 'LibrarySearchRouteArgs{viewModelId: $viewModelId, folderId: $folderId, favourites: $favourites, sortOrder: $sortOrder, sortingOptions: $sortingOptions, photoToView: $photoToView, key: $key}';
}
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
if (other is! LibrarySearchRouteArgs) return false;
return viewModelId == other.viewModelId &&
const _i23.ListEquality().equals(folderId, other.folderId) &&
favourites == other.favourites &&
sortOrder == other.sortOrder &&
sortingOptions == other.sortingOptions &&
photoToView == other.photoToView &&
key == other.key;
}
@override
int get hashCode =>
viewModelId.hashCode ^
const _i23.ListEquality().hash(folderId) ^
favourites.hashCode ^
sortOrder.hashCode ^
sortingOptions.hashCode ^
photoToView.hashCode ^
key.hashCode;
}
/// generated route for
/// [_i9.LockScreen]
class LockRoute extends _i18.PageRouteInfo<void> {
const LockRoute({List<_i18.PageRouteInfo>? children})
: super(
LockRoute.name,
initialChildren: children,
);
: super(LockRoute.name, initialChildren: children);
static const String name = 'LockRoute';
@ -324,10 +324,7 @@ class LockRoute extends _i18.PageRouteInfo<void> {
/// [_i10.LoginScreen]
class LoginRoute extends _i18.PageRouteInfo<void> {
const LoginRoute({List<_i18.PageRouteInfo>? children})
: super(
LoginRoute.name,
initialChildren: children,
);
: super(LoginRoute.name, initialChildren: children);
static const String name = 'LoginRoute';
@ -345,8 +342,8 @@ class PhotoViewerRoute extends _i18.PageRouteInfo<PhotoViewerRouteArgs> {
PhotoViewerRoute({
List<_i22.PhotoModel>? items,
String? selected,
_i23.Future<List<_i22.PhotoModel>>? loadingItems,
_i24.Key? key,
_i24.Future<List<_i22.PhotoModel>>? loadingItems,
_i25.Key? key,
List<_i18.PageRouteInfo>? children,
}) : super(
PhotoViewerRoute.name,
@ -367,8 +364,9 @@ class PhotoViewerRoute extends _i18.PageRouteInfo<PhotoViewerRouteArgs> {
builder: (data) {
final queryParams = data.queryParams;
final args = data.argsAs<PhotoViewerRouteArgs>(
orElse: () => PhotoViewerRouteArgs(
selected: queryParams.optString('selectedId')));
orElse: () =>
PhotoViewerRouteArgs(selected: queryParams.optString('selectedId')),
);
return _i11.PhotoViewerScreen(
items: args.items,
selected: args.selected,
@ -391,24 +389,38 @@ class PhotoViewerRouteArgs {
final String? selected;
final _i23.Future<List<_i22.PhotoModel>>? loadingItems;
final _i24.Future<List<_i22.PhotoModel>>? loadingItems;
final _i24.Key? key;
final _i25.Key? key;
@override
String toString() {
return 'PhotoViewerRouteArgs{items: $items, selected: $selected, loadingItems: $loadingItems, key: $key}';
}
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
if (other is! PhotoViewerRouteArgs) return false;
return const _i23.ListEquality().equals(items, other.items) &&
selected == other.selected &&
loadingItems == other.loadingItems &&
key == other.key;
}
@override
int get hashCode =>
const _i23.ListEquality().hash(items) ^
selected.hashCode ^
loadingItems.hashCode ^
key.hashCode;
}
/// generated route for
/// [_i12.PlayerSettingsPage]
class PlayerSettingsRoute extends _i18.PageRouteInfo<void> {
const PlayerSettingsRoute({List<_i18.PageRouteInfo>? children})
: super(
PlayerSettingsRoute.name,
initialChildren: children,
);
: super(PlayerSettingsRoute.name, initialChildren: children);
static const String name = 'PlayerSettingsRoute';
@ -424,10 +436,7 @@ class PlayerSettingsRoute extends _i18.PageRouteInfo<void> {
/// [_i13.SecuritySettingsPage]
class SecuritySettingsRoute extends _i18.PageRouteInfo<void> {
const SecuritySettingsRoute({List<_i18.PageRouteInfo>? children})
: super(
SecuritySettingsRoute.name,
initialChildren: children,
);
: super(SecuritySettingsRoute.name, initialChildren: children);
static const String name = 'SecuritySettingsRoute';
@ -443,10 +452,7 @@ class SecuritySettingsRoute extends _i18.PageRouteInfo<void> {
/// [_i14.SettingsScreen]
class SettingsRoute extends _i18.PageRouteInfo<void> {
const SettingsRoute({List<_i18.PageRouteInfo>? children})
: super(
SettingsRoute.name,
initialChildren: children,
);
: super(SettingsRoute.name, initialChildren: children);
static const String name = 'SettingsRoute';
@ -462,10 +468,7 @@ class SettingsRoute extends _i18.PageRouteInfo<void> {
/// [_i15.SettingsSelectionScreen]
class SettingsSelectionRoute extends _i18.PageRouteInfo<void> {
const SettingsSelectionRoute({List<_i18.PageRouteInfo>? children})
: super(
SettingsSelectionRoute.name,
initialChildren: children,
);
: super(SettingsSelectionRoute.name, initialChildren: children);
static const String name = 'SettingsSelectionRoute';
@ -482,14 +485,11 @@ class SettingsSelectionRoute extends _i18.PageRouteInfo<void> {
class SplashRoute extends _i18.PageRouteInfo<SplashRouteArgs> {
SplashRoute({
dynamic Function(bool)? loggedIn,
_i24.Key? key,
_i25.Key? key,
List<_i18.PageRouteInfo>? children,
}) : super(
SplashRoute.name,
args: SplashRouteArgs(
loggedIn: loggedIn,
key: key,
),
args: SplashRouteArgs(loggedIn: loggedIn, key: key),
initialChildren: children,
);
@ -498,37 +498,42 @@ class SplashRoute extends _i18.PageRouteInfo<SplashRouteArgs> {
static _i18.PageInfo page = _i18.PageInfo(
name,
builder: (data) {
final args =
data.argsAs<SplashRouteArgs>(orElse: () => const SplashRouteArgs());
return _i16.SplashScreen(
loggedIn: args.loggedIn,
key: args.key,
final args = data.argsAs<SplashRouteArgs>(
orElse: () => const SplashRouteArgs(),
);
return _i16.SplashScreen(loggedIn: args.loggedIn, key: args.key);
},
);
}
class SplashRouteArgs {
const SplashRouteArgs({
this.loggedIn,
this.key,
});
const SplashRouteArgs({this.loggedIn, this.key});
final dynamic Function(bool)? loggedIn;
final _i24.Key? key;
final _i25.Key? key;
@override
String toString() {
return 'SplashRouteArgs{loggedIn: $loggedIn, key: $key}';
}
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
if (other is! SplashRouteArgs) return false;
return key == other.key;
}
@override
int get hashCode => key.hashCode;
}
/// generated route for
/// [_i17.SyncedScreen]
class SyncedRoute extends _i18.PageRouteInfo<SyncedRouteArgs> {
SyncedRoute({
_i24.ScrollController? navigationScrollController,
_i25.ScrollController? navigationScrollController,
_i20.Key? key,
List<_i18.PageRouteInfo>? children,
}) : super(
@ -545,8 +550,9 @@ class SyncedRoute extends _i18.PageRouteInfo<SyncedRouteArgs> {
static _i18.PageInfo page = _i18.PageInfo(
name,
builder: (data) {
final args =
data.argsAs<SyncedRouteArgs>(orElse: () => const SyncedRouteArgs());
final args = data.argsAs<SyncedRouteArgs>(
orElse: () => const SyncedRouteArgs(),
);
return _i17.SyncedScreen(
navigationScrollController: args.navigationScrollController,
key: args.key,
@ -556,12 +562,9 @@ class SyncedRoute extends _i18.PageRouteInfo<SyncedRouteArgs> {
}
class SyncedRouteArgs {
const SyncedRouteArgs({
this.navigationScrollController,
this.key,
});
const SyncedRouteArgs({this.navigationScrollController, this.key});
final _i24.ScrollController? navigationScrollController;
final _i25.ScrollController? navigationScrollController;
final _i20.Key? key;
@ -569,4 +572,15 @@ class SyncedRouteArgs {
String toString() {
return 'SyncedRouteArgs{navigationScrollController: $navigationScrollController, key: $key}';
}
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
if (other is! SyncedRouteArgs) return false;
return navigationScrollController == other.navigationScrollController &&
key == other.key;
}
@override
int get hashCode => navigationScrollController.hashCode ^ key.hashCode;
}

View file

@ -173,14 +173,16 @@ class _LibraryFilterChipsState extends ConsumerState<LibraryFilterChips> {
children: [
Text(context.localized.groupBy),
...GroupBy.values.map(
(group) => RadioListTile.adaptive(
value: group,
(group) => RadioGroup(
groupValue: groupBy,
title: Text(group.value(context)),
onChanged: (_) {
provider.setGroupBy(group);
Navigator.pop(context);
},
child: RadioListTile.adaptive(
value: group,
title: Text(group.value(context)),
),
),
),
],

View file

@ -1,7 +1,8 @@
import 'package:flutter/material.dart';
import 'package:fladder/models/library_search/library_search_options.dart';
import 'package:fladder/providers/library_search_provider.dart';
import 'package:fladder/util/localization_helper.dart';
import 'package:flutter/material.dart';
Future<(SortingOptions? sortOptions, SortingOrder? sortingOrder)?> openSortByDialogue(
BuildContext context, {
@ -27,9 +28,7 @@ Future<(SortingOptions? sortOptions, SortingOrder? sortingOrder)?> openSortByDia
child: Text(context.localized.sortBy, style: Theme.of(context).textTheme.titleLarge),
),
const SizedBox(height: 8),
...SortingOptions.values.map((e) => RadioListTile.adaptive(
value: e,
title: Text(e.label(context)),
...SortingOptions.values.map((e) => RadioGroup(
groupValue: newSortingOptions,
onChanged: (value) {
state(
@ -38,6 +37,10 @@ Future<(SortingOptions? sortOptions, SortingOrder? sortingOrder)?> openSortByDia
},
);
},
child: RadioListTile.adaptive(
value: e,
title: Text(e.label(context)),
),
)),
const Padding(
padding: EdgeInsets.symmetric(vertical: 8),
@ -49,9 +52,7 @@ Future<(SortingOptions? sortOptions, SortingOrder? sortingOrder)?> openSortByDia
),
const SizedBox(height: 8),
...SortingOrder.values.map(
(e) => RadioListTile.adaptive(
value: e,
title: Text(e.label(context)),
(e) => RadioGroup(
groupValue: newSortOrder,
onChanged: (value) {
state(
@ -60,6 +61,10 @@ Future<(SortingOptions? sortOptions, SortingOrder? sortingOrder)?> openSortByDia
},
);
},
child: RadioListTile.adaptive(
value: e,
title: Text(e.label(context)),
),
),
),
],

View file

@ -59,7 +59,7 @@ class _LockScreenState extends ConsumerState<LockScreen> with WidgetsBindingObse
void handleLogin(AccountModel user) {
ref.read(lockScreenActiveProvider.notifier).update((state) => false);
poppingLockScreen = true;
context.router.popForced();
context.router.pop();
}
void tapLoggedInAccount(AccountModel user) async {

View file

@ -24,13 +24,15 @@ List<Widget> buildClientSettingsTheme(BuildContext context, WidgetRef ref) {
items: ThemeMode.values,
selected: [ref.read(clientSettingsProvider.select((value) => value.themeMode))],
onChanged: (values) => ref.read(clientSettingsProvider.notifier).setThemeMode(values.first),
itemBuilder: (type, selected, tap) => RadioListTile(
value: type,
title: Text(type.label(context)),
contentPadding: EdgeInsets.zero,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
itemBuilder: (type, selected, tap) => RadioGroup(
groupValue: ref.read(clientSettingsProvider.select((value) => value.themeMode)),
onChanged: (value) => tap(),
child: RadioListTile(
value: type,
title: Text(type.label(context)),
contentPadding: EdgeInsets.zero,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
),
),
),
),
@ -43,37 +45,39 @@ List<Widget> buildClientSettingsTheme(BuildContext context, WidgetRef ref) {
items: [null, ...ColorThemes.values],
selected: [(ref.read(clientSettingsProvider.select((value) => value.themeColor)))],
onChanged: (values) => ref.read(clientSettingsProvider.notifier).setThemeColor(values.first),
itemBuilder: (type, selected, tap) => RadioListTile<ColorThemes?>(
groupValue: ref.read(clientSettingsProvider.select((value) => value.themeColor)),
contentPadding: EdgeInsets.zero,
value: type,
itemBuilder: (type, selected, tap) => RadioGroup(
onChanged: (value) => tap(),
title: Row(
children: [
Container(
height: 24,
width: 24,
decoration: BoxDecoration(
gradient: type == null
? const SweepGradient(
center: FractionalOffset.center,
colors: <Color>[
Color(0xFF4285F4), // blue
Color(0xFF34A853), // green
Color(0xFFFBBC05), // yellow
Color(0xFFEA4335), // red
Color(0xFF4285F4), // blue again to seamlessly transition to the start
],
stops: <double>[0.0, 0.25, 0.5, 0.75, 1.0],
)
: null,
color: type?.color,
borderRadius: BorderRadius.circular(4),
groupValue: ref.read(clientSettingsProvider.select((value) => value.themeColor)),
child: RadioListTile<ColorThemes?>(
contentPadding: EdgeInsets.zero,
value: type,
title: Row(
children: [
Container(
height: 24,
width: 24,
decoration: BoxDecoration(
gradient: type == null
? const SweepGradient(
center: FractionalOffset.center,
colors: <Color>[
Color(0xFF4285F4), // blue
Color(0xFF34A853), // green
Color(0xFFFBBC05), // yellow
Color(0xFFEA4335), // red
Color(0xFF4285F4), // blue again to seamlessly transition to the start
],
stops: <double>[0.0, 0.25, 0.5, 0.75, 1.0],
)
: null,
color: type?.color,
borderRadius: BorderRadius.circular(4),
),
),
),
const SizedBox(width: 8),
Text(type?.name ?? context.localized.dynamicText),
],
const SizedBox(width: 8),
Text(type?.name ?? context.localized.dynamicText),
],
),
),
),
),
@ -88,12 +92,14 @@ List<Widget> buildClientSettingsTheme(BuildContext context, WidgetRef ref) {
items: DynamicSchemeVariant.values,
selected: [(ref.read(clientSettingsProvider.select((value) => value.schemeVariant)))],
onChanged: (values) => ref.read(clientSettingsProvider.notifier).setSchemeVariant(values.first),
itemBuilder: (type, selected, tap) => RadioListTile<DynamicSchemeVariant>(
groupValue: selected ? type : null,
contentPadding: EdgeInsets.zero,
value: type,
itemBuilder: (type, selected, tap) => RadioGroup(
onChanged: (value) => tap(),
title: Text(type.label(context)),
groupValue: selected ? type : null,
child: RadioListTile<DynamicSchemeVariant>(
contentPadding: EdgeInsets.zero,
value: type,
title: Text(type.label(context)),
),
),
);
},

View file

@ -117,7 +117,7 @@ class SettingsScaffold extends ConsumerWidget {
if (AdaptiveLayout.layoutModeOf(context) == LayoutMode.single && context.tabsRouter.activeIndex != 0) {
context.tabsRouter.setActiveIndex(0);
} else {
context.router.popForced();
context.router.pop();
}
} else {
context.router.popBack();

View file

@ -70,10 +70,6 @@ class _SyncedScreenState extends ConsumerState<SyncedScreen> {
onPressed: () => ref.read(syncProvider.notifier).removeAllSyncedData(),
child: const Text("Clear drift database"),
),
ElevatedButton(
onPressed: () => ref.read(syncProvider.notifier).migrateFromIsar(),
child: const Text("Migrate Isar to Drift"),
),
],
),
),

View file

@ -42,23 +42,24 @@ class _QualityOptionsDialogue extends ConsumerWidget {
shrinkWrap: true,
children: qualityOptions?.entries
.map(
(entry) => RadioListTile(
value: entry.value,
groupValue: true,
onChanged: (value) async {
final newModel = await playbackModel?.setQualityOption(
qualityOptions.map(
(key, value) => MapEntry(key, key == entry.key ? true : false),
),
);
ref.read(playBackModel.notifier).update((state) => newModel);
if (newModel != null) {
await ref.read(playbackModelHelper).shouldReload(newModel);
}
context.router.maybePop();
},
title: Text(entry.key.label(context)),
),
(entry) => RadioGroup(
groupValue: true,
onChanged: (value) async {
final newModel = await playbackModel?.setQualityOption(
qualityOptions.map(
(key, value) => MapEntry(key, key == entry.key ? true : false),
),
);
ref.read(playBackModel.notifier).update((state) => newModel);
if (newModel != null) {
await ref.read(playbackModelHelper).shouldReload(newModel);
}
context.router.maybePop();
},
child: RadioListTile(
value: entry.value,
title: Text(entry.key.label(context)),
)),
)
.toList() ??
[],

View file

@ -14,7 +14,7 @@ final applicationInfoProvider = StateProvider<ApplicationInfo>((ref) {
});
@Freezed(toJson: false, fromJson: false)
class ApplicationInfo with _$ApplicationInfo {
abstract class ApplicationInfo with _$ApplicationInfo {
const ApplicationInfo._();
factory ApplicationInfo({

View file

@ -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,23 +9,183 @@ part of 'application_info.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 _$ApplicationInfo {
String get name => throw _privateConstructorUsedError;
String get version => throw _privateConstructorUsedError;
String get buildNumber => throw _privateConstructorUsedError;
String get os => throw _privateConstructorUsedError;
String get name;
String get version;
String get buildNumber;
String get os;
}
/// Adds pattern-matching-related methods to [ApplicationInfo].
extension ApplicationInfoPatterns on ApplicationInfo {
/// 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(_ApplicationInfo value)? $default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _ApplicationInfo() 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(_ApplicationInfo value) $default,
) {
final _that = this;
switch (_that) {
case _ApplicationInfo():
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(_ApplicationInfo value)? $default,
) {
final _that = this;
switch (_that) {
case _ApplicationInfo() 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 name, String version, String buildNumber, String os)?
$default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _ApplicationInfo() when $default != null:
return $default(_that.name, _that.version, _that.buildNumber, _that.os);
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 name, String version, String buildNumber, String os)
$default,
) {
final _that = this;
switch (_that) {
case _ApplicationInfo():
return $default(_that.name, _that.version, _that.buildNumber, _that.os);
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 name, String version, String buildNumber, String os)?
$default,
) {
final _that = this;
switch (_that) {
case _ApplicationInfo() when $default != null:
return $default(_that.name, _that.version, _that.buildNumber, _that.os);
case _:
return null;
}
}
}
/// @nodoc
class _$ApplicationInfoImpl extends _ApplicationInfo {
_$ApplicationInfoImpl(
class _ApplicationInfo extends ApplicationInfo {
_ApplicationInfo(
{required this.name,
required this.version,
required this.buildNumber,
@ -42,20 +202,4 @@ class _$ApplicationInfoImpl extends _ApplicationInfo {
final String os;
}
abstract class _ApplicationInfo extends ApplicationInfo {
factory _ApplicationInfo(
{required final String name,
required final String version,
required final String buildNumber,
required final String os}) = _$ApplicationInfoImpl;
_ApplicationInfo._() : super._();
@override
String get name;
@override
String get version;
@override
String get buildNumber;
@override
String get os;
}
// dart format on

View file

@ -1,82 +0,0 @@
import 'dart:convert';
import 'dart:developer';
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:drift/drift.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:isar/isar.dart';
import 'package:path/path.dart' as path;
import 'package:path_provider/path_provider.dart';
import 'package:fladder/models/syncing/database_item.dart';
import 'package:fladder/models/syncing/i_synced_item.dart';
import 'package:fladder/models/syncing/sync_item.dart';
Future<void> isarMigration(Ref ref, AppDatabase db, String savePath) async {
if (kIsWeb) return;
//Return if the database is already migrated or not empty
final isNotEmtpy = await db.select(db.databaseItems).get().then((value) => value.isNotEmpty);
if (isNotEmtpy) {
log('Drift database is not empty, skipping migration');
return;
}
//Open isar database
final applicationDirectory = await getApplicationDocumentsDirectory();
final isarPath = Directory(path.joinAll([applicationDirectory.path, 'Fladder', 'Database']));
await isarPath.create(recursive: true);
final isar = Isar.open(
schemas: [ISyncedItemSchema],
directory: isarPath.path,
);
//Fetch all synced items from the old database
List<SyncedItem> items = isar.iSyncedItems
.where()
.findAll()
.map((e) => SyncedItem.fromIsar(e, path.joinAll([savePath, e.userId ?? "Unkown User"])))
.toList();
//Clear any missing paths
items = items.where((e) => e.path != null ? Directory(e.path!).existsSync() : false).toList();
//Convert to drift database items
final driftItems = items.map(
(item) => DatabaseItemsCompanion(
id: Value(item.id),
parentId: Value(item.parentId),
syncing: Value(item.syncing),
userId: Value(item.userId),
path: Value(item.path),
fileSize: Value(item.fileSize),
sortName: Value(item.sortName),
videoFileName: Value(item.videoFileName),
trickPlayModel: Value(item.fTrickPlayModel != null ? jsonEncode(item.fTrickPlayModel?.toJson()) : null),
mediaSegments: Value(item.mediaSegments != null ? jsonEncode(item.mediaSegments?.toJson()) : null),
images: Value(item.fImages != null ? jsonEncode(item.fImages?.toJson()) : null),
chapters: Value(jsonEncode(item.fChapters.map((e) => e.toJson()).toList())),
subtitles: Value(jsonEncode(item.subtitles.map((e) => e.toJson()).toList())),
userData: Value(item.userData != null ? jsonEncode(item.userData?.toJson()) : null),
),
);
await db.batch((batch) {
batch.insertAll(
db.databaseItems,
driftItems,
mode: InsertMode.insertOrReplace,
);
});
isar.close();
//Delete isar database after a few versions?
// await Future.delayed(const Duration(seconds: 1));
// if (await isarPath.exists()) {
// log('Deleting old Fladder base folder: ${isarPath.path}');
// await isarPath.delete(recursive: true);
// }
}