chore: Update dependencies (#372)

Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
PartyDonut 2025-06-07 18:36:17 +02:00 committed by GitHub
parent 4220c68ca3
commit 34c9c5bd9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
65 changed files with 431 additions and 1910 deletions

View file

@ -7,7 +7,6 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:dynamic_color/dynamic_color.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:isar/isar.dart';
import 'package:package_info_plus/package_info_plus.dart';
@ -18,6 +17,7 @@ import 'package:smtc_windows/smtc_windows.dart' if (dart.library.html) 'package:
import 'package:universal_html/html.dart' as html;
import 'package:window_manager/window_manager.dart';
import 'package:fladder/l10n/generated/app_localizations.dart';
import 'package:fladder/models/account_model.dart';
import 'package:fladder/models/settings/arguments_model.dart';
import 'package:fladder/models/syncing/i_synced_item.dart';

View file

@ -4,8 +4,8 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:iconsax_plus/iconsax_plus.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:iconsax_plus/iconsax_plus.dart';
import 'package:fladder/jellyfin/jellyfin_open_api.swagger.dart';
import 'package:fladder/models/credentials_model.dart';
@ -16,7 +16,7 @@ import 'package:fladder/util/localization_helper.dart';
part 'account_model.freezed.dart';
part 'account_model.g.dart';
@freezed
@Freezed(copyWith: true)
class AccountModel with _$AccountModel {
const AccountModel._();

View file

@ -395,56 +395,6 @@ class _$AccountModelImpl extends _AccountModel with DiagnosticableTreeMixin {
..add(DiagnosticsProperty('userConfiguration', userConfiguration));
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$AccountModelImpl &&
(identical(other.name, name) || other.name == name) &&
(identical(other.id, id) || other.id == id) &&
(identical(other.avatar, avatar) || other.avatar == avatar) &&
(identical(other.lastUsed, lastUsed) ||
other.lastUsed == lastUsed) &&
(identical(other.authMethod, authMethod) ||
other.authMethod == authMethod) &&
(identical(other.localPin, localPin) ||
other.localPin == localPin) &&
(identical(other.credentials, credentials) ||
other.credentials == credentials) &&
const DeepCollectionEquality()
.equals(other._latestItemsExcludes, _latestItemsExcludes) &&
const DeepCollectionEquality()
.equals(other._searchQueryHistory, _searchQueryHistory) &&
(identical(other.quickConnectState, quickConnectState) ||
other.quickConnectState == quickConnectState) &&
const DeepCollectionEquality()
.equals(other._savedFilters, _savedFilters) &&
(identical(other.policy, policy) || other.policy == policy) &&
(identical(other.serverConfiguration, serverConfiguration) ||
other.serverConfiguration == serverConfiguration) &&
(identical(other.userConfiguration, userConfiguration) ||
other.userConfiguration == userConfiguration));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
name,
id,
avatar,
lastUsed,
authMethod,
localPin,
credentials,
const DeepCollectionEquality().hash(_latestItemsExcludes),
const DeepCollectionEquality().hash(_searchQueryHistory),
quickConnectState,
const DeepCollectionEquality().hash(_savedFilters),
policy,
serverConfiguration,
userConfiguration);
/// Create a copy of AccountModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)

View file

@ -108,34 +108,11 @@ class BoxSetModelMapper extends SubClassMapperBase<BoxSetModel> {
@override
final Function instantiate = _instantiate;
static BoxSetModel fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<BoxSetModel>(map);
}
static BoxSetModel fromJson(String json) {
return ensureInitialized().decodeJson<BoxSetModel>(json);
}
}
mixin BoxSetModelMappable {
String toJson() {
return BoxSetModelMapper.ensureInitialized()
.encodeJson<BoxSetModel>(this as BoxSetModel);
}
Map<String, dynamic> toMap() {
return BoxSetModelMapper.ensureInitialized()
.encodeMap<BoxSetModel>(this as BoxSetModel);
}
BoxSetModelCopyWith<BoxSetModel, BoxSetModel, BoxSetModel> get copyWith =>
_BoxSetModelCopyWithImpl(this as BoxSetModel, $identity, $identity);
@override
String toString() {
return BoxSetModelMapper.ensureInitialized()
.stringifyValue(this as BoxSetModel);
}
}
extension BoxSetModelValueCopy<$R, $Out>

View file

@ -93,35 +93,12 @@ class ItemBaseModelMapper extends ClassMapperBase<ItemBaseModel> {
@override
final Function instantiate = _instantiate;
static ItemBaseModel fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<ItemBaseModel>(map);
}
static ItemBaseModel fromJson(String json) {
return ensureInitialized().decodeJson<ItemBaseModel>(json);
}
}
mixin ItemBaseModelMappable {
String toJson() {
return ItemBaseModelMapper.ensureInitialized()
.encodeJson<ItemBaseModel>(this as ItemBaseModel);
}
Map<String, dynamic> toMap() {
return ItemBaseModelMapper.ensureInitialized()
.encodeMap<ItemBaseModel>(this as ItemBaseModel);
}
ItemBaseModelCopyWith<ItemBaseModel, ItemBaseModel, ItemBaseModel>
get copyWith => _ItemBaseModelCopyWithImpl(
this as ItemBaseModel, $identity, $identity);
@override
String toString() {
return ItemBaseModelMapper.ensureInitialized()
.stringifyValue(this as ItemBaseModel);
}
}
extension ItemBaseModelValueCopy<$R, $Out>

View file

@ -141,34 +141,11 @@ class EpisodeModelMapper extends SubClassMapperBase<EpisodeModel> {
@override
final Function instantiate = _instantiate;
static EpisodeModel fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<EpisodeModel>(map);
}
static EpisodeModel fromJson(String json) {
return ensureInitialized().decodeJson<EpisodeModel>(json);
}
}
mixin EpisodeModelMappable {
String toJson() {
return EpisodeModelMapper.ensureInitialized()
.encodeJson<EpisodeModel>(this as EpisodeModel);
}
Map<String, dynamic> toMap() {
return EpisodeModelMapper.ensureInitialized()
.encodeMap<EpisodeModel>(this as EpisodeModel);
}
EpisodeModelCopyWith<EpisodeModel, EpisodeModel, EpisodeModel> get copyWith =>
_EpisodeModelCopyWithImpl(this as EpisodeModel, $identity, $identity);
@override
String toString() {
return EpisodeModelMapper.ensureInitialized()
.stringifyValue(this as EpisodeModel);
}
}
extension EpisodeModelValueCopy<$R, $Out>

View file

@ -108,34 +108,11 @@ class FolderModelMapper extends SubClassMapperBase<FolderModel> {
@override
final Function instantiate = _instantiate;
static FolderModel fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<FolderModel>(map);
}
static FolderModel fromJson(String json) {
return ensureInitialized().decodeJson<FolderModel>(json);
}
}
mixin FolderModelMappable {
String toJson() {
return FolderModelMapper.ensureInitialized()
.encodeJson<FolderModel>(this as FolderModel);
}
Map<String, dynamic> toMap() {
return FolderModelMapper.ensureInitialized()
.encodeMap<FolderModel>(this as FolderModel);
}
FolderModelCopyWith<FolderModel, FolderModel, FolderModel> get copyWith =>
_FolderModelCopyWithImpl(this as FolderModel, $identity, $identity);
@override
String toString() {
return FolderModelMapper.ensureInitialized()
.stringifyValue(this as FolderModel);
}
}
extension FolderModelValueCopy<$R, $Out>

View file

@ -18,92 +18,6 @@ final _privateConstructorUsedError = UnsupportedError(
mixin _$ItemPropertiesModel {
bool get canDelete => throw _privateConstructorUsedError;
bool get canDownload => throw _privateConstructorUsedError;
/// Create a copy of ItemPropertiesModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ItemPropertiesModelCopyWith<ItemPropertiesModel> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ItemPropertiesModelCopyWith<$Res> {
factory $ItemPropertiesModelCopyWith(
ItemPropertiesModel value, $Res Function(ItemPropertiesModel) then) =
_$ItemPropertiesModelCopyWithImpl<$Res, ItemPropertiesModel>;
@useResult
$Res call({bool canDelete, bool canDownload});
}
/// @nodoc
class _$ItemPropertiesModelCopyWithImpl<$Res, $Val extends ItemPropertiesModel>
implements $ItemPropertiesModelCopyWith<$Res> {
_$ItemPropertiesModelCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of ItemPropertiesModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? canDelete = null,
Object? canDownload = null,
}) {
return _then(_value.copyWith(
canDelete: null == canDelete
? _value.canDelete
: canDelete // ignore: cast_nullable_to_non_nullable
as bool,
canDownload: null == canDownload
? _value.canDownload
: canDownload // ignore: cast_nullable_to_non_nullable
as bool,
) as $Val);
}
}
/// @nodoc
abstract class _$$ItemPropertiesModelImplCopyWith<$Res>
implements $ItemPropertiesModelCopyWith<$Res> {
factory _$$ItemPropertiesModelImplCopyWith(_$ItemPropertiesModelImpl value,
$Res Function(_$ItemPropertiesModelImpl) then) =
__$$ItemPropertiesModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({bool canDelete, bool canDownload});
}
/// @nodoc
class __$$ItemPropertiesModelImplCopyWithImpl<$Res>
extends _$ItemPropertiesModelCopyWithImpl<$Res, _$ItemPropertiesModelImpl>
implements _$$ItemPropertiesModelImplCopyWith<$Res> {
__$$ItemPropertiesModelImplCopyWithImpl(_$ItemPropertiesModelImpl _value,
$Res Function(_$ItemPropertiesModelImpl) _then)
: super(_value, _then);
/// Create a copy of ItemPropertiesModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? canDelete = null,
Object? canDownload = null,
}) {
return _then(_$ItemPropertiesModelImpl(
canDelete: null == canDelete
? _value.canDelete
: canDelete // ignore: cast_nullable_to_non_nullable
as bool,
canDownload: null == canDownload
? _value.canDownload
: canDownload // ignore: cast_nullable_to_non_nullable
as bool,
));
}
}
/// @nodoc
@ -122,29 +36,6 @@ class _$ItemPropertiesModelImpl extends _ItemPropertiesModel {
String toString() {
return 'ItemPropertiesModel._internal(canDelete: $canDelete, canDownload: $canDownload)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ItemPropertiesModelImpl &&
(identical(other.canDelete, canDelete) ||
other.canDelete == canDelete) &&
(identical(other.canDownload, canDownload) ||
other.canDownload == canDownload));
}
@override
int get hashCode => Object.hash(runtimeType, canDelete, canDownload);
/// Create a copy of ItemPropertiesModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ItemPropertiesModelImplCopyWith<_$ItemPropertiesModelImpl> get copyWith =>
__$$ItemPropertiesModelImplCopyWithImpl<_$ItemPropertiesModelImpl>(
this, _$identity);
}
abstract class _ItemPropertiesModel extends ItemPropertiesModel {
@ -157,11 +48,4 @@ abstract class _ItemPropertiesModel extends ItemPropertiesModel {
bool get canDelete;
@override
bool get canDownload;
/// Create a copy of ItemPropertiesModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ItemPropertiesModelImplCopyWith<_$ItemPropertiesModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View file

@ -14,7 +14,7 @@ import 'package:fladder/models/items/images_models.dart';
part 'item_shared_models.mapper.dart';
@MappableClass()
@MappableClass(generateMethods: GenerateMethods.encode | GenerateMethods.decode | GenerateMethods.copy)
class UserData with UserDataMappable {
final bool isFavourite;
final int playCount;

View file

@ -92,10 +92,6 @@ mixin UserDataMappable {
UserDataCopyWith<UserData, UserData, UserData> get copyWith =>
_UserDataCopyWithImpl(this as UserData, $identity, $identity);
@override
String toString() {
return UserDataMapper.ensureInitialized().stringifyValue(this as UserData);
}
}
extension UserDataValueCopy<$R, $Out> on ObjectCopyWith<$R, UserData, $Out> {

View file

@ -112,35 +112,12 @@ class ItemStreamModelMapper extends SubClassMapperBase<ItemStreamModel> {
@override
final Function instantiate = _instantiate;
static ItemStreamModel fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<ItemStreamModel>(map);
}
static ItemStreamModel fromJson(String json) {
return ensureInitialized().decodeJson<ItemStreamModel>(json);
}
}
mixin ItemStreamModelMappable {
String toJson() {
return ItemStreamModelMapper.ensureInitialized()
.encodeJson<ItemStreamModel>(this as ItemStreamModel);
}
Map<String, dynamic> toMap() {
return ItemStreamModelMapper.ensureInitialized()
.encodeMap<ItemStreamModel>(this as ItemStreamModel);
}
ItemStreamModelCopyWith<ItemStreamModel, ItemStreamModel, ItemStreamModel>
get copyWith => _ItemStreamModelCopyWithImpl(
this as ItemStreamModel, $identity, $identity);
@override
String toString() {
return ItemStreamModelMapper.ensureInitialized()
.stringifyValue(this as ItemStreamModel);
}
}
extension ItemStreamModelValueCopy<$R, $Out>

View file

@ -24,82 +24,6 @@ mixin _$MediaSegmentsModel {
/// Serializes this MediaSegmentsModel to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of MediaSegmentsModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$MediaSegmentsModelCopyWith<MediaSegmentsModel> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $MediaSegmentsModelCopyWith<$Res> {
factory $MediaSegmentsModelCopyWith(
MediaSegmentsModel value, $Res Function(MediaSegmentsModel) then) =
_$MediaSegmentsModelCopyWithImpl<$Res, MediaSegmentsModel>;
@useResult
$Res call({List<MediaSegment> segments});
}
/// @nodoc
class _$MediaSegmentsModelCopyWithImpl<$Res, $Val extends MediaSegmentsModel>
implements $MediaSegmentsModelCopyWith<$Res> {
_$MediaSegmentsModelCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of MediaSegmentsModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? segments = null,
}) {
return _then(_value.copyWith(
segments: null == segments
? _value.segments
: segments // ignore: cast_nullable_to_non_nullable
as List<MediaSegment>,
) as $Val);
}
}
/// @nodoc
abstract class _$$MediaSegmentsModelImplCopyWith<$Res>
implements $MediaSegmentsModelCopyWith<$Res> {
factory _$$MediaSegmentsModelImplCopyWith(_$MediaSegmentsModelImpl value,
$Res Function(_$MediaSegmentsModelImpl) then) =
__$$MediaSegmentsModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({List<MediaSegment> segments});
}
/// @nodoc
class __$$MediaSegmentsModelImplCopyWithImpl<$Res>
extends _$MediaSegmentsModelCopyWithImpl<$Res, _$MediaSegmentsModelImpl>
implements _$$MediaSegmentsModelImplCopyWith<$Res> {
__$$MediaSegmentsModelImplCopyWithImpl(_$MediaSegmentsModelImpl _value,
$Res Function(_$MediaSegmentsModelImpl) _then)
: super(_value, _then);
/// Create a copy of MediaSegmentsModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? segments = null,
}) {
return _then(_$MediaSegmentsModelImpl(
segments: null == segments
? _value._segments
: segments // ignore: cast_nullable_to_non_nullable
as List<MediaSegment>,
));
}
}
/// @nodoc
@ -126,28 +50,6 @@ class _$MediaSegmentsModelImpl extends _MediaSegmentsModel {
return 'MediaSegmentsModel(segments: $segments)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$MediaSegmentsModelImpl &&
const DeepCollectionEquality().equals(other._segments, _segments));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode =>
Object.hash(runtimeType, const DeepCollectionEquality().hash(_segments));
/// Create a copy of MediaSegmentsModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$MediaSegmentsModelImplCopyWith<_$MediaSegmentsModelImpl> get copyWith =>
__$$MediaSegmentsModelImplCopyWithImpl<_$MediaSegmentsModelImpl>(
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$MediaSegmentsModelImplToJson(
@ -166,13 +68,6 @@ abstract class _MediaSegmentsModel extends MediaSegmentsModel {
@override
List<MediaSegment> get segments;
/// Create a copy of MediaSegmentsModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$MediaSegmentsModelImplCopyWith<_$MediaSegmentsModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}
MediaSegment _$MediaSegmentFromJson(Map<String, dynamic> json) {
@ -187,102 +82,6 @@ mixin _$MediaSegment {
/// Serializes this MediaSegment to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of MediaSegment
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$MediaSegmentCopyWith<MediaSegment> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $MediaSegmentCopyWith<$Res> {
factory $MediaSegmentCopyWith(
MediaSegment value, $Res Function(MediaSegment) then) =
_$MediaSegmentCopyWithImpl<$Res, MediaSegment>;
@useResult
$Res call({MediaSegmentType type, Duration start, Duration end});
}
/// @nodoc
class _$MediaSegmentCopyWithImpl<$Res, $Val extends MediaSegment>
implements $MediaSegmentCopyWith<$Res> {
_$MediaSegmentCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of MediaSegment
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? type = null,
Object? start = null,
Object? end = null,
}) {
return _then(_value.copyWith(
type: null == type
? _value.type
: type // ignore: cast_nullable_to_non_nullable
as MediaSegmentType,
start: null == start
? _value.start
: start // ignore: cast_nullable_to_non_nullable
as Duration,
end: null == end
? _value.end
: end // ignore: cast_nullable_to_non_nullable
as Duration,
) as $Val);
}
}
/// @nodoc
abstract class _$$MediaSegmentImplCopyWith<$Res>
implements $MediaSegmentCopyWith<$Res> {
factory _$$MediaSegmentImplCopyWith(
_$MediaSegmentImpl value, $Res Function(_$MediaSegmentImpl) then) =
__$$MediaSegmentImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({MediaSegmentType type, Duration start, Duration end});
}
/// @nodoc
class __$$MediaSegmentImplCopyWithImpl<$Res>
extends _$MediaSegmentCopyWithImpl<$Res, _$MediaSegmentImpl>
implements _$$MediaSegmentImplCopyWith<$Res> {
__$$MediaSegmentImplCopyWithImpl(
_$MediaSegmentImpl _value, $Res Function(_$MediaSegmentImpl) _then)
: super(_value, _then);
/// Create a copy of MediaSegment
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? type = null,
Object? start = null,
Object? end = null,
}) {
return _then(_$MediaSegmentImpl(
type: null == type
? _value.type
: type // ignore: cast_nullable_to_non_nullable
as MediaSegmentType,
start: null == start
? _value.start
: start // ignore: cast_nullable_to_non_nullable
as Duration,
end: null == end
? _value.end
: end // ignore: cast_nullable_to_non_nullable
as Duration,
));
}
}
/// @nodoc
@ -307,28 +106,6 @@ class _$MediaSegmentImpl extends _MediaSegment {
return 'MediaSegment(type: $type, start: $start, end: $end)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$MediaSegmentImpl &&
(identical(other.type, type) || other.type == type) &&
(identical(other.start, start) || other.start == start) &&
(identical(other.end, end) || other.end == end));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, type, start, end);
/// Create a copy of MediaSegment
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$MediaSegmentImplCopyWith<_$MediaSegmentImpl> get copyWith =>
__$$MediaSegmentImplCopyWithImpl<_$MediaSegmentImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$MediaSegmentImplToJson(
@ -353,11 +130,4 @@ abstract class _MediaSegment extends MediaSegment {
Duration get start;
@override
Duration get end;
/// Create a copy of MediaSegment
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$MediaSegmentImplCopyWith<_$MediaSegmentImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View file

@ -147,34 +147,11 @@ class MovieModelMapper extends SubClassMapperBase<MovieModel> {
@override
final Function instantiate = _instantiate;
static MovieModel fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<MovieModel>(map);
}
static MovieModel fromJson(String json) {
return ensureInitialized().decodeJson<MovieModel>(json);
}
}
mixin MovieModelMappable {
String toJson() {
return MovieModelMapper.ensureInitialized()
.encodeJson<MovieModel>(this as MovieModel);
}
Map<String, dynamic> toMap() {
return MovieModelMapper.ensureInitialized()
.encodeMap<MovieModel>(this as MovieModel);
}
MovieModelCopyWith<MovieModel, MovieModel, MovieModel> get copyWith =>
_MovieModelCopyWithImpl(this as MovieModel, $identity, $identity);
@override
String toString() {
return MovieModelMapper.ensureInitialized()
.stringifyValue(this as MovieModel);
}
}
extension MovieModelValueCopy<$R, $Out>

View file

@ -1,3 +1,4 @@
import 'package:dart_mappable/dart_mappable.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:fladder/jellyfin/jellyfin_open_api.swagger.dart';
@ -6,8 +7,6 @@ import 'package:fladder/models/items/item_shared_models.dart';
import 'package:fladder/models/items/trick_play_model.dart';
import 'package:fladder/util/duration_extensions.dart';
import 'package:dart_mappable/dart_mappable.dart';
part 'overview_model.mapper.dart';
@MappableClass()
@ -76,7 +75,4 @@ class OverviewModel with OverviewModelMappable {
people: Person.peopleFromDto(item.people ?? [], ref),
);
}
factory OverviewModel.fromMap(Map<String, dynamic> map) => OverviewModelMapper.fromMap(map);
factory OverviewModel.fromJson(String json) => OverviewModelMapper.fromJson(json);
}

View file

@ -114,35 +114,12 @@ class OverviewModelMapper extends ClassMapperBase<OverviewModel> {
@override
final Function instantiate = _instantiate;
static OverviewModel fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<OverviewModel>(map);
}
static OverviewModel fromJson(String json) {
return ensureInitialized().decodeJson<OverviewModel>(json);
}
}
mixin OverviewModelMappable {
String toJson() {
return OverviewModelMapper.ensureInitialized()
.encodeJson<OverviewModel>(this as OverviewModel);
}
Map<String, dynamic> toMap() {
return OverviewModelMapper.ensureInitialized()
.encodeMap<OverviewModel>(this as OverviewModel);
}
OverviewModelCopyWith<OverviewModel, OverviewModel, OverviewModel>
get copyWith => _OverviewModelCopyWithImpl(
this as OverviewModel, $identity, $identity);
@override
String toString() {
return OverviewModelMapper.ensureInitialized()
.stringifyValue(this as OverviewModel);
}
}
extension OverviewModelValueCopy<$R, $Out>

View file

@ -124,34 +124,11 @@ class PersonModelMapper extends SubClassMapperBase<PersonModel> {
@override
final Function instantiate = _instantiate;
static PersonModel fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<PersonModel>(map);
}
static PersonModel fromJson(String json) {
return ensureInitialized().decodeJson<PersonModel>(json);
}
}
mixin PersonModelMappable {
String toJson() {
return PersonModelMapper.ensureInitialized()
.encodeJson<PersonModel>(this as PersonModel);
}
Map<String, dynamic> toMap() {
return PersonModelMapper.ensureInitialized()
.encodeMap<PersonModel>(this as PersonModel);
}
PersonModelCopyWith<PersonModel, PersonModel, PersonModel> get copyWith =>
_PersonModelCopyWithImpl(this as PersonModel, $identity, $identity);
@override
String toString() {
return PersonModelMapper.ensureInitialized()
.stringifyValue(this as PersonModel);
}
}
extension PersonModelValueCopy<$R, $Out>

View file

@ -108,35 +108,12 @@ class PhotoAlbumModelMapper extends SubClassMapperBase<PhotoAlbumModel> {
@override
final Function instantiate = _instantiate;
static PhotoAlbumModel fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<PhotoAlbumModel>(map);
}
static PhotoAlbumModel fromJson(String json) {
return ensureInitialized().decodeJson<PhotoAlbumModel>(json);
}
}
mixin PhotoAlbumModelMappable {
String toJson() {
return PhotoAlbumModelMapper.ensureInitialized()
.encodeJson<PhotoAlbumModel>(this as PhotoAlbumModel);
}
Map<String, dynamic> toMap() {
return PhotoAlbumModelMapper.ensureInitialized()
.encodeMap<PhotoAlbumModel>(this as PhotoAlbumModel);
}
PhotoAlbumModelCopyWith<PhotoAlbumModel, PhotoAlbumModel, PhotoAlbumModel>
get copyWith => _PhotoAlbumModelCopyWithImpl(
this as PhotoAlbumModel, $identity, $identity);
@override
String toString() {
return PhotoAlbumModelMapper.ensureInitialized()
.stringifyValue(this as PhotoAlbumModel);
}
}
extension PhotoAlbumModelValueCopy<$R, $Out>
@ -359,34 +336,11 @@ class PhotoModelMapper extends SubClassMapperBase<PhotoModel> {
@override
final Function instantiate = _instantiate;
static PhotoModel fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<PhotoModel>(map);
}
static PhotoModel fromJson(String json) {
return ensureInitialized().decodeJson<PhotoModel>(json);
}
}
mixin PhotoModelMappable {
String toJson() {
return PhotoModelMapper.ensureInitialized()
.encodeJson<PhotoModel>(this as PhotoModel);
}
Map<String, dynamic> toMap() {
return PhotoModelMapper.ensureInitialized()
.encodeMap<PhotoModel>(this as PhotoModel);
}
PhotoModelCopyWith<PhotoModel, PhotoModel, PhotoModel> get copyWith =>
_PhotoModelCopyWithImpl(this as PhotoModel, $identity, $identity);
@override
String toString() {
return PhotoModelMapper.ensureInitialized()
.stringifyValue(this as PhotoModel);
}
}
extension PhotoModelValueCopy<$R, $Out>

View file

@ -137,34 +137,11 @@ class SeasonModelMapper extends SubClassMapperBase<SeasonModel> {
@override
final Function instantiate = _instantiate;
static SeasonModel fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<SeasonModel>(map);
}
static SeasonModel fromJson(String json) {
return ensureInitialized().decodeJson<SeasonModel>(json);
}
}
mixin SeasonModelMappable {
String toJson() {
return SeasonModelMapper.ensureInitialized()
.encodeJson<SeasonModel>(this as SeasonModel);
}
Map<String, dynamic> toMap() {
return SeasonModelMapper.ensureInitialized()
.encodeMap<SeasonModel>(this as SeasonModel);
}
SeasonModelCopyWith<SeasonModel, SeasonModel, SeasonModel> get copyWith =>
_SeasonModelCopyWithImpl(this as SeasonModel, $identity, $identity);
@override
String toString() {
return SeasonModelMapper.ensureInitialized()
.stringifyValue(this as SeasonModel);
}
}
extension SeasonModelValueCopy<$R, $Out>

View file

@ -135,34 +135,11 @@ class SeriesModelMapper extends SubClassMapperBase<SeriesModel> {
@override
final Function instantiate = _instantiate;
static SeriesModel fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<SeriesModel>(map);
}
static SeriesModel fromJson(String json) {
return ensureInitialized().decodeJson<SeriesModel>(json);
}
}
mixin SeriesModelMappable {
String toJson() {
return SeriesModelMapper.ensureInitialized()
.encodeJson<SeriesModel>(this as SeriesModel);
}
Map<String, dynamic> toMap() {
return SeriesModelMapper.ensureInitialized()
.encodeMap<SeriesModel>(this as SeriesModel);
}
SeriesModelCopyWith<SeriesModel, SeriesModel, SeriesModel> get copyWith =>
_SeriesModelCopyWithImpl(this as SeriesModel, $identity, $identity);
@override
String toString() {
return SeriesModelMapper.ensureInitialized()
.stringifyValue(this as SeriesModel);
}
}
extension SeriesModelValueCopy<$R, $Out>

View file

@ -5,7 +5,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'trick_play_model.freezed.dart';
part 'trick_play_model.g.dart';
@freezed
@Freezed(copyWith: true)
class TrickPlayModel with _$TrickPlayModel {
factory TrickPlayModel({
required int width,

View file

@ -225,36 +225,6 @@ class _$TrickPlayModelImpl extends _TrickPlayModel {
return 'TrickPlayModel(width: $width, height: $height, tileWidth: $tileWidth, tileHeight: $tileHeight, thumbnailCount: $thumbnailCount, interval: $interval, images: $images)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$TrickPlayModelImpl &&
(identical(other.width, width) || other.width == width) &&
(identical(other.height, height) || other.height == height) &&
(identical(other.tileWidth, tileWidth) ||
other.tileWidth == tileWidth) &&
(identical(other.tileHeight, tileHeight) ||
other.tileHeight == tileHeight) &&
(identical(other.thumbnailCount, thumbnailCount) ||
other.thumbnailCount == thumbnailCount) &&
(identical(other.interval, interval) ||
other.interval == interval) &&
const DeepCollectionEquality().equals(other._images, _images));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
width,
height,
tileWidth,
tileHeight,
thumbnailCount,
interval,
const DeepCollectionEquality().hash(_images));
/// Create a copy of TrickPlayModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)

View file

@ -14,7 +14,7 @@ import 'package:fladder/util/map_bool_helper.dart';
part 'library_filters_model.freezed.dart';
part 'library_filters_model.g.dart';
@freezed
@Freezed(copyWith: true)
class LibraryFiltersModel with _$LibraryFiltersModel {
const LibraryFiltersModel._();
@ -40,11 +40,16 @@ class LibraryFiltersModel with _$LibraryFiltersModel {
factory LibraryFiltersModel.fromJson(Map<String, dynamic> json) => _$LibraryFiltersModelFromJson(json);
factory LibraryFiltersModel.fromLibrarySearch(String name, LibrarySearchModel searchModel) {
factory LibraryFiltersModel.fromLibrarySearch(
String name,
LibrarySearchModel searchModel, {
bool? isFavourite,
String? id,
}) {
return LibraryFiltersModel._internal(
id: Xid().toString(),
id: id ?? Xid().toString(),
name: name,
isFavourite: false,
isFavourite: isFavourite ?? false,
ids: searchModel.views.included.map((e) => e.id).toList(),
genres: searchModel.genres,
filters: searchModel.filters,

View file

@ -436,59 +436,6 @@ class _$LibraryFiltersModelImpl extends _LibraryFiltersModel {
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)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$LibraryFiltersModelImpl &&
(identical(other.id, id) || other.id == id) &&
(identical(other.name, name) || other.name == name) &&
(identical(other.isFavourite, isFavourite) ||
other.isFavourite == isFavourite) &&
const DeepCollectionEquality().equals(other._ids, _ids) &&
const DeepCollectionEquality().equals(other._genres, _genres) &&
const DeepCollectionEquality().equals(other._filters, _filters) &&
const DeepCollectionEquality().equals(other._studios, _studios) &&
const DeepCollectionEquality().equals(other._tags, _tags) &&
const DeepCollectionEquality().equals(other._years, _years) &&
const DeepCollectionEquality()
.equals(other._officialRatings, _officialRatings) &&
const DeepCollectionEquality().equals(other._types, _types) &&
(identical(other.sortingOption, sortingOption) ||
other.sortingOption == sortingOption) &&
(identical(other.sortOrder, sortOrder) ||
other.sortOrder == sortOrder) &&
(identical(other.favourites, favourites) ||
other.favourites == favourites) &&
(identical(other.hideEmptyShows, hideEmptyShows) ||
other.hideEmptyShows == hideEmptyShows) &&
(identical(other.recursive, recursive) ||
other.recursive == recursive) &&
(identical(other.groupBy, groupBy) || other.groupBy == groupBy));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
id,
name,
isFavourite,
const DeepCollectionEquality().hash(_ids),
const DeepCollectionEquality().hash(_genres),
const DeepCollectionEquality().hash(_filters),
const DeepCollectionEquality().hash(_studios),
const DeepCollectionEquality().hash(_tags),
const DeepCollectionEquality().hash(_years),
const DeepCollectionEquality().hash(_officialRatings),
const DeepCollectionEquality().hash(_types),
sortingOption,
sortOrder,
favourites,
hideEmptyShows,
recursive,
groupBy);
/// Create a copy of LibraryFiltersModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)

View file

@ -177,36 +177,13 @@ class LibrarySearchModelMapper extends ClassMapperBase<LibrarySearchModel> {
@override
final Function instantiate = _instantiate;
static LibrarySearchModel fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<LibrarySearchModel>(map);
}
static LibrarySearchModel fromJson(String json) {
return ensureInitialized().decodeJson<LibrarySearchModel>(json);
}
}
mixin LibrarySearchModelMappable {
String toJson() {
return LibrarySearchModelMapper.ensureInitialized()
.encodeJson<LibrarySearchModel>(this as LibrarySearchModel);
}
Map<String, dynamic> toMap() {
return LibrarySearchModelMapper.ensureInitialized()
.encodeMap<LibrarySearchModel>(this as LibrarySearchModel);
}
LibrarySearchModelCopyWith<LibrarySearchModel, LibrarySearchModel,
LibrarySearchModel>
get copyWith => _LibrarySearchModelCopyWithImpl(
this as LibrarySearchModel, $identity, $identity);
@override
String toString() {
return LibrarySearchModelMapper.ensureInitialized()
.stringifyValue(this as LibrarySearchModel);
}
}
extension LibrarySearchModelValueCopy<$R, $Out>

View file

@ -17,82 +17,6 @@ final _privateConstructorUsedError = UnsupportedError(
/// @nodoc
mixin _$ArgumentsModel {
bool get htpcMode => throw _privateConstructorUsedError;
/// Create a copy of ArgumentsModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ArgumentsModelCopyWith<ArgumentsModel> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ArgumentsModelCopyWith<$Res> {
factory $ArgumentsModelCopyWith(
ArgumentsModel value, $Res Function(ArgumentsModel) then) =
_$ArgumentsModelCopyWithImpl<$Res, ArgumentsModel>;
@useResult
$Res call({bool htpcMode});
}
/// @nodoc
class _$ArgumentsModelCopyWithImpl<$Res, $Val extends ArgumentsModel>
implements $ArgumentsModelCopyWith<$Res> {
_$ArgumentsModelCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of ArgumentsModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? htpcMode = null,
}) {
return _then(_value.copyWith(
htpcMode: null == htpcMode
? _value.htpcMode
: htpcMode // ignore: cast_nullable_to_non_nullable
as bool,
) as $Val);
}
}
/// @nodoc
abstract class _$$ArgumentsModelImplCopyWith<$Res>
implements $ArgumentsModelCopyWith<$Res> {
factory _$$ArgumentsModelImplCopyWith(_$ArgumentsModelImpl value,
$Res Function(_$ArgumentsModelImpl) then) =
__$$ArgumentsModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({bool htpcMode});
}
/// @nodoc
class __$$ArgumentsModelImplCopyWithImpl<$Res>
extends _$ArgumentsModelCopyWithImpl<$Res, _$ArgumentsModelImpl>
implements _$$ArgumentsModelImplCopyWith<$Res> {
__$$ArgumentsModelImplCopyWithImpl(
_$ArgumentsModelImpl _value, $Res Function(_$ArgumentsModelImpl) _then)
: super(_value, _then);
/// Create a copy of ArgumentsModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? htpcMode = null,
}) {
return _then(_$ArgumentsModelImpl(
htpcMode: null == htpcMode
? _value.htpcMode
: htpcMode // ignore: cast_nullable_to_non_nullable
as bool,
));
}
}
/// @nodoc
@ -108,27 +32,6 @@ class _$ArgumentsModelImpl extends _ArgumentsModel {
String toString() {
return 'ArgumentsModel(htpcMode: $htpcMode)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ArgumentsModelImpl &&
(identical(other.htpcMode, htpcMode) ||
other.htpcMode == htpcMode));
}
@override
int get hashCode => Object.hash(runtimeType, htpcMode);
/// Create a copy of ArgumentsModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ArgumentsModelImplCopyWith<_$ArgumentsModelImpl> get copyWith =>
__$$ArgumentsModelImplCopyWithImpl<_$ArgumentsModelImpl>(
this, _$identity);
}
abstract class _ArgumentsModel extends ArgumentsModel {
@ -137,11 +40,4 @@ abstract class _ArgumentsModel extends ArgumentsModel {
@override
bool get htpcMode;
/// Create a copy of ArgumentsModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ArgumentsModelImplCopyWith<_$ArgumentsModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View file

@ -11,7 +11,7 @@ import 'package:fladder/util/custom_color_themes.dart';
part 'client_settings_model.freezed.dart';
part 'client_settings_model.g.dart';
@freezed
@Freezed(copyWith: true)
class ClientSettingsModel with _$ClientSettingsModel {
const ClientSettingsModel._();
factory ClientSettingsModel({

View file

@ -508,83 +508,6 @@ class _$ClientSettingsModelImpl extends _ClientSettingsModel
..add(DiagnosticsProperty('libraryPageSize', libraryPageSize));
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ClientSettingsModelImpl &&
(identical(other.syncPath, syncPath) ||
other.syncPath == syncPath) &&
(identical(other.position, position) ||
other.position == position) &&
(identical(other.size, size) || other.size == size) &&
(identical(other.timeOut, timeOut) || other.timeOut == timeOut) &&
(identical(other.nextUpDateCutoff, nextUpDateCutoff) ||
other.nextUpDateCutoff == nextUpDateCutoff) &&
(identical(other.themeMode, themeMode) ||
other.themeMode == themeMode) &&
(identical(other.themeColor, themeColor) ||
other.themeColor == themeColor) &&
(identical(other.amoledBlack, amoledBlack) ||
other.amoledBlack == amoledBlack) &&
(identical(other.blurPlaceHolders, blurPlaceHolders) ||
other.blurPlaceHolders == blurPlaceHolders) &&
(identical(other.blurUpcomingEpisodes, blurUpcomingEpisodes) ||
other.blurUpcomingEpisodes == blurUpcomingEpisodes) &&
(identical(other.selectedLocale, selectedLocale) ||
other.selectedLocale == selectedLocale) &&
(identical(other.enableMediaKeys, enableMediaKeys) ||
other.enableMediaKeys == enableMediaKeys) &&
(identical(other.posterSize, posterSize) ||
other.posterSize == posterSize) &&
(identical(other.pinchPosterZoom, pinchPosterZoom) ||
other.pinchPosterZoom == pinchPosterZoom) &&
(identical(other.mouseDragSupport, mouseDragSupport) ||
other.mouseDragSupport == mouseDragSupport) &&
(identical(other.requireWifi, requireWifi) ||
other.requireWifi == requireWifi) &&
(identical(other.showAllCollectionTypes, showAllCollectionTypes) ||
other.showAllCollectionTypes == showAllCollectionTypes) &&
(identical(other.maxConcurrentDownloads, maxConcurrentDownloads) ||
other.maxConcurrentDownloads == maxConcurrentDownloads) &&
(identical(other.schemeVariant, schemeVariant) ||
other.schemeVariant == schemeVariant) &&
(identical(other.checkForUpdates, checkForUpdates) ||
other.checkForUpdates == checkForUpdates) &&
(identical(other.lastViewedUpdate, lastViewedUpdate) ||
other.lastViewedUpdate == lastViewedUpdate) &&
(identical(other.libraryPageSize, libraryPageSize) ||
other.libraryPageSize == libraryPageSize));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hashAll([
runtimeType,
syncPath,
position,
size,
timeOut,
nextUpDateCutoff,
themeMode,
themeColor,
amoledBlack,
blurPlaceHolders,
blurUpcomingEpisodes,
selectedLocale,
enableMediaKeys,
posterSize,
pinchPosterZoom,
mouseDragSupport,
requireWifi,
showAllCollectionTypes,
maxConcurrentDownloads,
schemeVariant,
checkForUpdates,
lastViewedUpdate,
libraryPageSize
]);
/// Create a copy of ClientSettingsModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)

View file

@ -8,7 +8,7 @@ import 'package:fladder/util/localization_helper.dart';
part 'home_settings_model.freezed.dart';
part 'home_settings_model.g.dart';
@freezed
@Freezed(copyWith: true)
class HomeSettingsModel with _$HomeSettingsModel {
factory HomeSettingsModel({
@Default({...LayoutMode.values}) Set<LayoutMode> screenLayouts,

View file

@ -205,32 +205,6 @@ class _$HomeSettingsModelImpl implements _HomeSettingsModel {
return 'HomeSettingsModel(screenLayouts: $screenLayouts, layoutStates: $layoutStates, homeBanner: $homeBanner, carouselSettings: $carouselSettings, nextUp: $nextUp)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$HomeSettingsModelImpl &&
const DeepCollectionEquality()
.equals(other._screenLayouts, _screenLayouts) &&
const DeepCollectionEquality()
.equals(other._layoutStates, _layoutStates) &&
(identical(other.homeBanner, homeBanner) ||
other.homeBanner == homeBanner) &&
(identical(other.carouselSettings, carouselSettings) ||
other.carouselSettings == carouselSettings) &&
(identical(other.nextUp, nextUp) || other.nextUp == nextUp));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
const DeepCollectionEquality().hash(_screenLayouts),
const DeepCollectionEquality().hash(_layoutStates),
homeBanner,
carouselSettings,
nextUp);
/// Create a copy of HomeSettingsModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)

View file

@ -12,7 +12,7 @@ import 'package:fladder/util/localization_helper.dart';
part 'video_player_settings.freezed.dart';
part 'video_player_settings.g.dart';
@freezed
@Freezed(copyWith: true)
class VideoPlayerSettingsModel with _$VideoPlayerSettingsModel {
const VideoPlayerSettingsModel._();
@ -43,7 +43,10 @@ class VideoPlayerSettingsModel with _$VideoPlayerSettingsModel {
PlayerOptions get wantedPlayer => playerOptions ?? PlayerOptions.platformDefaults;
bool playerSame(VideoPlayerSettingsModel other) {
return other.hardwareAccel == hardwareAccel && other.useLibass == useLibass && other.bufferSize == bufferSize && other.wantedPlayer == wantedPlayer;
return other.hardwareAccel == hardwareAccel &&
other.useLibass == useLibass &&
other.bufferSize == bufferSize &&
other.wantedPlayer == wantedPlayer;
}
@override

View file

@ -4,17 +4,17 @@ import 'dart:io';
import 'package:flutter/material.dart';
import 'package:background_downloader/background_downloader.dart';
import 'package:iconsax_plus/iconsax_plus.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:iconsax_plus/iconsax_plus.dart';
import 'package:path/path.dart';
import 'package:fladder/jellyfin/jellyfin_open_api.swagger.dart';
import 'package:fladder/models/item_base_model.dart';
import 'package:fladder/models/items/chapters_model.dart';
import 'package:fladder/models/items/images_models.dart';
import 'package:fladder/models/items/media_segments_model.dart';
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';
@ -24,7 +24,7 @@ import 'package:fladder/util/localization_helper.dart';
part 'sync_item.freezed.dart';
@freezed
@Freezed(copyWith: true)
class SyncedItem with _$SyncedItem {
const SyncedItem._();

View file

@ -63,7 +63,6 @@ abstract class $SyncedItemCopyWith<$Res> {
List<SubStreamModel> subtitles,
@UserDataJsonSerializer() UserData? userData});
$MediaSegmentsModelCopyWith<$Res>? get mediaSegments;
$TrickPlayModelCopyWith<$Res>? get fTrickPlayModel;
}
@ -162,20 +161,6 @@ class _$SyncedItemCopyWithImpl<$Res, $Val extends SyncedItem>
) as $Val);
}
/// Create a copy of SyncedItem
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$MediaSegmentsModelCopyWith<$Res>? get mediaSegments {
if (_value.mediaSegments == null) {
return null;
}
return $MediaSegmentsModelCopyWith<$Res>(_value.mediaSegments!, (value) {
return _then(_value.copyWith(mediaSegments: value) as $Val);
});
}
/// Create a copy of SyncedItem
/// with the given fields replaced by the non-null parameter values.
@override
@ -216,8 +201,6 @@ abstract class _$$SyncItemImplCopyWith<$Res>
List<SubStreamModel> subtitles,
@UserDataJsonSerializer() UserData? userData});
@override
$MediaSegmentsModelCopyWith<$Res>? get mediaSegments;
@override
$TrickPlayModelCopyWith<$Res>? get fTrickPlayModel;
}
@ -392,57 +375,6 @@ class _$SyncItemImpl extends _SyncItem {
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, userData: $userData)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$SyncItemImpl &&
(identical(other.id, id) || other.id == id) &&
(identical(other.syncing, syncing) || other.syncing == syncing) &&
(identical(other.parentId, parentId) ||
other.parentId == parentId) &&
(identical(other.userId, userId) || other.userId == userId) &&
(identical(other.path, path) || other.path == path) &&
(identical(other.markedForDelete, markedForDelete) ||
other.markedForDelete == markedForDelete) &&
(identical(other.sortName, sortName) ||
other.sortName == sortName) &&
(identical(other.fileSize, fileSize) ||
other.fileSize == fileSize) &&
(identical(other.videoFileName, videoFileName) ||
other.videoFileName == videoFileName) &&
(identical(other.mediaSegments, mediaSegments) ||
other.mediaSegments == mediaSegments) &&
(identical(other.fTrickPlayModel, fTrickPlayModel) ||
other.fTrickPlayModel == fTrickPlayModel) &&
(identical(other.fImages, fImages) || other.fImages == fImages) &&
const DeepCollectionEquality()
.equals(other._fChapters, _fChapters) &&
const DeepCollectionEquality()
.equals(other._subtitles, _subtitles) &&
(identical(other.userData, userData) ||
other.userData == userData));
}
@override
int get hashCode => Object.hash(
runtimeType,
id,
syncing,
parentId,
userId,
path,
markedForDelete,
sortName,
fileSize,
videoFileName,
mediaSegments,
fTrickPlayModel,
fImages,
const DeepCollectionEquality().hash(_fChapters),
const DeepCollectionEquality().hash(_subtitles),
userData);
/// Create a copy of SyncedItem
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)

View file

@ -6,7 +6,7 @@ import 'package:fladder/models/syncing/sync_item.dart';
part 'sync_settings_model.freezed.dart';
@Freezed(toJson: false, fromJson: false)
@Freezed(toJson: false, fromJson: false, copyWith: true)
class SyncSettingsModel with _$SyncSettingsModel {
const SyncSettingsModel._();

View file

@ -116,18 +116,6 @@ class _$SyncSettignsModelImpl extends _SyncSettignsModel {
return 'SyncSettingsModel(items: $items)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$SyncSettignsModelImpl &&
const DeepCollectionEquality().equals(other._items, _items));
}
@override
int get hashCode =>
Object.hash(runtimeType, const DeepCollectionEquality().hash(_items));
/// Create a copy of SyncSettingsModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)

View file

@ -4,9 +4,10 @@ import 'dart:developer';
import 'dart:io';
import 'package:dart_mappable/dart_mappable.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:fladder/jellyfin/jellyfin_open_api.swagger.dart';
import 'package:fladder/providers/service_provider.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
part 'discovery_provider.g.dart';
part 'discovery_provider.mapper.dart';
@ -81,7 +82,7 @@ class ServerDiscovery extends _$ServerDiscovery {
}
}
@MappableClass()
@MappableClass(generateMethods: GenerateMethods.encode | GenerateMethods.decode)
class DiscoveryInfo with DiscoveryInfoMappable {
@MappableField(key: 'Id')
final String id;

View file

@ -73,58 +73,4 @@ mixin DiscoveryInfoMappable {
return DiscoveryInfoMapper.ensureInitialized()
.encodeMap<DiscoveryInfo>(this as DiscoveryInfo);
}
DiscoveryInfoCopyWith<DiscoveryInfo, DiscoveryInfo, DiscoveryInfo>
get copyWith => _DiscoveryInfoCopyWithImpl(
this as DiscoveryInfo, $identity, $identity);
@override
String toString() {
return DiscoveryInfoMapper.ensureInitialized()
.stringifyValue(this as DiscoveryInfo);
}
}
extension DiscoveryInfoValueCopy<$R, $Out>
on ObjectCopyWith<$R, DiscoveryInfo, $Out> {
DiscoveryInfoCopyWith<$R, DiscoveryInfo, $Out> get $asDiscoveryInfo =>
$base.as((v, t, t2) => _DiscoveryInfoCopyWithImpl(v, t, t2));
}
abstract class DiscoveryInfoCopyWith<$R, $In extends DiscoveryInfo, $Out>
implements ClassCopyWith<$R, $In, $Out> {
$R call({String? id, String? name, String? address, String? endPointAddress});
DiscoveryInfoCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t);
}
class _DiscoveryInfoCopyWithImpl<$R, $Out>
extends ClassCopyWithBase<$R, DiscoveryInfo, $Out>
implements DiscoveryInfoCopyWith<$R, DiscoveryInfo, $Out> {
_DiscoveryInfoCopyWithImpl(super.value, super.then, super.then2);
@override
late final ClassMapperBase<DiscoveryInfo> $mapper =
DiscoveryInfoMapper.ensureInitialized();
@override
$R call(
{String? id,
String? name,
String? address,
Object? endPointAddress = $none}) =>
$apply(FieldCopyWithData({
if (id != null) #id: id,
if (name != null) #name: name,
if (address != null) #address: address,
if (endPointAddress != $none) #endPointAddress: endPointAddress
}));
@override
DiscoveryInfo $make(CopyWithData data) => DiscoveryInfo(
id: data.get(#id, or: $value.id),
name: data.get(#name, or: $value.name),
address: data.get(#address, or: $value.address),
endPointAddress: data.get(#endPointAddress, or: $value.endPointAddress));
@override
DiscoveryInfoCopyWith<$R2, DiscoveryInfo, $Out2> $chain<$R2, $Out2>(
Then<$Out2, $R2> t) =>
_DiscoveryInfoCopyWithImpl($value, $cast, t);
}

View file

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

View file

@ -234,32 +234,6 @@ class _$LibraryScreenModelImpl implements _LibraryScreenModel {
return 'LibraryScreenModel(views: $views, selectedViewModel: $selectedViewModel, viewType: $viewType, recommendations: $recommendations, genres: $genres, favourites: $favourites)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$LibraryScreenModelImpl &&
const DeepCollectionEquality().equals(other._views, _views) &&
(identical(other.selectedViewModel, selectedViewModel) ||
other.selectedViewModel == selectedViewModel) &&
const DeepCollectionEquality().equals(other._viewType, _viewType) &&
const DeepCollectionEquality()
.equals(other._recommendations, _recommendations) &&
const DeepCollectionEquality().equals(other._genres, _genres) &&
const DeepCollectionEquality()
.equals(other._favourites, _favourites));
}
@override
int get hashCode => Object.hash(
runtimeType,
const DeepCollectionEquality().hash(_views),
selectedViewModel,
const DeepCollectionEquality().hash(_viewType),
const DeepCollectionEquality().hash(_recommendations),
const DeepCollectionEquality().hash(_genres),
const DeepCollectionEquality().hash(_favourites));
/// Create a copy of LibraryScreenModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)

View file

@ -709,10 +709,14 @@ class LibrarySearchNotifier extends StateNotifier<LibrarySearchModel> {
ref.read(filterProvider.notifier).saveFilter(LibraryFiltersModel.fromLibrarySearch(newName, state));
void updateFilter(LibraryFiltersModel model) {
ref.read(filterProvider.notifier).saveFilter(LibraryFiltersModel.fromLibrarySearch(model.name, state).copyWith(
isFavourite: model.isFavourite,
id: model.id,
));
ref.read(filterProvider.notifier).saveFilter(
LibraryFiltersModel.fromLibrarySearch(
model.name,
state,
isFavourite: model.isFavourite,
id: model.id,
),
);
}
}

View file

@ -25,92 +25,6 @@ mixin _$SessionInfoModel {
/// Serializes this SessionInfoModel to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of SessionInfoModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$SessionInfoModelCopyWith<SessionInfoModel> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $SessionInfoModelCopyWith<$Res> {
factory $SessionInfoModelCopyWith(
SessionInfoModel value, $Res Function(SessionInfoModel) then) =
_$SessionInfoModelCopyWithImpl<$Res, SessionInfoModel>;
@useResult
$Res call({String? playbackModel, TranscodingInfo? transCodeInfo});
}
/// @nodoc
class _$SessionInfoModelCopyWithImpl<$Res, $Val extends SessionInfoModel>
implements $SessionInfoModelCopyWith<$Res> {
_$SessionInfoModelCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of SessionInfoModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? playbackModel = freezed,
Object? transCodeInfo = freezed,
}) {
return _then(_value.copyWith(
playbackModel: freezed == playbackModel
? _value.playbackModel
: playbackModel // ignore: cast_nullable_to_non_nullable
as String?,
transCodeInfo: freezed == transCodeInfo
? _value.transCodeInfo
: transCodeInfo // ignore: cast_nullable_to_non_nullable
as TranscodingInfo?,
) as $Val);
}
}
/// @nodoc
abstract class _$$SessionInfoModelImplCopyWith<$Res>
implements $SessionInfoModelCopyWith<$Res> {
factory _$$SessionInfoModelImplCopyWith(_$SessionInfoModelImpl value,
$Res Function(_$SessionInfoModelImpl) then) =
__$$SessionInfoModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String? playbackModel, TranscodingInfo? transCodeInfo});
}
/// @nodoc
class __$$SessionInfoModelImplCopyWithImpl<$Res>
extends _$SessionInfoModelCopyWithImpl<$Res, _$SessionInfoModelImpl>
implements _$$SessionInfoModelImplCopyWith<$Res> {
__$$SessionInfoModelImplCopyWithImpl(_$SessionInfoModelImpl _value,
$Res Function(_$SessionInfoModelImpl) _then)
: super(_value, _then);
/// Create a copy of SessionInfoModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? playbackModel = freezed,
Object? transCodeInfo = freezed,
}) {
return _then(_$SessionInfoModelImpl(
playbackModel: freezed == playbackModel
? _value.playbackModel
: playbackModel // ignore: cast_nullable_to_non_nullable
as String?,
transCodeInfo: freezed == transCodeInfo
? _value.transCodeInfo
: transCodeInfo // ignore: cast_nullable_to_non_nullable
as TranscodingInfo?,
));
}
}
/// @nodoc
@ -131,30 +45,6 @@ class _$SessionInfoModelImpl extends _SessionInfoModel {
return 'SessionInfoModel(playbackModel: $playbackModel, transCodeInfo: $transCodeInfo)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$SessionInfoModelImpl &&
(identical(other.playbackModel, playbackModel) ||
other.playbackModel == playbackModel) &&
(identical(other.transCodeInfo, transCodeInfo) ||
other.transCodeInfo == transCodeInfo));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, playbackModel, transCodeInfo);
/// Create a copy of SessionInfoModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$SessionInfoModelImplCopyWith<_$SessionInfoModelImpl> get copyWith =>
__$$SessionInfoModelImplCopyWithImpl<_$SessionInfoModelImpl>(
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$SessionInfoModelImplToJson(
@ -176,11 +66,4 @@ abstract class _SessionInfoModel extends SessionInfoModel {
String? get playbackModel;
@override
TranscodingInfo? get transCodeInfo;
/// Create a copy of SessionInfoModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$SessionInfoModelImplCopyWith<_$SessionInfoModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View file

@ -12,9 +12,18 @@ import 'package:fladder/util/update_checker.dart';
part 'update_provider.freezed.dart';
part 'update_provider.g.dart';
final hasNewUpdateProvider = Provider<bool>((ref) =>
ref.watch(clientSettingsProvider.select((value) => value.lastViewedUpdate)) !=
ref.watch(updateProvider.select((value) => value.latestRelease?.version)));
final hasNewUpdateProvider = Provider<bool>((ref) {
final latestRelease = ref.watch(updateProvider).latestRelease;
final lastViewedVersion = ref.watch(clientSettingsProvider.select((value) => value.lastViewedUpdate));
final latestVersion = latestRelease?.version;
if (latestVersion == null || lastViewedVersion == null) {
return false;
}
return latestVersion != lastViewedVersion;
});
@Riverpod(keepAlive: true)
class Update extends _$Update {
@ -60,7 +69,7 @@ class Update extends _$Update {
Future<List<ReleaseInfo>> _fetchLatest() async {
final latest = await updateChecker.fetchRecentReleases();
state = state.copyWith(
state = UpdatesModel(
lastRelease: latest,
);
return latest;

View file

@ -17,82 +17,6 @@ final _privateConstructorUsedError = UnsupportedError(
/// @nodoc
mixin _$UpdatesModel {
List<ReleaseInfo> get lastRelease => throw _privateConstructorUsedError;
/// Create a copy of UpdatesModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$UpdatesModelCopyWith<UpdatesModel> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $UpdatesModelCopyWith<$Res> {
factory $UpdatesModelCopyWith(
UpdatesModel value, $Res Function(UpdatesModel) then) =
_$UpdatesModelCopyWithImpl<$Res, UpdatesModel>;
@useResult
$Res call({List<ReleaseInfo> lastRelease});
}
/// @nodoc
class _$UpdatesModelCopyWithImpl<$Res, $Val extends UpdatesModel>
implements $UpdatesModelCopyWith<$Res> {
_$UpdatesModelCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of UpdatesModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? lastRelease = null,
}) {
return _then(_value.copyWith(
lastRelease: null == lastRelease
? _value.lastRelease
: lastRelease // ignore: cast_nullable_to_non_nullable
as List<ReleaseInfo>,
) as $Val);
}
}
/// @nodoc
abstract class _$$UpdatesModelImplCopyWith<$Res>
implements $UpdatesModelCopyWith<$Res> {
factory _$$UpdatesModelImplCopyWith(
_$UpdatesModelImpl value, $Res Function(_$UpdatesModelImpl) then) =
__$$UpdatesModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({List<ReleaseInfo> lastRelease});
}
/// @nodoc
class __$$UpdatesModelImplCopyWithImpl<$Res>
extends _$UpdatesModelCopyWithImpl<$Res, _$UpdatesModelImpl>
implements _$$UpdatesModelImplCopyWith<$Res> {
__$$UpdatesModelImplCopyWithImpl(
_$UpdatesModelImpl _value, $Res Function(_$UpdatesModelImpl) _then)
: super(_value, _then);
/// Create a copy of UpdatesModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? lastRelease = null,
}) {
return _then(_$UpdatesModelImpl(
lastRelease: null == lastRelease
? _value._lastRelease
: lastRelease // ignore: cast_nullable_to_non_nullable
as List<ReleaseInfo>,
));
}
}
/// @nodoc
@ -123,27 +47,6 @@ class _$UpdatesModelImpl extends _UpdatesModel with DiagnosticableTreeMixin {
..add(DiagnosticsProperty('type', 'UpdatesModel'))
..add(DiagnosticsProperty('lastRelease', lastRelease));
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$UpdatesModelImpl &&
const DeepCollectionEquality()
.equals(other._lastRelease, _lastRelease));
}
@override
int get hashCode => Object.hash(
runtimeType, const DeepCollectionEquality().hash(_lastRelease));
/// Create a copy of UpdatesModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$UpdatesModelImplCopyWith<_$UpdatesModelImpl> get copyWith =>
__$$UpdatesModelImplCopyWithImpl<_$UpdatesModelImpl>(this, _$identity);
}
abstract class _UpdatesModel extends UpdatesModel {
@ -153,11 +56,4 @@ abstract class _UpdatesModel extends UpdatesModel {
@override
List<ReleaseInfo> get lastRelease;
/// Create a copy of UpdatesModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$UpdatesModelImplCopyWith<_$UpdatesModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View file

@ -6,7 +6,7 @@ part of 'update_provider.dart';
// RiverpodGenerator
// **************************************************************************
String _$updateHash() => r'97f7aca4e255d654a9295e1e9e019536faf6455e';
String _$updateHash() => r'e22205cb13e6b43df1296de90e39059f09bb80a8';
/// See also [Update].
@ProviderFor(Update)

View file

@ -178,7 +178,9 @@ class User extends _$User {
if (e.id == model.id) {
return model;
} else {
return e.copyWith(isFavourite: model.isFavourite && model.containsSameIds(e.ids) ? false : e.isFavourite);
return e.copyWith(
isFavourite: model.isFavourite && model.containsSameIds(e.ids) ? false : e.isFavourite,
);
}
},
).toList());

View file

@ -71,26 +71,22 @@ final AutoRoute _dashboardRoute = CustomRoute(
page: DashboardRoute.page,
transitionsBuilder: TransitionsBuilders.fadeIn,
initial: true,
maintainState: false,
path: 'dashboard',
);
final AutoRoute _favouritesRoute = CustomRoute(
page: FavouritesRoute.page,
transitionsBuilder: TransitionsBuilders.fadeIn,
maintainState: false,
path: 'favourites',
);
final AutoRoute _syncedRoute = CustomRoute(
page: SyncedRoute.page,
transitionsBuilder: TransitionsBuilders.fadeIn,
maintainState: false,
path: 'synced',
);
final AutoRoute _librariesRoute = CustomRoute(
page: LibraryRoute.page,
transitionsBuilder: TransitionsBuilders.fadeIn,
maintainState: false,
path: 'libraries',
);

View file

@ -240,8 +240,8 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
},
refreshOnStart: false,
child: CustomScrollView(
physics: const AlwaysScrollableNoImplicitScrollPhysics(),
controller: scrollController,
physics: const AlwaysScrollableScrollPhysics(),
slivers: [
SliverAppBar(
floating: !AdaptiveLayout.of(context).isDesktop,
@ -530,25 +530,6 @@ class _LibrarySearchScreenState extends ConsumerState<LibrarySearchScreen> {
}
}
class AlwaysScrollableNoImplicitScrollPhysics extends ScrollPhysics {
/// Creates scroll physics that always lets the user scroll.
const AlwaysScrollableNoImplicitScrollPhysics({super.parent});
@override
AlwaysScrollableNoImplicitScrollPhysics applyTo(ScrollPhysics? ancestor) {
return AlwaysScrollableNoImplicitScrollPhysics(parent: buildParent(ancestor));
}
@override
bool get allowImplicitScrolling => false;
@override
bool shouldAcceptUserOffset(ScrollMetrics position) => true;
@override
bool recommendDeferredLoading(double velocity, ScrollMetrics metrics, BuildContext context) => false;
}
class _LibrarySearchBottomBar extends ConsumerWidget {
final Key uniqueKey;
final ScrollController scrollController;

View file

@ -348,11 +348,11 @@ class _PhotoViewerControllsState extends ConsumerState<PhotoViewerControls> with
Future<void> sharePhoto() async {
final file = await DefaultCacheManager().getSingleFile(widget.photo.downloadPath(ref));
await Share.shareXFiles([
await SharePlus.instance.share(ShareParams(files: [
XFile(
file.path,
),
]);
]));
await file.delete();
}
}

View file

@ -1,6 +1,6 @@
import 'package:fladder/l10n/generated/app_localizations.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:fladder/providers/settings/client_settings_provider.dart';

View file

@ -46,6 +46,7 @@ class _SettingsUpdateInformationState extends ConsumerState<SettingsUpdateInform
padding: const EdgeInsets.symmetric(horizontal: 12),
child: ListView(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
children: [
const Divider(),
SettingsListTile(
@ -116,6 +117,7 @@ class UpdateInformation extends StatelessWidget {
);
},
),
const Divider(),
...releaseInfo.otherDownloads.entries.map(
(entry) {
return ElevatedButton(

View file

@ -50,7 +50,7 @@ class FladderTheme {
trackHeight: 8,
thumbColor: colorScheme?.onSurface,
),
cardTheme: CardTheme(
cardTheme: CardThemeData(
elevation: 3,
clipBehavior: Clip.antiAlias,
margin: EdgeInsets.zero,
@ -95,7 +95,7 @@ class FladderTheme {
),
),
navigationBarTheme: const NavigationBarThemeData(),
dialogTheme: DialogTheme(shape: defaultShape),
dialogTheme: DialogThemeData(shape: defaultShape),
scrollbarTheme: ScrollbarThemeData(
radius: const Radius.circular(16),
thumbColor: WidgetStateProperty.resolveWith((states) {

View file

@ -20,112 +20,6 @@ mixin _$ApplicationInfo {
String get version => throw _privateConstructorUsedError;
String get buildNumber => throw _privateConstructorUsedError;
String get os => throw _privateConstructorUsedError;
/// Create a copy of ApplicationInfo
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ApplicationInfoCopyWith<ApplicationInfo> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ApplicationInfoCopyWith<$Res> {
factory $ApplicationInfoCopyWith(
ApplicationInfo value, $Res Function(ApplicationInfo) then) =
_$ApplicationInfoCopyWithImpl<$Res, ApplicationInfo>;
@useResult
$Res call({String name, String version, String buildNumber, String os});
}
/// @nodoc
class _$ApplicationInfoCopyWithImpl<$Res, $Val extends ApplicationInfo>
implements $ApplicationInfoCopyWith<$Res> {
_$ApplicationInfoCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of ApplicationInfo
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? name = null,
Object? version = null,
Object? buildNumber = null,
Object? os = null,
}) {
return _then(_value.copyWith(
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
version: null == version
? _value.version
: version // ignore: cast_nullable_to_non_nullable
as String,
buildNumber: null == buildNumber
? _value.buildNumber
: buildNumber // ignore: cast_nullable_to_non_nullable
as String,
os: null == os
? _value.os
: os // ignore: cast_nullable_to_non_nullable
as String,
) as $Val);
}
}
/// @nodoc
abstract class _$$ApplicationInfoImplCopyWith<$Res>
implements $ApplicationInfoCopyWith<$Res> {
factory _$$ApplicationInfoImplCopyWith(_$ApplicationInfoImpl value,
$Res Function(_$ApplicationInfoImpl) then) =
__$$ApplicationInfoImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String name, String version, String buildNumber, String os});
}
/// @nodoc
class __$$ApplicationInfoImplCopyWithImpl<$Res>
extends _$ApplicationInfoCopyWithImpl<$Res, _$ApplicationInfoImpl>
implements _$$ApplicationInfoImplCopyWith<$Res> {
__$$ApplicationInfoImplCopyWithImpl(
_$ApplicationInfoImpl _value, $Res Function(_$ApplicationInfoImpl) _then)
: super(_value, _then);
/// Create a copy of ApplicationInfo
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? name = null,
Object? version = null,
Object? buildNumber = null,
Object? os = null,
}) {
return _then(_$ApplicationInfoImpl(
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
version: null == version
? _value.version
: version // ignore: cast_nullable_to_non_nullable
as String,
buildNumber: null == buildNumber
? _value.buildNumber
: buildNumber // ignore: cast_nullable_to_non_nullable
as String,
os: null == os
? _value.os
: os // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
@ -146,30 +40,6 @@ class _$ApplicationInfoImpl extends _ApplicationInfo {
final String buildNumber;
@override
final String os;
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ApplicationInfoImpl &&
(identical(other.name, name) || other.name == name) &&
(identical(other.version, version) || other.version == version) &&
(identical(other.buildNumber, buildNumber) ||
other.buildNumber == buildNumber) &&
(identical(other.os, os) || other.os == os));
}
@override
int get hashCode => Object.hash(runtimeType, name, version, buildNumber, os);
/// Create a copy of ApplicationInfo
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ApplicationInfoImplCopyWith<_$ApplicationInfoImpl> get copyWith =>
__$$ApplicationInfoImplCopyWithImpl<_$ApplicationInfoImpl>(
this, _$identity);
}
abstract class _ApplicationInfo extends ApplicationInfo {
@ -188,11 +58,4 @@ abstract class _ApplicationInfo extends ApplicationInfo {
String get buildNumber;
@override
String get os;
/// Create a copy of ApplicationInfo
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ApplicationInfoImplCopyWith<_$ApplicationInfoImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View file

@ -41,14 +41,12 @@ class FladderImage extends ConsumerWidget {
key: Key(newImage.key),
fit: StackFit.expand,
children: [
if (!disableBlur && useBluredPlaceHolder && newImage.hash.isNotEmpty)
Image(
fit: blurFit ?? fit,
excludeFromSemantics: true,
filterQuality: FilterQuality.low,
image: BlurHashImage(
newImage.hash,
),
if (!disableBlur && useBluredPlaceHolder && newImage.hash.isNotEmpty || blurOnly)
BlurHash(
hash: newImage.hash,
optimizationMode: BlurHashOptimizationMode.approximation,
color: Colors.transparent,
imageFit: blurFit ?? fit,
),
if (!blurOnly)
FadeInImage(

View file

@ -1,8 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:fladder/l10n/generated/app_localizations.dart';
///Only use for base translations, under normal circumstances ALWAYS use the widgets provided context
final localizationContextProvider = StateProvider<BuildContext?>((ref) => null);

View file

@ -84,159 +84,155 @@ class _SideNavigationBarState extends ConsumerState<SideNavigationBar> {
),
child: (context) => widget.child,
),
AnimatedFadeSize(
alignment: Alignment.topLeft,
child: AnimatedContainer(
duration: const Duration(milliseconds: 250),
color: Theme.of(context).colorScheme.surface.withValues(alpha: shouldExpand ? 0.95 : 0.85),
width: shouldExpand ? expandedWidth : collapsedWidth,
child: MouseRegion(
onEnter: (value) => startTimer(),
onExit: (event) => stopTimer(),
onHover: (value) => startTimer(),
child: Column(
children: [
if (isDesktop && AdaptiveLayout.of(context).platform != TargetPlatform.macOS) ...{
const SizedBox(height: 4),
Text(
"Fladder",
style: Theme.of(context).textTheme.titleSmall,
),
},
if (AdaptiveLayout.of(context).platform == TargetPlatform.macOS) SizedBox(height: padding.top),
Expanded(
child: Padding(
key: const Key('navigation_rail'),
padding: padding.copyWith(right: 0, top: isDesktop ? 8 : null),
child: Column(
spacing: 2,
children: [
Align(
alignment: largeBar && expandedSideBar ? Alignment.centerRight : Alignment.center,
child: Opacity(
opacity: largeBar && expandedSideBar ? 0.65 : 1.0,
child: IconButton(
onPressed: !largeBar
? () => widget.scaffoldKey.currentState?.openDrawer()
: () => setState(() {
expandedSideBar = !expandedSideBar;
if (!expandedSideBar) {
showOnHover = false;
}
}),
icon: Icon(
largeBar && expandedSideBar ? IconsaxPlusLinear.sidebar_left : IconsaxPlusLinear.menu,
),
Container(
color: Theme.of(context).colorScheme.surface.withValues(alpha: shouldExpand ? 0.95 : 0.85),
width: shouldExpand ? expandedWidth : collapsedWidth,
child: MouseRegion(
onEnter: (value) => startTimer(),
onExit: (event) => stopTimer(),
onHover: (value) => startTimer(),
child: Column(
children: [
if (isDesktop && AdaptiveLayout.of(context).platform != TargetPlatform.macOS) ...{
const SizedBox(height: 4),
Text(
"Fladder",
style: Theme.of(context).textTheme.titleSmall,
),
},
if (AdaptiveLayout.of(context).platform == TargetPlatform.macOS) SizedBox(height: padding.top),
Expanded(
child: Padding(
key: const Key('navigation_rail'),
padding: padding.copyWith(right: 0, top: isDesktop ? 8 : null),
child: Column(
spacing: 2,
children: [
Align(
alignment: largeBar && expandedSideBar ? Alignment.centerRight : Alignment.center,
child: Opacity(
opacity: largeBar && expandedSideBar ? 0.65 : 1.0,
child: IconButton(
onPressed: !largeBar
? () => widget.scaffoldKey.currentState?.openDrawer()
: () => setState(() {
expandedSideBar = !expandedSideBar;
if (!expandedSideBar) {
showOnHover = false;
}
}),
icon: Icon(
largeBar && expandedSideBar ? IconsaxPlusLinear.sidebar_left : IconsaxPlusLinear.menu,
),
),
),
const SizedBox(height: 8),
if (largeBar) ...[
AnimatedFadeSize(
duration: const Duration(milliseconds: 250),
child: shouldExpand ? actionButton(context).extended : actionButton(context).normal,
),
],
Expanded(
child: Column(
spacing: 2,
mainAxisAlignment: !largeBar ? MainAxisAlignment.center : MainAxisAlignment.start,
children: [
...widget.destinations.mapIndexed(
(index, destination) =>
destination.toNavigationButton(widget.currentIndex == index, true, shouldExpand),
),
if (views.isNotEmpty && largeBar) ...[
const Divider(
indent: 32,
endIndent: 32,
),
Flexible(
child: OverflowView.flexible(
direction: Axis.vertical,
spacing: 4,
children: views.map(
(view) {
final actions = [
ItemActionButton(
label: Text(context.localized.scanLibrary),
icon: const Icon(IconsaxPlusLinear.refresh),
action: () => showRefreshPopup(context, view.id, view.name),
)
];
return view.toNavigationButton(
context.router.currentUrl.contains(view.id),
true,
shouldExpand,
() => context.pushRoute(LibrarySearchRoute(viewModelId: view.id)),
onLongPress: () => showBottomSheetPill(
context: context,
content: (context, scrollController) => ListView(
shrinkWrap: true,
controller: scrollController,
children: actions.listTileItems(context, useIcons: true),
),
),
trailing: actions,
);
},
).toList(),
builder: (context, remaining) {
return PopupMenuButton(
iconColor: Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.45),
padding: EdgeInsets.zero,
icon: NavigationButton(
label: context.localized.other,
selectedIcon: const Icon(IconsaxPlusLinear.arrow_square_down),
icon: const Icon(IconsaxPlusLinear.arrow_square_down),
expanded: shouldExpand,
horizontal: true,
),
itemBuilder: (context) => views
.sublist(views.length - remaining)
.map(
(e) => PopupMenuItem(
onTap: () => context.pushRoute(LibrarySearchRoute(viewModelId: e.id)),
child: Row(
spacing: 8,
children: [
Icon(e.collectionType.iconOutlined),
Text(e.name),
],
),
),
)
.toList(),
);
},
),
),
],
],
),
),
NavigationButton(
label: context.localized.settings,
selected: widget.currentLocation.contains(const SettingsRoute().routeName),
selectedIcon: const Icon(IconsaxPlusBold.setting_3),
horizontal: true,
expanded: shouldExpand,
icon: const SettingsUserIcon(),
onPressed: () {
if (AdaptiveLayout.layoutModeOf(context) == LayoutMode.single) {
context.router.push(const SettingsRoute());
} else {
context.router.push(const ClientSettingsRoute());
}
},
),
const SizedBox(height: 8),
if (largeBar) ...[
AnimatedFadeSize(
duration: const Duration(milliseconds: 250),
child: shouldExpand ? actionButton(context).extended : actionButton(context).normal,
),
],
),
Expanded(
child: Column(
spacing: 2,
mainAxisAlignment: !largeBar ? MainAxisAlignment.center : MainAxisAlignment.start,
children: [
...widget.destinations.mapIndexed(
(index, destination) =>
destination.toNavigationButton(widget.currentIndex == index, true, shouldExpand),
),
if (views.isNotEmpty && largeBar) ...[
const Divider(
indent: 32,
endIndent: 32,
),
Flexible(
child: OverflowView.flexible(
direction: Axis.vertical,
spacing: 4,
children: views.map(
(view) {
final actions = [
ItemActionButton(
label: Text(context.localized.scanLibrary),
icon: const Icon(IconsaxPlusLinear.refresh),
action: () => showRefreshPopup(context, view.id, view.name),
)
];
return view.toNavigationButton(
context.router.currentUrl.contains(view.id),
true,
shouldExpand,
() => context.pushRoute(LibrarySearchRoute(viewModelId: view.id)),
onLongPress: () => showBottomSheetPill(
context: context,
content: (context, scrollController) => ListView(
shrinkWrap: true,
controller: scrollController,
children: actions.listTileItems(context, useIcons: true),
),
),
trailing: actions,
);
},
).toList(),
builder: (context, remaining) {
return PopupMenuButton(
iconColor: Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.45),
padding: EdgeInsets.zero,
icon: NavigationButton(
label: context.localized.other,
selectedIcon: const Icon(IconsaxPlusLinear.arrow_square_down),
icon: const Icon(IconsaxPlusLinear.arrow_square_down),
expanded: shouldExpand,
horizontal: true,
),
itemBuilder: (context) => views
.sublist(views.length - remaining)
.map(
(e) => PopupMenuItem(
onTap: () => context.pushRoute(LibrarySearchRoute(viewModelId: e.id)),
child: Row(
spacing: 8,
children: [
Icon(e.collectionType.iconOutlined),
Text(e.name),
],
),
),
)
.toList(),
);
},
),
),
],
],
),
),
NavigationButton(
label: context.localized.settings,
selected: widget.currentLocation.contains(const SettingsRoute().routeName),
selectedIcon: const Icon(IconsaxPlusBold.setting_3),
horizontal: true,
expanded: shouldExpand,
icon: const SettingsUserIcon(),
onPressed: () {
if (AdaptiveLayout.layoutModeOf(context) == LayoutMode.single) {
context.router.push(const SettingsRoute());
} else {
context.router.push(const ClientSettingsRoute());
}
},
),
],
),
),
if (AdaptiveLayout.of(context).inputDevice == InputDevice.pointer) const SizedBox(height: 16),
],
),
),
if (AdaptiveLayout.of(context).inputDevice == InputDevice.pointer) const SizedBox(height: 16),
],
),
),
),