chore: update flutter and dependencies

This commit is contained in:
Dr.Blank 2026-01-10 16:46:06 +05:30
parent 06694f5f0b
commit a520136e01
No known key found for this signature in database
GPG key ID: BA5F87FF0560C57B
80 changed files with 7701 additions and 9141 deletions

2
.fvmrc
View file

@ -1,3 +1,3 @@
{
"flutter": "3.32.8"
"flutter": "3.38.6"
}

View file

@ -22,7 +22,7 @@
"utsname",
"Vaani"
],
"dart.flutterSdkPath": ".fvm/versions/3.32.8",
"dart.flutterSdkPath": ".fvm/versions/3.38.6",
"files.exclude": {
"**/*.freezed.dart": true,
"**/*.g.dart": true

View file

@ -30,11 +30,11 @@ if (keystorePropertiesFile.exists()) {
android {
namespace "dr.blank.vaani"
compileSdk 36
// ndkVersion flutter.ndkVersion
compileSdk flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
// The NDK version is set to a specific version since it was not building
// TODO remove when https://github.com/flutter/flutter/issues/139427 is closed
ndkVersion = "29.0.13113456"
// ndkVersion = "29.0.13113456"
compileOptions {
@ -64,8 +64,8 @@ android {
applicationId "dr.blank.vaani"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 23
targetSdkVersion 36
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
@ -100,4 +100,4 @@ configurations.all {
force "androidx.core:core:1.13.1"
force "androidx.core:core-ktx:1.13.1"
}
}
}

View file

@ -20,7 +20,7 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version '8.10.0' apply false
id "org.jetbrains.kotlin.android" version "2.0.20" apply false
id "org.jetbrains.kotlin.android" version "2.1.10" apply false
}
include ":app"

File diff suppressed because it is too large Load diff

View file

@ -19,7 +19,7 @@ final _logger = Logger('authenticated_users_provider');
class AuthenticatedUsers extends _$AuthenticatedUsers {
@override
Set<model.AuthenticatedUser> build() {
ref.listenSelf((_, __) {
listenSelf((_, __) {
writeStateToBox();
});
// get the app settings

View file

@ -6,25 +6,70 @@ part of 'authenticated_users_provider.dart';
// RiverpodGenerator
// **************************************************************************
String _$authenticatedUsersHash() =>
r'5fdd472f62fc3b73ff8417cdce9f02e86c33d00f';
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
/// provides with a set of authenticated users
@ProviderFor(AuthenticatedUsers)
final authenticatedUsersProvider = AuthenticatedUsersProvider._();
/// provides with a set of authenticated users
///
/// Copied from [AuthenticatedUsers].
@ProviderFor(AuthenticatedUsers)
final authenticatedUsersProvider = AutoDisposeNotifierProvider<
AuthenticatedUsers, Set<model.AuthenticatedUser>>.internal(
AuthenticatedUsers.new,
name: r'authenticatedUsersProvider',
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
? null
: _$authenticatedUsersHash,
dependencies: null,
allTransitiveDependencies: null,
);
final class AuthenticatedUsersProvider
extends
$NotifierProvider<AuthenticatedUsers, Set<model.AuthenticatedUser>> {
/// provides with a set of authenticated users
AuthenticatedUsersProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'authenticatedUsersProvider',
isAutoDispose: true,
dependencies: null,
$allTransitiveDependencies: null,
);
typedef _$AuthenticatedUsers
= AutoDisposeNotifier<Set<model.AuthenticatedUser>>;
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
@override
String debugGetCreateSourceHash() => _$authenticatedUsersHash();
@$internal
@override
AuthenticatedUsers create() => AuthenticatedUsers();
/// {@macro riverpod.override_with_value}
Override overrideWithValue(Set<model.AuthenticatedUser> value) {
return $ProviderOverride(
origin: this,
providerOverride: $SyncValueProvider<Set<model.AuthenticatedUser>>(value),
);
}
}
String _$authenticatedUsersHash() =>
r'c5e82cc70ffc31a0d315e3db9e07a141c583471e';
/// provides with a set of authenticated users
abstract class _$AuthenticatedUsers
extends $Notifier<Set<model.AuthenticatedUser>> {
Set<model.AuthenticatedUser> build();
@$mustCallSuper
@override
void runBuild() {
final ref =
this.ref
as $Ref<Set<model.AuthenticatedUser>, Set<model.AuthenticatedUser>>;
final element =
ref.element
as $ClassProviderElement<
AnyNotifier<
Set<model.AuthenticatedUser>,
Set<model.AuthenticatedUser>
>,
Set<model.AuthenticatedUser>,
Object?,
Object?
>;
element.handleCreate(ref, build);
}
}

View file

@ -6,169 +6,94 @@ part of 'image_provider.dart';
// RiverpodGenerator
// **************************************************************************
String _$coverImageHash() => r'89cc4783cbc76bb41beae34384d92fb277135c75';
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
/// Copied from Dart SDK
class _SystemHash {
_SystemHash._();
static int combine(int hash, int value) {
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + value);
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
return hash ^ (hash >> 6);
}
static int finish(int hash) {
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
// ignore: parameter_assignments
hash = hash ^ (hash >> 11);
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
}
}
abstract class _$CoverImage extends BuildlessStreamNotifier<Uint8List> {
late final String itemId;
Stream<Uint8List> build(
String itemId,
);
}
/// See also [CoverImage].
@ProviderFor(CoverImage)
const coverImageProvider = CoverImageFamily();
final coverImageProvider = CoverImageFamily._();
/// See also [CoverImage].
class CoverImageFamily extends Family<AsyncValue<Uint8List>> {
/// See also [CoverImage].
const CoverImageFamily();
final class CoverImageProvider
extends $StreamNotifierProvider<CoverImage, Uint8List> {
CoverImageProvider._({
required CoverImageFamily super.from,
required String super.argument,
}) : super(
retry: null,
name: r'coverImageProvider',
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
/// See also [CoverImage].
CoverImageProvider call(
String itemId,
) {
return CoverImageProvider(
itemId,
);
@override
String debugGetCreateSourceHash() => _$coverImageHash();
@override
String toString() {
return r'coverImageProvider'
''
'($argument)';
}
@$internal
@override
CoverImageProvider getProviderOverride(
covariant CoverImageProvider provider,
) {
return call(
provider.itemId,
);
}
static const Iterable<ProviderOrFamily>? _dependencies = null;
@override
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
@override
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
_allTransitiveDependencies;
@override
String? get name => r'coverImageProvider';
}
/// See also [CoverImage].
class CoverImageProvider
extends StreamNotifierProviderImpl<CoverImage, Uint8List> {
/// See also [CoverImage].
CoverImageProvider(
String itemId,
) : this._internal(
() => CoverImage()..itemId = itemId,
from: coverImageProvider,
name: r'coverImageProvider',
debugGetCreateSourceHash:
const bool.fromEnvironment('dart.vm.product')
? null
: _$coverImageHash,
dependencies: CoverImageFamily._dependencies,
allTransitiveDependencies:
CoverImageFamily._allTransitiveDependencies,
itemId: itemId,
);
CoverImageProvider._internal(
super._createNotifier, {
required super.name,
required super.dependencies,
required super.allTransitiveDependencies,
required super.debugGetCreateSourceHash,
required super.from,
required this.itemId,
}) : super.internal();
final String itemId;
@override
Stream<Uint8List> runNotifierBuild(
covariant CoverImage notifier,
) {
return notifier.build(
itemId,
);
}
@override
Override overrideWith(CoverImage Function() create) {
return ProviderOverride(
origin: this,
override: CoverImageProvider._internal(
() => create()..itemId = itemId,
from: from,
name: null,
dependencies: null,
allTransitiveDependencies: null,
debugGetCreateSourceHash: null,
itemId: itemId,
),
);
}
@override
StreamNotifierProviderElement<CoverImage, Uint8List> createElement() {
return _CoverImageProviderElement(this);
}
CoverImage create() => CoverImage();
@override
bool operator ==(Object other) {
return other is CoverImageProvider && other.itemId == itemId;
return other is CoverImageProvider && other.argument == argument;
}
@override
int get hashCode {
var hash = _SystemHash.combine(0, runtimeType.hashCode);
hash = _SystemHash.combine(hash, itemId.hashCode);
return _SystemHash.finish(hash);
return argument.hashCode;
}
}
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
mixin CoverImageRef on StreamNotifierProviderRef<Uint8List> {
/// The parameter `itemId` of this provider.
String get itemId;
}
String _$coverImageHash() => r'89cc4783cbc76bb41beae34384d92fb277135c75';
class _CoverImageProviderElement
extends StreamNotifierProviderElement<CoverImage, Uint8List>
with CoverImageRef {
_CoverImageProviderElement(super.provider);
final class CoverImageFamily extends $Family
with
$ClassFamilyOverride<
CoverImage,
AsyncValue<Uint8List>,
Uint8List,
Stream<Uint8List>,
String
> {
CoverImageFamily._()
: super(
retry: null,
name: r'coverImageProvider',
dependencies: null,
$allTransitiveDependencies: null,
isAutoDispose: false,
);
CoverImageProvider call(String itemId) =>
CoverImageProvider._(argument: itemId, from: this);
@override
String get itemId => (origin as CoverImageProvider).itemId;
String toString() => r'coverImageProvider';
}
abstract class _$CoverImage extends $StreamNotifier<Uint8List> {
late final _$args = ref.$arg as String;
String get itemId => _$args;
Stream<Uint8List> build(String itemId);
@$mustCallSuper
@override
void runBuild() {
final ref = this.ref as $Ref<AsyncValue<Uint8List>, Uint8List>;
final element =
ref.element
as $ClassProviderElement<
AnyNotifier<AsyncValue<Uint8List>, Uint8List>,
AsyncValue<Uint8List>,
Object?,
Object?
>;
element.handleCreate(ref, () => build(_$args));
}
}
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

View file

@ -6,184 +6,112 @@ part of 'library_item_provider.dart';
// RiverpodGenerator
// **************************************************************************
String _$libraryItemHash() => r'a3cfa7f912e9498a70b5782899018b6964d6445c';
/// Copied from Dart SDK
class _SystemHash {
_SystemHash._();
static int combine(int hash, int value) {
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + value);
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
return hash ^ (hash >> 6);
}
static int finish(int hash) {
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
// ignore: parameter_assignments
hash = hash ^ (hash >> 11);
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
}
}
abstract class _$LibraryItem
extends BuildlessStreamNotifier<shelfsdk.LibraryItemExpanded> {
late final String id;
Stream<shelfsdk.LibraryItemExpanded> build(
String id,
);
}
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
/// provides the library item for the given id
///
/// Copied from [LibraryItem].
@ProviderFor(LibraryItem)
const libraryItemProvider = LibraryItemFamily();
final libraryItemProvider = LibraryItemFamily._();
/// provides the library item for the given id
///
/// Copied from [LibraryItem].
class LibraryItemFamily
extends Family<AsyncValue<shelfsdk.LibraryItemExpanded>> {
final class LibraryItemProvider
extends $StreamNotifierProvider<LibraryItem, shelfsdk.LibraryItemExpanded> {
/// provides the library item for the given id
///
/// Copied from [LibraryItem].
const LibraryItemFamily();
LibraryItemProvider._({
required LibraryItemFamily super.from,
required String super.argument,
}) : super(
retry: null,
name: r'libraryItemProvider',
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
/// provides the library item for the given id
///
/// Copied from [LibraryItem].
LibraryItemProvider call(
String id,
) {
return LibraryItemProvider(
id,
);
@override
String debugGetCreateSourceHash() => _$libraryItemHash();
@override
String toString() {
return r'libraryItemProvider'
''
'($argument)';
}
@$internal
@override
LibraryItemProvider getProviderOverride(
covariant LibraryItemProvider provider,
) {
return call(
provider.id,
);
}
static const Iterable<ProviderOrFamily>? _dependencies = null;
@override
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
@override
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
_allTransitiveDependencies;
@override
String? get name => r'libraryItemProvider';
}
/// provides the library item for the given id
///
/// Copied from [LibraryItem].
class LibraryItemProvider extends StreamNotifierProviderImpl<LibraryItem,
shelfsdk.LibraryItemExpanded> {
/// provides the library item for the given id
///
/// Copied from [LibraryItem].
LibraryItemProvider(
String id,
) : this._internal(
() => LibraryItem()..id = id,
from: libraryItemProvider,
name: r'libraryItemProvider',
debugGetCreateSourceHash:
const bool.fromEnvironment('dart.vm.product')
? null
: _$libraryItemHash,
dependencies: LibraryItemFamily._dependencies,
allTransitiveDependencies:
LibraryItemFamily._allTransitiveDependencies,
id: id,
);
LibraryItemProvider._internal(
super._createNotifier, {
required super.name,
required super.dependencies,
required super.allTransitiveDependencies,
required super.debugGetCreateSourceHash,
required super.from,
required this.id,
}) : super.internal();
final String id;
@override
Stream<shelfsdk.LibraryItemExpanded> runNotifierBuild(
covariant LibraryItem notifier,
) {
return notifier.build(
id,
);
}
@override
Override overrideWith(LibraryItem Function() create) {
return ProviderOverride(
origin: this,
override: LibraryItemProvider._internal(
() => create()..id = id,
from: from,
name: null,
dependencies: null,
allTransitiveDependencies: null,
debugGetCreateSourceHash: null,
id: id,
),
);
}
@override
StreamNotifierProviderElement<LibraryItem, shelfsdk.LibraryItemExpanded>
createElement() {
return _LibraryItemProviderElement(this);
}
LibraryItem create() => LibraryItem();
@override
bool operator ==(Object other) {
return other is LibraryItemProvider && other.id == id;
return other is LibraryItemProvider && other.argument == argument;
}
@override
int get hashCode {
var hash = _SystemHash.combine(0, runtimeType.hashCode);
hash = _SystemHash.combine(hash, id.hashCode);
return _SystemHash.finish(hash);
return argument.hashCode;
}
}
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
mixin LibraryItemRef
on StreamNotifierProviderRef<shelfsdk.LibraryItemExpanded> {
/// The parameter `id` of this provider.
String get id;
}
String _$libraryItemHash() => r'a3cfa7f912e9498a70b5782899018b6964d6445c';
class _LibraryItemProviderElement extends StreamNotifierProviderElement<
LibraryItem, shelfsdk.LibraryItemExpanded> with LibraryItemRef {
_LibraryItemProviderElement(super.provider);
/// provides the library item for the given id
final class LibraryItemFamily extends $Family
with
$ClassFamilyOverride<
LibraryItem,
AsyncValue<shelfsdk.LibraryItemExpanded>,
shelfsdk.LibraryItemExpanded,
Stream<shelfsdk.LibraryItemExpanded>,
String
> {
LibraryItemFamily._()
: super(
retry: null,
name: r'libraryItemProvider',
dependencies: null,
$allTransitiveDependencies: null,
isAutoDispose: false,
);
/// provides the library item for the given id
LibraryItemProvider call(String id) =>
LibraryItemProvider._(argument: id, from: this);
@override
String get id => (origin as LibraryItemProvider).id;
String toString() => r'libraryItemProvider';
}
/// provides the library item for the given id
abstract class _$LibraryItem
extends $StreamNotifier<shelfsdk.LibraryItemExpanded> {
late final _$args = ref.$arg as String;
String get id => _$args;
Stream<shelfsdk.LibraryItemExpanded> build(String id);
@$mustCallSuper
@override
void runBuild() {
final ref =
this.ref
as $Ref<
AsyncValue<shelfsdk.LibraryItemExpanded>,
shelfsdk.LibraryItemExpanded
>;
final element =
ref.element
as $ClassProviderElement<
AnyNotifier<
AsyncValue<shelfsdk.LibraryItemExpanded>,
shelfsdk.LibraryItemExpanded
>,
AsyncValue<shelfsdk.LibraryItemExpanded>,
Object?,
Object?
>;
element.handleCreate(ref, () => build(_$args));
}
}
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

View file

@ -1,4 +1,5 @@
import 'package:hooks_riverpod/hooks_riverpod.dart' show Ref;
import 'package:hooks_riverpod/hooks_riverpod.dart'
show Ref, ProviderListenableSelect;
import 'package:logging/logging.dart' show Logger;
import 'package:riverpod_annotation/riverpod_annotation.dart';

View file

@ -6,187 +6,153 @@ part of 'library_provider.dart';
// RiverpodGenerator
// **************************************************************************
String _$libraryHash() => r'f8a34100acb58f02fa958c71a629577bf815710e';
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
/// Copied from Dart SDK
class _SystemHash {
_SystemHash._();
static int combine(int hash, int value) {
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + value);
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
return hash ^ (hash >> 6);
}
static int finish(int hash) {
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
// ignore: parameter_assignments
hash = hash ^ (hash >> 11);
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
}
}
/// See also [library].
@ProviderFor(library)
const libraryProvider = LibraryFamily();
final libraryProvider = LibraryFamily._();
/// See also [library].
class LibraryFamily extends Family<AsyncValue<Library?>> {
/// See also [library].
const LibraryFamily();
final class LibraryProvider
extends
$FunctionalProvider<AsyncValue<Library?>, Library?, FutureOr<Library?>>
with $FutureModifier<Library?>, $FutureProvider<Library?> {
LibraryProvider._({
required LibraryFamily super.from,
required String super.argument,
}) : super(
retry: null,
name: r'libraryProvider',
isAutoDispose: true,
dependencies: null,
$allTransitiveDependencies: null,
);
/// See also [library].
LibraryProvider call(
String id,
) {
return LibraryProvider(
id,
);
@override
String debugGetCreateSourceHash() => _$libraryHash();
@override
String toString() {
return r'libraryProvider'
''
'($argument)';
}
@$internal
@override
LibraryProvider getProviderOverride(
covariant LibraryProvider provider,
) {
return call(
provider.id,
);
}
static const Iterable<ProviderOrFamily>? _dependencies = null;
$FutureProviderElement<Library?> $createElement($ProviderPointer pointer) =>
$FutureProviderElement(pointer);
@override
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
@override
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
_allTransitiveDependencies;
@override
String? get name => r'libraryProvider';
}
/// See also [library].
class LibraryProvider extends AutoDisposeFutureProvider<Library?> {
/// See also [library].
LibraryProvider(
String id,
) : this._internal(
(ref) => library(
ref as LibraryRef,
id,
),
from: libraryProvider,
name: r'libraryProvider',
debugGetCreateSourceHash:
const bool.fromEnvironment('dart.vm.product')
? null
: _$libraryHash,
dependencies: LibraryFamily._dependencies,
allTransitiveDependencies: LibraryFamily._allTransitiveDependencies,
id: id,
);
LibraryProvider._internal(
super._createNotifier, {
required super.name,
required super.dependencies,
required super.allTransitiveDependencies,
required super.debugGetCreateSourceHash,
required super.from,
required this.id,
}) : super.internal();
final String id;
@override
Override overrideWith(
FutureOr<Library?> Function(LibraryRef provider) create,
) {
return ProviderOverride(
origin: this,
override: LibraryProvider._internal(
(ref) => create(ref as LibraryRef),
from: from,
name: null,
dependencies: null,
allTransitiveDependencies: null,
debugGetCreateSourceHash: null,
id: id,
),
);
}
@override
AutoDisposeFutureProviderElement<Library?> createElement() {
return _LibraryProviderElement(this);
FutureOr<Library?> create(Ref ref) {
final argument = this.argument as String;
return library(ref, argument);
}
@override
bool operator ==(Object other) {
return other is LibraryProvider && other.id == id;
return other is LibraryProvider && other.argument == argument;
}
@override
int get hashCode {
var hash = _SystemHash.combine(0, runtimeType.hashCode);
hash = _SystemHash.combine(hash, id.hashCode);
return _SystemHash.finish(hash);
return argument.hashCode;
}
}
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
mixin LibraryRef on AutoDisposeFutureProviderRef<Library?> {
/// The parameter `id` of this provider.
String get id;
}
String _$libraryHash() => r'f8a34100acb58f02fa958c71a629577bf815710e';
class _LibraryProviderElement extends AutoDisposeFutureProviderElement<Library?>
with LibraryRef {
_LibraryProviderElement(super.provider);
final class LibraryFamily extends $Family
with $FunctionalFamilyOverride<FutureOr<Library?>, String> {
LibraryFamily._()
: super(
retry: null,
name: r'libraryProvider',
dependencies: null,
$allTransitiveDependencies: null,
isAutoDispose: true,
);
LibraryProvider call(String id) =>
LibraryProvider._(argument: id, from: this);
@override
String get id => (origin as LibraryProvider).id;
String toString() => r'libraryProvider';
}
@ProviderFor(currentLibrary)
final currentLibraryProvider = CurrentLibraryProvider._();
final class CurrentLibraryProvider
extends
$FunctionalProvider<AsyncValue<Library?>, Library?, FutureOr<Library?>>
with $FutureModifier<Library?>, $FutureProvider<Library?> {
CurrentLibraryProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'currentLibraryProvider',
isAutoDispose: true,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$currentLibraryHash();
@$internal
@override
$FutureProviderElement<Library?> $createElement($ProviderPointer pointer) =>
$FutureProviderElement(pointer);
@override
FutureOr<Library?> create(Ref ref) {
return currentLibrary(ref);
}
}
String _$currentLibraryHash() => r'658498a531e04a01e2b3915a3319101285601118';
/// See also [currentLibrary].
@ProviderFor(currentLibrary)
final currentLibraryProvider = AutoDisposeFutureProvider<Library?>.internal(
currentLibrary,
name: r'currentLibraryProvider',
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
? null
: _$currentLibraryHash,
dependencies: null,
allTransitiveDependencies: null,
);
@ProviderFor(Libraries)
final librariesProvider = LibrariesProvider._();
final class LibrariesProvider
extends $AsyncNotifierProvider<Libraries, List<Library>> {
LibrariesProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'librariesProvider',
isAutoDispose: true,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$librariesHash();
@$internal
@override
Libraries create() => Libraries();
}
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
typedef CurrentLibraryRef = AutoDisposeFutureProviderRef<Library?>;
String _$librariesHash() => r'95ebd4d1ac0cc2acf7617dc22895eff0ca30600f';
/// See also [Libraries].
@ProviderFor(Libraries)
final librariesProvider =
AutoDisposeAsyncNotifierProvider<Libraries, List<Library>>.internal(
Libraries.new,
name: r'librariesProvider',
debugGetCreateSourceHash:
const bool.fromEnvironment('dart.vm.product') ? null : _$librariesHash,
dependencies: null,
allTransitiveDependencies: null,
);
typedef _$Libraries = AutoDisposeAsyncNotifier<List<Library>>;
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
abstract class _$Libraries extends $AsyncNotifier<List<Library>> {
FutureOr<List<Library>> build();
@$mustCallSuper
@override
void runBuild() {
final ref = this.ref as $Ref<AsyncValue<List<Library>>, List<Library>>;
final element =
ref.element
as $ClassProviderElement<
AnyNotifier<AsyncValue<List<Library>>, List<Library>>,
AsyncValue<List<Library>>,
Object?,
Object?
>;
element.handleCreate(ref, build);
}
}

View file

@ -28,7 +28,7 @@ class ServerAlreadyExistsException implements Exception {
class AudiobookShelfServer extends _$AudiobookShelfServer {
@override
Set<model.AudiobookShelfServer> build() {
ref.listenSelf((_, __) {
listenSelf((_, __) {
writeStateToBox();
});
// get the app settings

View file

@ -6,25 +6,78 @@ part of 'server_provider.dart';
// RiverpodGenerator
// **************************************************************************
String _$audiobookShelfServerHash() =>
r'31a96b431221965cd586aad670a32ca901539e41';
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
/// provides with a set of servers added by the user
@ProviderFor(AudiobookShelfServer)
final audiobookShelfServerProvider = AudiobookShelfServerProvider._();
/// provides with a set of servers added by the user
///
/// Copied from [AudiobookShelfServer].
@ProviderFor(AudiobookShelfServer)
final audiobookShelfServerProvider = AutoDisposeNotifierProvider<
AudiobookShelfServer, Set<model.AudiobookShelfServer>>.internal(
AudiobookShelfServer.new,
name: r'audiobookShelfServerProvider',
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
? null
: _$audiobookShelfServerHash,
dependencies: null,
allTransitiveDependencies: null,
);
final class AudiobookShelfServerProvider
extends
$NotifierProvider<
AudiobookShelfServer,
Set<model.AudiobookShelfServer>
> {
/// provides with a set of servers added by the user
AudiobookShelfServerProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'audiobookShelfServerProvider',
isAutoDispose: true,
dependencies: null,
$allTransitiveDependencies: null,
);
typedef _$AudiobookShelfServer
= AutoDisposeNotifier<Set<model.AudiobookShelfServer>>;
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
@override
String debugGetCreateSourceHash() => _$audiobookShelfServerHash();
@$internal
@override
AudiobookShelfServer create() => AudiobookShelfServer();
/// {@macro riverpod.override_with_value}
Override overrideWithValue(Set<model.AudiobookShelfServer> value) {
return $ProviderOverride(
origin: this,
providerOverride: $SyncValueProvider<Set<model.AudiobookShelfServer>>(
value,
),
);
}
}
String _$audiobookShelfServerHash() =>
r'144817dcb3704b80c5b60763167fcf932f00c29c';
/// provides with a set of servers added by the user
abstract class _$AudiobookShelfServer
extends $Notifier<Set<model.AudiobookShelfServer>> {
Set<model.AudiobookShelfServer> build();
@$mustCallSuper
@override
void runBuild() {
final ref =
this.ref
as $Ref<
Set<model.AudiobookShelfServer>,
Set<model.AudiobookShelfServer>
>;
final element =
ref.element
as $ClassProviderElement<
AnyNotifier<
Set<model.AudiobookShelfServer>,
Set<model.AudiobookShelfServer>
>,
Set<model.AudiobookShelfServer>,
Object?,
Object?
>;
element.handleCreate(ref, build);
}
}

View file

@ -1,5 +1,5 @@
import 'package:flutter/foundation.dart' show immutable;
import 'package:hive/hive.dart';
import 'package:hive_plus_secure/hive_plus_secure.dart';
import 'package:vaani/features/per_book_settings/models/book_settings.dart';
import 'package:vaani/settings/models/models.dart';

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
import 'dart:io';
import 'package:hive/hive.dart';
import 'package:hive_plus_secure/hive_plus_secure.dart';
import 'package:path/path.dart' as p;
import 'package:path_provider/path_provider.dart';
import 'package:vaani/main.dart';

View file

@ -1,496 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'book_prefs.dart';
// **************************************************************************
// _IsarCollectionGenerator
// **************************************************************************
// coverage:ignore-file
// ignore_for_file: duplicate_ignore, invalid_use_of_protected_member, lines_longer_than_80_chars, constant_identifier_names, avoid_js_rounded_ints, no_leading_underscores_for_local_identifiers, require_trailing_commas, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_in_if_null_operators, library_private_types_in_public_api, prefer_const_constructors
// ignore_for_file: type=lint
extension GetBookPrefsCollection on Isar {
IsarCollection<int, BookPrefs> get bookPrefs => this.collection();
}
const BookPrefsSchema = IsarGeneratedSchema(
schema: IsarSchema(
name: 'BookPrefs',
idName: 'libItemId',
embedded: false,
properties: [
IsarPropertySchema(
name: 'speed',
type: IsarType.double,
),
],
indexes: [],
),
converter: IsarObjectConverter<int, BookPrefs>(
serialize: serializeBookPrefs,
deserialize: deserializeBookPrefs,
deserializeProperty: deserializeBookPrefsProp,
),
embeddedSchemas: [],
);
@isarProtected
int serializeBookPrefs(IsarWriter writer, BookPrefs object) {
IsarCore.writeDouble(writer, 1, object.speed ?? double.nan);
return object.libItemId;
}
@isarProtected
BookPrefs deserializeBookPrefs(IsarReader reader) {
final int _libItemId;
_libItemId = IsarCore.readId(reader);
final double? _speed;
{
final value = IsarCore.readDouble(reader, 1);
if (value.isNaN) {
_speed = null;
} else {
_speed = value;
}
}
final object = BookPrefs(
libItemId: _libItemId,
speed: _speed,
);
return object;
}
@isarProtected
dynamic deserializeBookPrefsProp(IsarReader reader, int property) {
switch (property) {
case 0:
return IsarCore.readId(reader);
case 1:
{
final value = IsarCore.readDouble(reader, 1);
if (value.isNaN) {
return null;
} else {
return value;
}
}
default:
throw ArgumentError('Unknown property: $property');
}
}
sealed class _BookPrefsUpdate {
bool call({
required int libItemId,
double? speed,
});
}
class _BookPrefsUpdateImpl implements _BookPrefsUpdate {
const _BookPrefsUpdateImpl(this.collection);
final IsarCollection<int, BookPrefs> collection;
@override
bool call({
required int libItemId,
Object? speed = ignore,
}) {
return collection.updateProperties([
libItemId
], {
if (speed != ignore) 1: speed as double?,
}) >
0;
}
}
sealed class _BookPrefsUpdateAll {
int call({
required List<int> libItemId,
double? speed,
});
}
class _BookPrefsUpdateAllImpl implements _BookPrefsUpdateAll {
const _BookPrefsUpdateAllImpl(this.collection);
final IsarCollection<int, BookPrefs> collection;
@override
int call({
required List<int> libItemId,
Object? speed = ignore,
}) {
return collection.updateProperties(libItemId, {
if (speed != ignore) 1: speed as double?,
});
}
}
extension BookPrefsUpdate on IsarCollection<int, BookPrefs> {
_BookPrefsUpdate get update => _BookPrefsUpdateImpl(this);
_BookPrefsUpdateAll get updateAll => _BookPrefsUpdateAllImpl(this);
}
sealed class _BookPrefsQueryUpdate {
int call({
double? speed,
});
}
class _BookPrefsQueryUpdateImpl implements _BookPrefsQueryUpdate {
const _BookPrefsQueryUpdateImpl(this.query, {this.limit});
final IsarQuery<BookPrefs> query;
final int? limit;
@override
int call({
Object? speed = ignore,
}) {
return query.updateProperties(limit: limit, {
if (speed != ignore) 1: speed as double?,
});
}
}
extension BookPrefsQueryUpdate on IsarQuery<BookPrefs> {
_BookPrefsQueryUpdate get updateFirst =>
_BookPrefsQueryUpdateImpl(this, limit: 1);
_BookPrefsQueryUpdate get updateAll => _BookPrefsQueryUpdateImpl(this);
}
class _BookPrefsQueryBuilderUpdateImpl implements _BookPrefsQueryUpdate {
const _BookPrefsQueryBuilderUpdateImpl(this.query, {this.limit});
final QueryBuilder<BookPrefs, BookPrefs, QOperations> query;
final int? limit;
@override
int call({
Object? speed = ignore,
}) {
final q = query.build();
try {
return q.updateProperties(limit: limit, {
if (speed != ignore) 1: speed as double?,
});
} finally {
q.close();
}
}
}
extension BookPrefsQueryBuilderUpdate
on QueryBuilder<BookPrefs, BookPrefs, QOperations> {
_BookPrefsQueryUpdate get updateFirst =>
_BookPrefsQueryBuilderUpdateImpl(this, limit: 1);
_BookPrefsQueryUpdate get updateAll => _BookPrefsQueryBuilderUpdateImpl(this);
}
extension BookPrefsQueryFilter
on QueryBuilder<BookPrefs, BookPrefs, QFilterCondition> {
QueryBuilder<BookPrefs, BookPrefs, QAfterFilterCondition> libItemIdEqualTo(
int value,
) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(
EqualCondition(
property: 0,
value: value,
),
);
});
}
QueryBuilder<BookPrefs, BookPrefs, QAfterFilterCondition>
libItemIdGreaterThan(
int value,
) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(
GreaterCondition(
property: 0,
value: value,
),
);
});
}
QueryBuilder<BookPrefs, BookPrefs, QAfterFilterCondition>
libItemIdGreaterThanOrEqualTo(
int value,
) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(
GreaterOrEqualCondition(
property: 0,
value: value,
),
);
});
}
QueryBuilder<BookPrefs, BookPrefs, QAfterFilterCondition> libItemIdLessThan(
int value,
) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(
LessCondition(
property: 0,
value: value,
),
);
});
}
QueryBuilder<BookPrefs, BookPrefs, QAfterFilterCondition>
libItemIdLessThanOrEqualTo(
int value,
) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(
LessOrEqualCondition(
property: 0,
value: value,
),
);
});
}
QueryBuilder<BookPrefs, BookPrefs, QAfterFilterCondition> libItemIdBetween(
int lower,
int upper,
) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(
BetweenCondition(
property: 0,
lower: lower,
upper: upper,
),
);
});
}
QueryBuilder<BookPrefs, BookPrefs, QAfterFilterCondition> speedIsNull() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(const IsNullCondition(property: 1));
});
}
QueryBuilder<BookPrefs, BookPrefs, QAfterFilterCondition> speedIsNotNull() {
return QueryBuilder.apply(not(), (query) {
return query.addFilterCondition(const IsNullCondition(property: 1));
});
}
QueryBuilder<BookPrefs, BookPrefs, QAfterFilterCondition> speedEqualTo(
double? value, {
double epsilon = Filter.epsilon,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(
EqualCondition(
property: 1,
value: value,
epsilon: epsilon,
),
);
});
}
QueryBuilder<BookPrefs, BookPrefs, QAfterFilterCondition> speedGreaterThan(
double? value, {
double epsilon = Filter.epsilon,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(
GreaterCondition(
property: 1,
value: value,
epsilon: epsilon,
),
);
});
}
QueryBuilder<BookPrefs, BookPrefs, QAfterFilterCondition>
speedGreaterThanOrEqualTo(
double? value, {
double epsilon = Filter.epsilon,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(
GreaterOrEqualCondition(
property: 1,
value: value,
epsilon: epsilon,
),
);
});
}
QueryBuilder<BookPrefs, BookPrefs, QAfterFilterCondition> speedLessThan(
double? value, {
double epsilon = Filter.epsilon,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(
LessCondition(
property: 1,
value: value,
epsilon: epsilon,
),
);
});
}
QueryBuilder<BookPrefs, BookPrefs, QAfterFilterCondition>
speedLessThanOrEqualTo(
double? value, {
double epsilon = Filter.epsilon,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(
LessOrEqualCondition(
property: 1,
value: value,
epsilon: epsilon,
),
);
});
}
QueryBuilder<BookPrefs, BookPrefs, QAfterFilterCondition> speedBetween(
double? lower,
double? upper, {
double epsilon = Filter.epsilon,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(
BetweenCondition(
property: 1,
lower: lower,
upper: upper,
epsilon: epsilon,
),
);
});
}
}
extension BookPrefsQueryObject
on QueryBuilder<BookPrefs, BookPrefs, QFilterCondition> {}
extension BookPrefsQuerySortBy on QueryBuilder<BookPrefs, BookPrefs, QSortBy> {
QueryBuilder<BookPrefs, BookPrefs, QAfterSortBy> sortByLibItemId() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(0);
});
}
QueryBuilder<BookPrefs, BookPrefs, QAfterSortBy> sortByLibItemIdDesc() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(0, sort: Sort.desc);
});
}
QueryBuilder<BookPrefs, BookPrefs, QAfterSortBy> sortBySpeed() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(1);
});
}
QueryBuilder<BookPrefs, BookPrefs, QAfterSortBy> sortBySpeedDesc() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(1, sort: Sort.desc);
});
}
}
extension BookPrefsQuerySortThenBy
on QueryBuilder<BookPrefs, BookPrefs, QSortThenBy> {
QueryBuilder<BookPrefs, BookPrefs, QAfterSortBy> thenByLibItemId() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(0);
});
}
QueryBuilder<BookPrefs, BookPrefs, QAfterSortBy> thenByLibItemIdDesc() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(0, sort: Sort.desc);
});
}
QueryBuilder<BookPrefs, BookPrefs, QAfterSortBy> thenBySpeed() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(1);
});
}
QueryBuilder<BookPrefs, BookPrefs, QAfterSortBy> thenBySpeedDesc() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(1, sort: Sort.desc);
});
}
}
extension BookPrefsQueryWhereDistinct
on QueryBuilder<BookPrefs, BookPrefs, QDistinct> {
QueryBuilder<BookPrefs, BookPrefs, QAfterDistinct> distinctBySpeed() {
return QueryBuilder.apply(this, (query) {
return query.addDistinctBy(1);
});
}
}
extension BookPrefsQueryProperty1
on QueryBuilder<BookPrefs, BookPrefs, QProperty> {
QueryBuilder<BookPrefs, int, QAfterProperty> libItemIdProperty() {
return QueryBuilder.apply(this, (query) {
return query.addProperty(0);
});
}
QueryBuilder<BookPrefs, double?, QAfterProperty> speedProperty() {
return QueryBuilder.apply(this, (query) {
return query.addProperty(1);
});
}
}
extension BookPrefsQueryProperty2<R>
on QueryBuilder<BookPrefs, R, QAfterProperty> {
QueryBuilder<BookPrefs, (R, int), QAfterProperty> libItemIdProperty() {
return QueryBuilder.apply(this, (query) {
return query.addProperty(0);
});
}
QueryBuilder<BookPrefs, (R, double?), QAfterProperty> speedProperty() {
return QueryBuilder.apply(this, (query) {
return query.addProperty(1);
});
}
}
extension BookPrefsQueryProperty3<R1, R2>
on QueryBuilder<BookPrefs, (R1, R2), QAfterProperty> {
QueryBuilder<BookPrefs, (R1, R2, int), QOperations> libItemIdProperty() {
return QueryBuilder.apply(this, (query) {
return query.addProperty(0);
});
}
QueryBuilder<BookPrefs, (R1, R2, double?), QOperations> speedProperty() {
return QueryBuilder.apply(this, (query) {
return query.addProperty(1);
});
}
}

View file

@ -1,4 +1,4 @@
import 'package:hive/hive.dart';
import 'package:hive_plus_secure/hive_plus_secure.dart';
import 'package:vaani/features/per_book_settings/models/book_settings.dart';
import 'package:vaani/settings/models/models.dart';

View file

@ -110,7 +110,7 @@ class ItemDownloadProgress extends _$ItemDownloadProgress {
final totalDownloadedSize = downloadedSize + inProgressFileSize;
final progress = totalDownloadedSize / totalSize;
// if current progress is more than calculated progress, do not update
if (progress < (state.valueOrNull ?? 0.0)) {
if (progress < (state.value ?? 0.0)) {
return;
}

File diff suppressed because it is too large Load diff

View file

@ -6,24 +6,64 @@ part of 'search_controller.dart';
// RiverpodGenerator
// **************************************************************************
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
/// The controller for the search bar.
@ProviderFor(GlobalSearchController)
final globalSearchControllerProvider = GlobalSearchControllerProvider._();
/// The controller for the search bar.
final class GlobalSearchControllerProvider
extends $NotifierProvider<GlobalSearchController, Raw<SearchController>> {
/// The controller for the search bar.
GlobalSearchControllerProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'globalSearchControllerProvider',
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$globalSearchControllerHash();
@$internal
@override
GlobalSearchController create() => GlobalSearchController();
/// {@macro riverpod.override_with_value}
Override overrideWithValue(Raw<SearchController> value) {
return $ProviderOverride(
origin: this,
providerOverride: $SyncValueProvider<Raw<SearchController>>(value),
);
}
}
String _$globalSearchControllerHash() =>
r'd854ace6f2e00a10fc33aba63051375f82ad1b10';
/// The controller for the search bar.
///
/// Copied from [GlobalSearchController].
@ProviderFor(GlobalSearchController)
final globalSearchControllerProvider =
NotifierProvider<GlobalSearchController, Raw<SearchController>>.internal(
GlobalSearchController.new,
name: r'globalSearchControllerProvider',
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
? null
: _$globalSearchControllerHash,
dependencies: null,
allTransitiveDependencies: null,
);
typedef _$GlobalSearchController = Notifier<Raw<SearchController>>;
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
abstract class _$GlobalSearchController
extends $Notifier<Raw<SearchController>> {
Raw<SearchController> build();
@$mustCallSuper
@override
void runBuild() {
final ref = this.ref as $Ref<Raw<SearchController>, Raw<SearchController>>;
final element =
ref.element
as $ClassProviderElement<
AnyNotifier<Raw<SearchController>, Raw<SearchController>>,
Raw<SearchController>,
Object?,
Object?
>;
element.handleCreate(ref, build);
}
}

View file

@ -6,186 +6,94 @@ part of 'search_result_provider.dart';
// RiverpodGenerator
// **************************************************************************
String _$searchResultHash() => r'33785de298ad0d53c9d21e8fec88ba2f22f1363f';
/// Copied from Dart SDK
class _SystemHash {
_SystemHash._();
static int combine(int hash, int value) {
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + value);
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
return hash ^ (hash >> 6);
}
static int finish(int hash) {
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
// ignore: parameter_assignments
hash = hash ^ (hash >> 11);
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
}
}
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
/// The provider for the search result.
///
/// Copied from [searchResult].
@ProviderFor(searchResult)
const searchResultProvider = SearchResultFamily();
final searchResultProvider = SearchResultFamily._();
/// The provider for the search result.
///
/// Copied from [searchResult].
class SearchResultFamily extends Family<AsyncValue<LibrarySearchResponse?>> {
/// The provider for the search result.
///
/// Copied from [searchResult].
const SearchResultFamily();
final class SearchResultProvider
extends
$FunctionalProvider<
AsyncValue<LibrarySearchResponse?>,
LibrarySearchResponse?,
FutureOr<LibrarySearchResponse?>
>
with
$FutureModifier<LibrarySearchResponse?>,
$FutureProvider<LibrarySearchResponse?> {
/// The provider for the search result.
///
/// Copied from [searchResult].
SearchResultProvider call(
String query, {
int limit = 25,
}) {
return SearchResultProvider(
query,
limit: limit,
);
SearchResultProvider._({
required SearchResultFamily super.from,
required (String, {int limit}) super.argument,
}) : super(
retry: null,
name: r'searchResultProvider',
isAutoDispose: true,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$searchResultHash();
@override
String toString() {
return r'searchResultProvider'
''
'$argument';
}
@$internal
@override
SearchResultProvider getProviderOverride(
covariant SearchResultProvider provider,
) {
return call(
provider.query,
limit: provider.limit,
);
}
static const Iterable<ProviderOrFamily>? _dependencies = null;
$FutureProviderElement<LibrarySearchResponse?> $createElement(
$ProviderPointer pointer,
) => $FutureProviderElement(pointer);
@override
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
@override
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
_allTransitiveDependencies;
@override
String? get name => r'searchResultProvider';
}
/// The provider for the search result.
///
/// Copied from [searchResult].
class SearchResultProvider
extends AutoDisposeFutureProvider<LibrarySearchResponse?> {
/// The provider for the search result.
///
/// Copied from [searchResult].
SearchResultProvider(
String query, {
int limit = 25,
}) : this._internal(
(ref) => searchResult(
ref as SearchResultRef,
query,
limit: limit,
),
from: searchResultProvider,
name: r'searchResultProvider',
debugGetCreateSourceHash:
const bool.fromEnvironment('dart.vm.product')
? null
: _$searchResultHash,
dependencies: SearchResultFamily._dependencies,
allTransitiveDependencies:
SearchResultFamily._allTransitiveDependencies,
query: query,
limit: limit,
);
SearchResultProvider._internal(
super._createNotifier, {
required super.name,
required super.dependencies,
required super.allTransitiveDependencies,
required super.debugGetCreateSourceHash,
required super.from,
required this.query,
required this.limit,
}) : super.internal();
final String query;
final int limit;
@override
Override overrideWith(
FutureOr<LibrarySearchResponse?> Function(SearchResultRef provider) create,
) {
return ProviderOverride(
origin: this,
override: SearchResultProvider._internal(
(ref) => create(ref as SearchResultRef),
from: from,
name: null,
dependencies: null,
allTransitiveDependencies: null,
debugGetCreateSourceHash: null,
query: query,
limit: limit,
),
);
}
@override
AutoDisposeFutureProviderElement<LibrarySearchResponse?> createElement() {
return _SearchResultProviderElement(this);
FutureOr<LibrarySearchResponse?> create(Ref ref) {
final argument = this.argument as (String, {int limit});
return searchResult(ref, argument.$1, limit: argument.limit);
}
@override
bool operator ==(Object other) {
return other is SearchResultProvider &&
other.query == query &&
other.limit == limit;
return other is SearchResultProvider && other.argument == argument;
}
@override
int get hashCode {
var hash = _SystemHash.combine(0, runtimeType.hashCode);
hash = _SystemHash.combine(hash, query.hashCode);
hash = _SystemHash.combine(hash, limit.hashCode);
return _SystemHash.finish(hash);
return argument.hashCode;
}
}
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
mixin SearchResultRef on AutoDisposeFutureProviderRef<LibrarySearchResponse?> {
/// The parameter `query` of this provider.
String get query;
String _$searchResultHash() => r'33785de298ad0d53c9d21e8fec88ba2f22f1363f';
/// The parameter `limit` of this provider.
int get limit;
}
/// The provider for the search result.
class _SearchResultProviderElement
extends AutoDisposeFutureProviderElement<LibrarySearchResponse?>
with SearchResultRef {
_SearchResultProviderElement(super.provider);
final class SearchResultFamily extends $Family
with
$FunctionalFamilyOverride<
FutureOr<LibrarySearchResponse?>,
(String, {int limit})
> {
SearchResultFamily._()
: super(
retry: null,
name: r'searchResultProvider',
dependencies: null,
$allTransitiveDependencies: null,
isAutoDispose: true,
);
/// The provider for the search result.
SearchResultProvider call(String query, {int limit = 25}) =>
SearchResultProvider._(argument: (query, limit: limit), from: this);
@override
String get query => (origin as SearchResultProvider).query;
@override
int get limit => (origin as SearchResultProvider).limit;
String toString() => r'searchResultProvider';
}
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

View file

@ -232,7 +232,7 @@ class BookSearchResultMini extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final item = ref.watch(libraryItemProvider(book.libraryItemId)).valueOrNull;
final item = ref.watch(libraryItemProvider(book.libraryItemId)).value;
final image = item == null
? const AsyncValue.loading()
: ref.watch(coverImageProvider(item.id));

View file

@ -35,7 +35,7 @@ class LibraryItemActions extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final item = ref.watch(libraryItemProvider(id)).valueOrNull;
final item = ref.watch(libraryItemProvider(id)).value;
if (item == null) {
return const SizedBox.shrink();
}
@ -216,7 +216,7 @@ class LibItemDownloadButton extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final isItemDownloaded = ref.watch(isItemDownloadedProvider(item));
if (isItemDownloaded.valueOrNull ?? false) {
if (isItemDownloaded.value ?? false) {
return AlreadyItemDownloadedButton(item: item);
}
final isItemDownloading = ref.watch(isItemDownloadingProvider(item.id));
@ -252,7 +252,7 @@ class ItemCurrentlyInDownloadQueue extends HookConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final progress = ref
.watch(itemDownloadProgressProvider(item.id))
.valueOrNull
.value
?.clamp(0.05, 1.0);
if (progress == 1) {

View file

@ -90,7 +90,7 @@ class _BookDetails extends HookConsumerWidget {
final itemFromApi = ref.watch(libraryItemProvider(id));
final itemBookMetadata =
itemFromApi.valueOrNull?.media.metadata.asBookMetadataExpanded;
itemFromApi.value?.media.metadata.asBookMetadataExpanded;
return Expanded(
child: Padding(
@ -143,7 +143,7 @@ class _LibraryItemProgressIndicator extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final player = ref.watch(audiobookPlayerProvider);
final libraryItem = ref.watch(libraryItemProvider(id)).valueOrNull;
final libraryItem = ref.watch(libraryItemProvider(id)).value;
if (libraryItem == null) {
return const SizedBox.shrink();
}
@ -362,7 +362,7 @@ class _BookCover extends HookConsumerWidget {
MediaQuery.of(context).highContrast,
),
)
.valueOrNull;
.value;
}
return ThemeSwitcher(

View file

@ -13,7 +13,7 @@ class LibraryItemMetadata extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final item = ref.watch(libraryItemProvider(id)).valueOrNull;
final item = ref.watch(libraryItemProvider(id)).value;
/// formats the duration of the book as `10h 30m`
///

View file

@ -145,7 +145,7 @@ class LibraryItemDescription extends HookConsumerWidget {
final String id;
@override
Widget build(BuildContext context, WidgetRef ref) {
final item = ref.watch(libraryItemProvider(id)).valueOrNull;
final item = ref.watch(libraryItemProvider(id)).value;
if (item == null) {
return const SizedBox();
}

View file

@ -17,7 +17,7 @@ class LibraryItemSliverAppBar extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final item = ref.watch(libraryItemProvider(id)).valueOrNull;
final item = ref.watch(libraryItemProvider(id)).value;
final showTitle = useState(false);

View file

@ -13,7 +13,7 @@ class LibraryBrowserPage extends HookConsumerWidget {
const LibraryBrowserPage({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
final currentLibrary = ref.watch(currentLibraryProvider).valueOrNull;
final currentLibrary = ref.watch(currentLibraryProvider).value;
// Determine the icon to use, with a fallback
final IconData libraryIconData =

View file

@ -6,20 +6,48 @@ part of 'logs_provider.dart';
// RiverpodGenerator
// **************************************************************************
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
@ProviderFor(Logs)
final logsProvider = LogsProvider._();
final class LogsProvider extends $AsyncNotifierProvider<Logs, List<LogRecord>> {
LogsProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'logsProvider',
isAutoDispose: true,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$logsHash();
@$internal
@override
Logs create() => Logs();
}
String _$logsHash() => r'aa9d3d56586cba6ddf69615320ea605d071ea5e2';
/// See also [Logs].
@ProviderFor(Logs)
final logsProvider =
AutoDisposeAsyncNotifierProvider<Logs, List<LogRecord>>.internal(
Logs.new,
name: r'logsProvider',
debugGetCreateSourceHash:
const bool.fromEnvironment('dart.vm.product') ? null : _$logsHash,
dependencies: null,
allTransitiveDependencies: null,
);
typedef _$Logs = AutoDisposeAsyncNotifier<List<LogRecord>>;
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
abstract class _$Logs extends $AsyncNotifier<List<LogRecord>> {
FutureOr<List<LogRecord>> build();
@$mustCallSuper
@override
void runBuild() {
final ref = this.ref as $Ref<AsyncValue<List<LogRecord>>, List<LogRecord>>;
final element =
ref.element
as $ClassProviderElement<
AnyNotifier<AsyncValue<List<LogRecord>>, List<LogRecord>>,
AsyncValue<List<LogRecord>>,
Object?,
Object?
>;
element.handleCreate(ref, build);
}
}

View file

@ -5,7 +5,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'flow.freezed.dart';
@freezed
class Flow with _$Flow {
sealed class Flow with _$Flow {
const factory Flow({
required Uri serverUri,
required String state,

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,241 +9,272 @@ part of 'flow.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 _$Flow {
Uri get serverUri => throw _privateConstructorUsedError;
String get state => throw _privateConstructorUsedError;
String get verifier => throw _privateConstructorUsedError;
Cookie get cookie => throw _privateConstructorUsedError;
bool get isFlowComplete => throw _privateConstructorUsedError;
String? get authToken => throw _privateConstructorUsedError;
/// Create a copy of Flow
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$FlowCopyWith<Flow> get copyWith => throw _privateConstructorUsedError;
Uri get serverUri; String get state; String get verifier; Cookie get cookie; bool get isFlowComplete; String? get authToken;
/// Create a copy of Flow
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$FlowCopyWith<Flow> get copyWith => _$FlowCopyWithImpl<Flow>(this as Flow, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is Flow&&(identical(other.serverUri, serverUri) || other.serverUri == serverUri)&&(identical(other.state, state) || other.state == state)&&(identical(other.verifier, verifier) || other.verifier == verifier)&&(identical(other.cookie, cookie) || other.cookie == cookie)&&(identical(other.isFlowComplete, isFlowComplete) || other.isFlowComplete == isFlowComplete)&&(identical(other.authToken, authToken) || other.authToken == authToken));
}
@override
int get hashCode => Object.hash(runtimeType,serverUri,state,verifier,cookie,isFlowComplete,authToken);
@override
String toString() {
return 'Flow(serverUri: $serverUri, state: $state, verifier: $verifier, cookie: $cookie, isFlowComplete: $isFlowComplete, authToken: $authToken)';
}
}
/// @nodoc
abstract class $FlowCopyWith<$Res> {
factory $FlowCopyWith(Flow value, $Res Function(Flow) then) =
_$FlowCopyWithImpl<$Res, Flow>;
@useResult
$Res call(
{Uri serverUri,
String state,
String verifier,
Cookie cookie,
bool isFlowComplete,
String? authToken});
}
abstract mixin class $FlowCopyWith<$Res> {
factory $FlowCopyWith(Flow value, $Res Function(Flow) _then) = _$FlowCopyWithImpl;
@useResult
$Res call({
Uri serverUri, String state, String verifier, Cookie cookie, bool isFlowComplete, String? authToken
});
}
/// @nodoc
class _$FlowCopyWithImpl<$Res, $Val extends Flow>
class _$FlowCopyWithImpl<$Res>
implements $FlowCopyWith<$Res> {
_$FlowCopyWithImpl(this._value, this._then);
_$FlowCopyWithImpl(this._self, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
final Flow _self;
final $Res Function(Flow) _then;
/// Create a copy of Flow
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? serverUri = null,
Object? state = null,
Object? verifier = null,
Object? cookie = null,
Object? isFlowComplete = null,
Object? authToken = freezed,
}) {
return _then(_value.copyWith(
serverUri: null == serverUri
? _value.serverUri
: serverUri // ignore: cast_nullable_to_non_nullable
as Uri,
state: null == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as String,
verifier: null == verifier
? _value.verifier
: verifier // ignore: cast_nullable_to_non_nullable
as String,
cookie: null == cookie
? _value.cookie
: cookie // ignore: cast_nullable_to_non_nullable
as Cookie,
isFlowComplete: null == isFlowComplete
? _value.isFlowComplete
: isFlowComplete // ignore: cast_nullable_to_non_nullable
as bool,
authToken: freezed == authToken
? _value.authToken
: authToken // ignore: cast_nullable_to_non_nullable
as String?,
) as $Val);
}
/// Create a copy of Flow
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? serverUri = null,Object? state = null,Object? verifier = null,Object? cookie = null,Object? isFlowComplete = null,Object? authToken = freezed,}) {
return _then(_self.copyWith(
serverUri: null == serverUri ? _self.serverUri : serverUri // ignore: cast_nullable_to_non_nullable
as Uri,state: null == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
as String,verifier: null == verifier ? _self.verifier : verifier // ignore: cast_nullable_to_non_nullable
as String,cookie: null == cookie ? _self.cookie : cookie // ignore: cast_nullable_to_non_nullable
as Cookie,isFlowComplete: null == isFlowComplete ? _self.isFlowComplete : isFlowComplete // ignore: cast_nullable_to_non_nullable
as bool,authToken: freezed == authToken ? _self.authToken : authToken // ignore: cast_nullable_to_non_nullable
as String?,
));
}
/// @nodoc
abstract class _$$FlowImplCopyWith<$Res> implements $FlowCopyWith<$Res> {
factory _$$FlowImplCopyWith(
_$FlowImpl value, $Res Function(_$FlowImpl) then) =
__$$FlowImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{Uri serverUri,
String state,
String verifier,
Cookie cookie,
bool isFlowComplete,
String? authToken});
}
/// @nodoc
class __$$FlowImplCopyWithImpl<$Res>
extends _$FlowCopyWithImpl<$Res, _$FlowImpl>
implements _$$FlowImplCopyWith<$Res> {
__$$FlowImplCopyWithImpl(_$FlowImpl _value, $Res Function(_$FlowImpl) _then)
: super(_value, _then);
/// Create a copy of Flow
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? serverUri = null,
Object? state = null,
Object? verifier = null,
Object? cookie = null,
Object? isFlowComplete = null,
Object? authToken = freezed,
}) {
return _then(_$FlowImpl(
serverUri: null == serverUri
? _value.serverUri
: serverUri // ignore: cast_nullable_to_non_nullable
as Uri,
state: null == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as String,
verifier: null == verifier
? _value.verifier
: verifier // ignore: cast_nullable_to_non_nullable
as String,
cookie: null == cookie
? _value.cookie
: cookie // ignore: cast_nullable_to_non_nullable
as Cookie,
isFlowComplete: null == isFlowComplete
? _value.isFlowComplete
: isFlowComplete // ignore: cast_nullable_to_non_nullable
as bool,
authToken: freezed == authToken
? _value.authToken
: authToken // ignore: cast_nullable_to_non_nullable
as String?,
));
}
/// Adds pattern-matching-related methods to [Flow].
extension FlowPatterns on Flow {
/// 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( _Flow value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _Flow() 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( _Flow value) $default,){
final _that = this;
switch (_that) {
case _Flow():
return $default(_that);}
}
/// 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( _Flow value)? $default,){
final _that = this;
switch (_that) {
case _Flow() 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( Uri serverUri, String state, String verifier, Cookie cookie, bool isFlowComplete, String? authToken)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _Flow() when $default != null:
return $default(_that.serverUri,_that.state,_that.verifier,_that.cookie,_that.isFlowComplete,_that.authToken);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( Uri serverUri, String state, String verifier, Cookie cookie, bool isFlowComplete, String? authToken) $default,) {final _that = this;
switch (_that) {
case _Flow():
return $default(_that.serverUri,_that.state,_that.verifier,_that.cookie,_that.isFlowComplete,_that.authToken);}
}
/// 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( Uri serverUri, String state, String verifier, Cookie cookie, bool isFlowComplete, String? authToken)? $default,) {final _that = this;
switch (_that) {
case _Flow() when $default != null:
return $default(_that.serverUri,_that.state,_that.verifier,_that.cookie,_that.isFlowComplete,_that.authToken);case _:
return null;
}
}
}
/// @nodoc
class _$FlowImpl implements _Flow {
const _$FlowImpl(
{required this.serverUri,
required this.state,
required this.verifier,
required this.cookie,
this.isFlowComplete = false,
this.authToken});
@override
final Uri serverUri;
@override
final String state;
@override
final String verifier;
@override
final Cookie cookie;
@override
@JsonKey()
final bool isFlowComplete;
@override
final String? authToken;
class _Flow implements Flow {
const _Flow({required this.serverUri, required this.state, required this.verifier, required this.cookie, this.isFlowComplete = false, this.authToken});
@override
String toString() {
return 'Flow(serverUri: $serverUri, state: $state, verifier: $verifier, cookie: $cookie, isFlowComplete: $isFlowComplete, authToken: $authToken)';
}
@override final Uri serverUri;
@override final String state;
@override final String verifier;
@override final Cookie cookie;
@override@JsonKey() final bool isFlowComplete;
@override final String? authToken;
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$FlowImpl &&
(identical(other.serverUri, serverUri) ||
other.serverUri == serverUri) &&
(identical(other.state, state) || other.state == state) &&
(identical(other.verifier, verifier) ||
other.verifier == verifier) &&
(identical(other.cookie, cookie) || other.cookie == cookie) &&
(identical(other.isFlowComplete, isFlowComplete) ||
other.isFlowComplete == isFlowComplete) &&
(identical(other.authToken, authToken) ||
other.authToken == authToken));
}
/// Create a copy of Flow
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$FlowCopyWith<_Flow> get copyWith => __$FlowCopyWithImpl<_Flow>(this, _$identity);
@override
int get hashCode => Object.hash(runtimeType, serverUri, state, verifier,
cookie, isFlowComplete, authToken);
/// Create a copy of Flow
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$FlowImplCopyWith<_$FlowImpl> get copyWith =>
__$$FlowImplCopyWithImpl<_$FlowImpl>(this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _Flow&&(identical(other.serverUri, serverUri) || other.serverUri == serverUri)&&(identical(other.state, state) || other.state == state)&&(identical(other.verifier, verifier) || other.verifier == verifier)&&(identical(other.cookie, cookie) || other.cookie == cookie)&&(identical(other.isFlowComplete, isFlowComplete) || other.isFlowComplete == isFlowComplete)&&(identical(other.authToken, authToken) || other.authToken == authToken));
}
abstract class _Flow implements Flow {
const factory _Flow(
{required final Uri serverUri,
required final String state,
required final String verifier,
required final Cookie cookie,
final bool isFlowComplete,
final String? authToken}) = _$FlowImpl;
@override
Uri get serverUri;
@override
String get state;
@override
String get verifier;
@override
Cookie get cookie;
@override
bool get isFlowComplete;
@override
String? get authToken;
@override
int get hashCode => Object.hash(runtimeType,serverUri,state,verifier,cookie,isFlowComplete,authToken);
/// Create a copy of Flow
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$FlowImplCopyWith<_$FlowImpl> get copyWith =>
throw _privateConstructorUsedError;
@override
String toString() {
return 'Flow(serverUri: $serverUri, state: $state, verifier: $verifier, cookie: $cookie, isFlowComplete: $isFlowComplete, authToken: $authToken)';
}
}
/// @nodoc
abstract mixin class _$FlowCopyWith<$Res> implements $FlowCopyWith<$Res> {
factory _$FlowCopyWith(_Flow value, $Res Function(_Flow) _then) = __$FlowCopyWithImpl;
@override @useResult
$Res call({
Uri serverUri, String state, String verifier, Cookie cookie, bool isFlowComplete, String? authToken
});
}
/// @nodoc
class __$FlowCopyWithImpl<$Res>
implements _$FlowCopyWith<$Res> {
__$FlowCopyWithImpl(this._self, this._then);
final _Flow _self;
final $Res Function(_Flow) _then;
/// Create a copy of Flow
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? serverUri = null,Object? state = null,Object? verifier = null,Object? cookie = null,Object? isFlowComplete = null,Object? authToken = freezed,}) {
return _then(_Flow(
serverUri: null == serverUri ? _self.serverUri : serverUri // ignore: cast_nullable_to_non_nullable
as Uri,state: null == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
as String,verifier: null == verifier ? _self.verifier : verifier // ignore: cast_nullable_to_non_nullable
as String,cookie: null == cookie ? _self.cookie : cookie // ignore: cast_nullable_to_non_nullable
as Cookie,isFlowComplete: null == isFlowComplete ? _self.isFlowComplete : isFlowComplete // ignore: cast_nullable_to_non_nullable
as bool,authToken: freezed == authToken ? _self.authToken : authToken // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
// dart format on

View file

@ -6,221 +6,167 @@ part of 'oauth_provider.dart';
// RiverpodGenerator
// **************************************************************************
String _$loginInExchangeForCodeHash() =>
r'bfc3945529048a0f536052fd5579b76457560fcd';
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
/// Copied from Dart SDK
class _SystemHash {
_SystemHash._();
@ProviderFor(OauthFlows)
final oauthFlowsProvider = OauthFlowsProvider._();
static int combine(int hash, int value) {
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + value);
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
return hash ^ (hash >> 6);
}
static int finish(int hash) {
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
// ignore: parameter_assignments
hash = hash ^ (hash >> 11);
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
}
}
/// the code returned by the server in exchange for the verifier
///
/// Copied from [loginInExchangeForCode].
@ProviderFor(loginInExchangeForCode)
const loginInExchangeForCodeProvider = LoginInExchangeForCodeFamily();
/// the code returned by the server in exchange for the verifier
///
/// Copied from [loginInExchangeForCode].
class LoginInExchangeForCodeFamily extends Family<AsyncValue<String?>> {
/// the code returned by the server in exchange for the verifier
///
/// Copied from [loginInExchangeForCode].
const LoginInExchangeForCodeFamily();
/// the code returned by the server in exchange for the verifier
///
/// Copied from [loginInExchangeForCode].
LoginInExchangeForCodeProvider call({
required String oauthState,
required String code,
ErrorResponseHandler? responseHandler,
}) {
return LoginInExchangeForCodeProvider(
oauthState: oauthState,
code: code,
responseHandler: responseHandler,
);
}
@override
LoginInExchangeForCodeProvider getProviderOverride(
covariant LoginInExchangeForCodeProvider provider,
) {
return call(
oauthState: provider.oauthState,
code: provider.code,
responseHandler: provider.responseHandler,
);
}
static const Iterable<ProviderOrFamily>? _dependencies = null;
@override
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
@override
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
_allTransitiveDependencies;
@override
String? get name => r'loginInExchangeForCodeProvider';
}
/// the code returned by the server in exchange for the verifier
///
/// Copied from [loginInExchangeForCode].
class LoginInExchangeForCodeProvider
extends AutoDisposeFutureProvider<String?> {
/// the code returned by the server in exchange for the verifier
///
/// Copied from [loginInExchangeForCode].
LoginInExchangeForCodeProvider({
required String oauthState,
required String code,
ErrorResponseHandler? responseHandler,
}) : this._internal(
(ref) => loginInExchangeForCode(
ref as LoginInExchangeForCodeRef,
oauthState: oauthState,
code: code,
responseHandler: responseHandler,
),
from: loginInExchangeForCodeProvider,
name: r'loginInExchangeForCodeProvider',
debugGetCreateSourceHash:
const bool.fromEnvironment('dart.vm.product')
? null
: _$loginInExchangeForCodeHash,
dependencies: LoginInExchangeForCodeFamily._dependencies,
allTransitiveDependencies:
LoginInExchangeForCodeFamily._allTransitiveDependencies,
oauthState: oauthState,
code: code,
responseHandler: responseHandler,
);
LoginInExchangeForCodeProvider._internal(
super._createNotifier, {
required super.name,
required super.dependencies,
required super.allTransitiveDependencies,
required super.debugGetCreateSourceHash,
required super.from,
required this.oauthState,
required this.code,
required this.responseHandler,
}) : super.internal();
final String oauthState;
final String code;
final ErrorResponseHandler? responseHandler;
@override
Override overrideWith(
FutureOr<String?> Function(LoginInExchangeForCodeRef provider) create,
) {
return ProviderOverride(
origin: this,
override: LoginInExchangeForCodeProvider._internal(
(ref) => create(ref as LoginInExchangeForCodeRef),
from: from,
name: null,
final class OauthFlowsProvider
extends $NotifierProvider<OauthFlows, Map<State, Flow>> {
OauthFlowsProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'oauthFlowsProvider',
isAutoDispose: false,
dependencies: null,
allTransitiveDependencies: null,
debugGetCreateSourceHash: null,
oauthState: oauthState,
code: code,
responseHandler: responseHandler,
),
);
}
$allTransitiveDependencies: null,
);
@override
AutoDisposeFutureProviderElement<String?> createElement() {
return _LoginInExchangeForCodeProviderElement(this);
String debugGetCreateSourceHash() => _$oauthFlowsHash();
@$internal
@override
OauthFlows create() => OauthFlows();
/// {@macro riverpod.override_with_value}
Override overrideWithValue(Map<State, Flow> value) {
return $ProviderOverride(
origin: this,
providerOverride: $SyncValueProvider<Map<State, Flow>>(value),
);
}
}
String _$oauthFlowsHash() => r'4e278baa0bf26f2a10694ca2caadb68dd5b6156f';
abstract class _$OauthFlows extends $Notifier<Map<State, Flow>> {
Map<State, Flow> build();
@$mustCallSuper
@override
void runBuild() {
final ref = this.ref as $Ref<Map<State, Flow>, Map<State, Flow>>;
final element =
ref.element
as $ClassProviderElement<
AnyNotifier<Map<State, Flow>, Map<State, Flow>>,
Map<State, Flow>,
Object?,
Object?
>;
element.handleCreate(ref, build);
}
}
/// the code returned by the server in exchange for the verifier
@ProviderFor(loginInExchangeForCode)
final loginInExchangeForCodeProvider = LoginInExchangeForCodeFamily._();
/// the code returned by the server in exchange for the verifier
final class LoginInExchangeForCodeProvider
extends $FunctionalProvider<AsyncValue<String?>, String?, FutureOr<String?>>
with $FutureModifier<String?>, $FutureProvider<String?> {
/// the code returned by the server in exchange for the verifier
LoginInExchangeForCodeProvider._({
required LoginInExchangeForCodeFamily super.from,
required ({
State oauthState,
Code code,
ErrorResponseHandler? responseHandler,
})
super.argument,
}) : super(
retry: null,
name: r'loginInExchangeForCodeProvider',
isAutoDispose: true,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$loginInExchangeForCodeHash();
@override
String toString() {
return r'loginInExchangeForCodeProvider'
''
'$argument';
}
@$internal
@override
$FutureProviderElement<String?> $createElement($ProviderPointer pointer) =>
$FutureProviderElement(pointer);
@override
FutureOr<String?> create(Ref ref) {
final argument =
this.argument
as ({
State oauthState,
Code code,
ErrorResponseHandler? responseHandler,
});
return loginInExchangeForCode(
ref,
oauthState: argument.oauthState,
code: argument.code,
responseHandler: argument.responseHandler,
);
}
@override
bool operator ==(Object other) {
return other is LoginInExchangeForCodeProvider &&
other.oauthState == oauthState &&
other.code == code &&
other.responseHandler == responseHandler;
other.argument == argument;
}
@override
int get hashCode {
var hash = _SystemHash.combine(0, runtimeType.hashCode);
hash = _SystemHash.combine(hash, oauthState.hashCode);
hash = _SystemHash.combine(hash, code.hashCode);
hash = _SystemHash.combine(hash, responseHandler.hashCode);
return _SystemHash.finish(hash);
return argument.hashCode;
}
}
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
mixin LoginInExchangeForCodeRef on AutoDisposeFutureProviderRef<String?> {
/// The parameter `oauthState` of this provider.
String get oauthState;
String _$loginInExchangeForCodeHash() =>
r'bfc3945529048a0f536052fd5579b76457560fcd';
/// The parameter `code` of this provider.
String get code;
/// the code returned by the server in exchange for the verifier
/// The parameter `responseHandler` of this provider.
ErrorResponseHandler? get responseHandler;
final class LoginInExchangeForCodeFamily extends $Family
with
$FunctionalFamilyOverride<
FutureOr<String?>,
({State oauthState, Code code, ErrorResponseHandler? responseHandler})
> {
LoginInExchangeForCodeFamily._()
: super(
retry: null,
name: r'loginInExchangeForCodeProvider',
dependencies: null,
$allTransitiveDependencies: null,
isAutoDispose: true,
);
/// the code returned by the server in exchange for the verifier
LoginInExchangeForCodeProvider call({
required State oauthState,
required Code code,
ErrorResponseHandler? responseHandler,
}) => LoginInExchangeForCodeProvider._(
argument: (
oauthState: oauthState,
code: code,
responseHandler: responseHandler,
),
from: this,
);
@override
String toString() => r'loginInExchangeForCodeProvider';
}
class _LoginInExchangeForCodeProviderElement
extends AutoDisposeFutureProviderElement<String?>
with LoginInExchangeForCodeRef {
_LoginInExchangeForCodeProviderElement(super.provider);
@override
String get oauthState =>
(origin as LoginInExchangeForCodeProvider).oauthState;
@override
String get code => (origin as LoginInExchangeForCodeProvider).code;
@override
ErrorResponseHandler? get responseHandler =>
(origin as LoginInExchangeForCodeProvider).responseHandler;
}
String _$oauthFlowsHash() => r'4e278baa0bf26f2a10694ca2caadb68dd5b6156f';
/// See also [OauthFlows].
@ProviderFor(OauthFlows)
final oauthFlowsProvider =
NotifierProvider<OauthFlows, Map<State, Flow>>.internal(
OauthFlows.new,
name: r'oauthFlowsProvider',
debugGetCreateSourceHash:
const bool.fromEnvironment('dart.vm.product') ? null : _$oauthFlowsHash,
dependencies: null,
allTransitiveDependencies: null,
);
typedef _$OauthFlows = Notifier<Map<State, Flow>>;
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

View file

@ -6,7 +6,7 @@ part 'book_settings.g.dart';
/// per book settings
@freezed
class BookSettings with _$BookSettings {
sealed class BookSettings with _$BookSettings {
const factory BookSettings({
required String bookId,
@Default(NullablePlayerSettings()) NullablePlayerSettings playerSettings,

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,195 +9,284 @@ part of 'book_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');
BookSettings _$BookSettingsFromJson(Map<String, dynamic> json) {
return _BookSettings.fromJson(json);
}
/// @nodoc
mixin _$BookSettings {
String get bookId => throw _privateConstructorUsedError;
NullablePlayerSettings get playerSettings =>
throw _privateConstructorUsedError;
String get bookId; NullablePlayerSettings get playerSettings;
/// Create a copy of BookSettings
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$BookSettingsCopyWith<BookSettings> get copyWith => _$BookSettingsCopyWithImpl<BookSettings>(this as BookSettings, _$identity);
/// Serializes this BookSettings to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is BookSettings&&(identical(other.bookId, bookId) || other.bookId == bookId)&&(identical(other.playerSettings, playerSettings) || other.playerSettings == playerSettings));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,bookId,playerSettings);
@override
String toString() {
return 'BookSettings(bookId: $bookId, playerSettings: $playerSettings)';
}
/// Create a copy of BookSettings
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$BookSettingsCopyWith<BookSettings> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $BookSettingsCopyWith<$Res> {
factory $BookSettingsCopyWith(
BookSettings value, $Res Function(BookSettings) then) =
_$BookSettingsCopyWithImpl<$Res, BookSettings>;
@useResult
$Res call({String bookId, NullablePlayerSettings playerSettings});
abstract mixin class $BookSettingsCopyWith<$Res> {
factory $BookSettingsCopyWith(BookSettings value, $Res Function(BookSettings) _then) = _$BookSettingsCopyWithImpl;
@useResult
$Res call({
String bookId, NullablePlayerSettings playerSettings
});
$NullablePlayerSettingsCopyWith<$Res> get playerSettings;
$NullablePlayerSettingsCopyWith<$Res> get playerSettings;
}
/// @nodoc
class _$BookSettingsCopyWithImpl<$Res, $Val extends BookSettings>
class _$BookSettingsCopyWithImpl<$Res>
implements $BookSettingsCopyWith<$Res> {
_$BookSettingsCopyWithImpl(this._value, this._then);
_$BookSettingsCopyWithImpl(this._self, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
final BookSettings _self;
final $Res Function(BookSettings) _then;
/// Create a copy of BookSettings
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? bookId = null,
Object? playerSettings = null,
}) {
return _then(_value.copyWith(
bookId: null == bookId
? _value.bookId
: bookId // ignore: cast_nullable_to_non_nullable
as String,
playerSettings: null == playerSettings
? _value.playerSettings
: playerSettings // ignore: cast_nullable_to_non_nullable
as NullablePlayerSettings,
) as $Val);
}
/// Create a copy of BookSettings
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$NullablePlayerSettingsCopyWith<$Res> get playerSettings {
return $NullablePlayerSettingsCopyWith<$Res>(_value.playerSettings,
(value) {
return _then(_value.copyWith(playerSettings: value) as $Val);
});
}
/// Create a copy of BookSettings
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? bookId = null,Object? playerSettings = null,}) {
return _then(_self.copyWith(
bookId: null == bookId ? _self.bookId : bookId // ignore: cast_nullable_to_non_nullable
as String,playerSettings: null == playerSettings ? _self.playerSettings : playerSettings // ignore: cast_nullable_to_non_nullable
as NullablePlayerSettings,
));
}
/// Create a copy of BookSettings
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$NullablePlayerSettingsCopyWith<$Res> get playerSettings {
return $NullablePlayerSettingsCopyWith<$Res>(_self.playerSettings, (value) {
return _then(_self.copyWith(playerSettings: value));
});
}
}
/// @nodoc
abstract class _$$BookSettingsImplCopyWith<$Res>
implements $BookSettingsCopyWith<$Res> {
factory _$$BookSettingsImplCopyWith(
_$BookSettingsImpl value, $Res Function(_$BookSettingsImpl) then) =
__$$BookSettingsImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String bookId, NullablePlayerSettings playerSettings});
@override
$NullablePlayerSettingsCopyWith<$Res> get playerSettings;
/// Adds pattern-matching-related methods to [BookSettings].
extension BookSettingsPatterns on BookSettings {
/// 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( _BookSettings value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _BookSettings() 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( _BookSettings value) $default,){
final _that = this;
switch (_that) {
case _BookSettings():
return $default(_that);}
}
/// 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( _BookSettings value)? $default,){
final _that = this;
switch (_that) {
case _BookSettings() 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 bookId, NullablePlayerSettings playerSettings)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _BookSettings() when $default != null:
return $default(_that.bookId,_that.playerSettings);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 bookId, NullablePlayerSettings playerSettings) $default,) {final _that = this;
switch (_that) {
case _BookSettings():
return $default(_that.bookId,_that.playerSettings);}
}
/// 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 bookId, NullablePlayerSettings playerSettings)? $default,) {final _that = this;
switch (_that) {
case _BookSettings() when $default != null:
return $default(_that.bookId,_that.playerSettings);case _:
return null;
}
}
/// @nodoc
class __$$BookSettingsImplCopyWithImpl<$Res>
extends _$BookSettingsCopyWithImpl<$Res, _$BookSettingsImpl>
implements _$$BookSettingsImplCopyWith<$Res> {
__$$BookSettingsImplCopyWithImpl(
_$BookSettingsImpl _value, $Res Function(_$BookSettingsImpl) _then)
: super(_value, _then);
/// Create a copy of BookSettings
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? bookId = null,
Object? playerSettings = null,
}) {
return _then(_$BookSettingsImpl(
bookId: null == bookId
? _value.bookId
: bookId // ignore: cast_nullable_to_non_nullable
as String,
playerSettings: null == playerSettings
? _value.playerSettings
: playerSettings // ignore: cast_nullable_to_non_nullable
as NullablePlayerSettings,
));
}
}
/// @nodoc
@JsonSerializable()
class _$BookSettingsImpl implements _BookSettings {
const _$BookSettingsImpl(
{required this.bookId,
this.playerSettings = const NullablePlayerSettings()});
factory _$BookSettingsImpl.fromJson(Map<String, dynamic> json) =>
_$$BookSettingsImplFromJson(json);
class _BookSettings implements BookSettings {
const _BookSettings({required this.bookId, this.playerSettings = const NullablePlayerSettings()});
factory _BookSettings.fromJson(Map<String, dynamic> json) => _$BookSettingsFromJson(json);
@override
final String bookId;
@override
@JsonKey()
final NullablePlayerSettings playerSettings;
@override final String bookId;
@override@JsonKey() final NullablePlayerSettings playerSettings;
@override
String toString() {
return 'BookSettings(bookId: $bookId, playerSettings: $playerSettings)';
}
/// Create a copy of BookSettings
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$BookSettingsCopyWith<_BookSettings> get copyWith => __$BookSettingsCopyWithImpl<_BookSettings>(this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$BookSettingsImpl &&
(identical(other.bookId, bookId) || other.bookId == bookId) &&
(identical(other.playerSettings, playerSettings) ||
other.playerSettings == playerSettings));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, bookId, playerSettings);
/// Create a copy of BookSettings
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$BookSettingsImplCopyWith<_$BookSettingsImpl> get copyWith =>
__$$BookSettingsImplCopyWithImpl<_$BookSettingsImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$BookSettingsImplToJson(
this,
);
}
@override
Map<String, dynamic> toJson() {
return _$BookSettingsToJson(this, );
}
abstract class _BookSettings implements BookSettings {
const factory _BookSettings(
{required final String bookId,
final NullablePlayerSettings playerSettings}) = _$BookSettingsImpl;
factory _BookSettings.fromJson(Map<String, dynamic> json) =
_$BookSettingsImpl.fromJson;
@override
String get bookId;
@override
NullablePlayerSettings get playerSettings;
/// Create a copy of BookSettings
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$BookSettingsImplCopyWith<_$BookSettingsImpl> get copyWith =>
throw _privateConstructorUsedError;
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _BookSettings&&(identical(other.bookId, bookId) || other.bookId == bookId)&&(identical(other.playerSettings, playerSettings) || other.playerSettings == playerSettings));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,bookId,playerSettings);
@override
String toString() {
return 'BookSettings(bookId: $bookId, playerSettings: $playerSettings)';
}
}
/// @nodoc
abstract mixin class _$BookSettingsCopyWith<$Res> implements $BookSettingsCopyWith<$Res> {
factory _$BookSettingsCopyWith(_BookSettings value, $Res Function(_BookSettings) _then) = __$BookSettingsCopyWithImpl;
@override @useResult
$Res call({
String bookId, NullablePlayerSettings playerSettings
});
@override $NullablePlayerSettingsCopyWith<$Res> get playerSettings;
}
/// @nodoc
class __$BookSettingsCopyWithImpl<$Res>
implements _$BookSettingsCopyWith<$Res> {
__$BookSettingsCopyWithImpl(this._self, this._then);
final _BookSettings _self;
final $Res Function(_BookSettings) _then;
/// Create a copy of BookSettings
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? bookId = null,Object? playerSettings = null,}) {
return _then(_BookSettings(
bookId: null == bookId ? _self.bookId : bookId // ignore: cast_nullable_to_non_nullable
as String,playerSettings: null == playerSettings ? _self.playerSettings : playerSettings // ignore: cast_nullable_to_non_nullable
as NullablePlayerSettings,
));
}
/// Create a copy of BookSettings
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$NullablePlayerSettingsCopyWith<$Res> get playerSettings {
return $NullablePlayerSettingsCopyWith<$Res>(_self.playerSettings, (value) {
return _then(_self.copyWith(playerSettings: value));
});
}
}
// dart format on

View file

@ -6,16 +6,17 @@ part of 'book_settings.dart';
// JsonSerializableGenerator
// **************************************************************************
_$BookSettingsImpl _$$BookSettingsImplFromJson(Map<String, dynamic> json) =>
_$BookSettingsImpl(
_BookSettings _$BookSettingsFromJson(Map<String, dynamic> json) =>
_BookSettings(
bookId: json['bookId'] as String,
playerSettings: json['playerSettings'] == null
? const NullablePlayerSettings()
: NullablePlayerSettings.fromJson(
json['playerSettings'] as Map<String, dynamic>),
json['playerSettings'] as Map<String, dynamic>,
),
);
Map<String, dynamic> _$$BookSettingsImplToJson(_$BookSettingsImpl instance) =>
Map<String, dynamic> _$BookSettingsToJson(_BookSettings instance) =>
<String, dynamic>{
'bookId': instance.bookId,
'playerSettings': instance.playerSettings,

View file

@ -5,7 +5,7 @@ part 'nullable_player_settings.freezed.dart';
part 'nullable_player_settings.g.dart';
@freezed
class NullablePlayerSettings with _$NullablePlayerSettings {
sealed class NullablePlayerSettings with _$NullablePlayerSettings {
const factory NullablePlayerSettings({
MinimizedPlayerSettings? miniPlayerSettings,
ExpandedPlayerSettings? expandedPlayerSettings,

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,369 +9,361 @@ part of 'nullable_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');
NullablePlayerSettings _$NullablePlayerSettingsFromJson(
Map<String, dynamic> json) {
return _NullablePlayerSettings.fromJson(json);
}
/// @nodoc
mixin _$NullablePlayerSettings {
MinimizedPlayerSettings? get miniPlayerSettings =>
throw _privateConstructorUsedError;
ExpandedPlayerSettings? get expandedPlayerSettings =>
throw _privateConstructorUsedError;
double? get preferredDefaultVolume => throw _privateConstructorUsedError;
double? get preferredDefaultSpeed => throw _privateConstructorUsedError;
List<double>? get speedOptions => throw _privateConstructorUsedError;
SleepTimerSettings? get sleepTimerSettings =>
throw _privateConstructorUsedError;
Duration? get playbackReportInterval => throw _privateConstructorUsedError;
MinimizedPlayerSettings? get miniPlayerSettings; ExpandedPlayerSettings? get expandedPlayerSettings; double? get preferredDefaultVolume; double? get preferredDefaultSpeed; List<double>? get speedOptions; SleepTimerSettings? get sleepTimerSettings; Duration? get playbackReportInterval;
/// Create a copy of NullablePlayerSettings
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$NullablePlayerSettingsCopyWith<NullablePlayerSettings> get copyWith => _$NullablePlayerSettingsCopyWithImpl<NullablePlayerSettings>(this as NullablePlayerSettings, _$identity);
/// Serializes this NullablePlayerSettings to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is NullablePlayerSettings&&(identical(other.miniPlayerSettings, miniPlayerSettings) || other.miniPlayerSettings == miniPlayerSettings)&&(identical(other.expandedPlayerSettings, expandedPlayerSettings) || other.expandedPlayerSettings == expandedPlayerSettings)&&(identical(other.preferredDefaultVolume, preferredDefaultVolume) || other.preferredDefaultVolume == preferredDefaultVolume)&&(identical(other.preferredDefaultSpeed, preferredDefaultSpeed) || other.preferredDefaultSpeed == preferredDefaultSpeed)&&const DeepCollectionEquality().equals(other.speedOptions, speedOptions)&&(identical(other.sleepTimerSettings, sleepTimerSettings) || other.sleepTimerSettings == sleepTimerSettings)&&(identical(other.playbackReportInterval, playbackReportInterval) || other.playbackReportInterval == playbackReportInterval));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,miniPlayerSettings,expandedPlayerSettings,preferredDefaultVolume,preferredDefaultSpeed,const DeepCollectionEquality().hash(speedOptions),sleepTimerSettings,playbackReportInterval);
@override
String toString() {
return 'NullablePlayerSettings(miniPlayerSettings: $miniPlayerSettings, expandedPlayerSettings: $expandedPlayerSettings, preferredDefaultVolume: $preferredDefaultVolume, preferredDefaultSpeed: $preferredDefaultSpeed, speedOptions: $speedOptions, sleepTimerSettings: $sleepTimerSettings, playbackReportInterval: $playbackReportInterval)';
}
/// Create a copy of NullablePlayerSettings
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$NullablePlayerSettingsCopyWith<NullablePlayerSettings> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $NullablePlayerSettingsCopyWith<$Res> {
factory $NullablePlayerSettingsCopyWith(NullablePlayerSettings value,
$Res Function(NullablePlayerSettings) then) =
_$NullablePlayerSettingsCopyWithImpl<$Res, NullablePlayerSettings>;
@useResult
$Res call(
{MinimizedPlayerSettings? miniPlayerSettings,
ExpandedPlayerSettings? expandedPlayerSettings,
double? preferredDefaultVolume,
double? preferredDefaultSpeed,
List<double>? speedOptions,
SleepTimerSettings? sleepTimerSettings,
Duration? playbackReportInterval});
abstract mixin class $NullablePlayerSettingsCopyWith<$Res> {
factory $NullablePlayerSettingsCopyWith(NullablePlayerSettings value, $Res Function(NullablePlayerSettings) _then) = _$NullablePlayerSettingsCopyWithImpl;
@useResult
$Res call({
MinimizedPlayerSettings? miniPlayerSettings, ExpandedPlayerSettings? expandedPlayerSettings, double? preferredDefaultVolume, double? preferredDefaultSpeed, List<double>? speedOptions, SleepTimerSettings? sleepTimerSettings, Duration? playbackReportInterval
});
$MinimizedPlayerSettingsCopyWith<$Res>? get miniPlayerSettings;$ExpandedPlayerSettingsCopyWith<$Res>? get expandedPlayerSettings;$SleepTimerSettingsCopyWith<$Res>? get sleepTimerSettings;
$MinimizedPlayerSettingsCopyWith<$Res>? get miniPlayerSettings;
$ExpandedPlayerSettingsCopyWith<$Res>? get expandedPlayerSettings;
$SleepTimerSettingsCopyWith<$Res>? get sleepTimerSettings;
}
/// @nodoc
class _$NullablePlayerSettingsCopyWithImpl<$Res,
$Val extends NullablePlayerSettings>
class _$NullablePlayerSettingsCopyWithImpl<$Res>
implements $NullablePlayerSettingsCopyWith<$Res> {
_$NullablePlayerSettingsCopyWithImpl(this._value, this._then);
_$NullablePlayerSettingsCopyWithImpl(this._self, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
final NullablePlayerSettings _self;
final $Res Function(NullablePlayerSettings) _then;
/// Create a copy of NullablePlayerSettings
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? miniPlayerSettings = freezed,
Object? expandedPlayerSettings = freezed,
Object? preferredDefaultVolume = freezed,
Object? preferredDefaultSpeed = freezed,
Object? speedOptions = freezed,
Object? sleepTimerSettings = freezed,
Object? playbackReportInterval = freezed,
}) {
return _then(_value.copyWith(
miniPlayerSettings: freezed == miniPlayerSettings
? _value.miniPlayerSettings
: miniPlayerSettings // ignore: cast_nullable_to_non_nullable
as MinimizedPlayerSettings?,
expandedPlayerSettings: freezed == expandedPlayerSettings
? _value.expandedPlayerSettings
: expandedPlayerSettings // ignore: cast_nullable_to_non_nullable
as ExpandedPlayerSettings?,
preferredDefaultVolume: freezed == preferredDefaultVolume
? _value.preferredDefaultVolume
: preferredDefaultVolume // ignore: cast_nullable_to_non_nullable
as double?,
preferredDefaultSpeed: freezed == preferredDefaultSpeed
? _value.preferredDefaultSpeed
: preferredDefaultSpeed // ignore: cast_nullable_to_non_nullable
as double?,
speedOptions: freezed == speedOptions
? _value.speedOptions
: speedOptions // ignore: cast_nullable_to_non_nullable
as List<double>?,
sleepTimerSettings: freezed == sleepTimerSettings
? _value.sleepTimerSettings
: sleepTimerSettings // ignore: cast_nullable_to_non_nullable
as SleepTimerSettings?,
playbackReportInterval: freezed == playbackReportInterval
? _value.playbackReportInterval
: playbackReportInterval // ignore: cast_nullable_to_non_nullable
as Duration?,
) as $Val);
/// Create a copy of NullablePlayerSettings
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? miniPlayerSettings = freezed,Object? expandedPlayerSettings = freezed,Object? preferredDefaultVolume = freezed,Object? preferredDefaultSpeed = freezed,Object? speedOptions = freezed,Object? sleepTimerSettings = freezed,Object? playbackReportInterval = freezed,}) {
return _then(_self.copyWith(
miniPlayerSettings: freezed == miniPlayerSettings ? _self.miniPlayerSettings : miniPlayerSettings // ignore: cast_nullable_to_non_nullable
as MinimizedPlayerSettings?,expandedPlayerSettings: freezed == expandedPlayerSettings ? _self.expandedPlayerSettings : expandedPlayerSettings // ignore: cast_nullable_to_non_nullable
as ExpandedPlayerSettings?,preferredDefaultVolume: freezed == preferredDefaultVolume ? _self.preferredDefaultVolume : preferredDefaultVolume // ignore: cast_nullable_to_non_nullable
as double?,preferredDefaultSpeed: freezed == preferredDefaultSpeed ? _self.preferredDefaultSpeed : preferredDefaultSpeed // ignore: cast_nullable_to_non_nullable
as double?,speedOptions: freezed == speedOptions ? _self.speedOptions : speedOptions // ignore: cast_nullable_to_non_nullable
as List<double>?,sleepTimerSettings: freezed == sleepTimerSettings ? _self.sleepTimerSettings : sleepTimerSettings // ignore: cast_nullable_to_non_nullable
as SleepTimerSettings?,playbackReportInterval: freezed == playbackReportInterval ? _self.playbackReportInterval : playbackReportInterval // ignore: cast_nullable_to_non_nullable
as Duration?,
));
}
/// Create a copy of NullablePlayerSettings
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$MinimizedPlayerSettingsCopyWith<$Res>? get miniPlayerSettings {
if (_self.miniPlayerSettings == null) {
return null;
}
/// Create a copy of NullablePlayerSettings
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$MinimizedPlayerSettingsCopyWith<$Res>? get miniPlayerSettings {
if (_value.miniPlayerSettings == null) {
return null;
}
return $MinimizedPlayerSettingsCopyWith<$Res>(_value.miniPlayerSettings!,
(value) {
return _then(_value.copyWith(miniPlayerSettings: value) as $Val);
});
return $MinimizedPlayerSettingsCopyWith<$Res>(_self.miniPlayerSettings!, (value) {
return _then(_self.copyWith(miniPlayerSettings: value));
});
}/// Create a copy of NullablePlayerSettings
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ExpandedPlayerSettingsCopyWith<$Res>? get expandedPlayerSettings {
if (_self.expandedPlayerSettings == null) {
return null;
}
/// Create a copy of NullablePlayerSettings
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ExpandedPlayerSettingsCopyWith<$Res>? get expandedPlayerSettings {
if (_value.expandedPlayerSettings == null) {
return null;
}
return $ExpandedPlayerSettingsCopyWith<$Res>(_value.expandedPlayerSettings!,
(value) {
return _then(_value.copyWith(expandedPlayerSettings: value) as $Val);
});
return $ExpandedPlayerSettingsCopyWith<$Res>(_self.expandedPlayerSettings!, (value) {
return _then(_self.copyWith(expandedPlayerSettings: value));
});
}/// Create a copy of NullablePlayerSettings
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$SleepTimerSettingsCopyWith<$Res>? get sleepTimerSettings {
if (_self.sleepTimerSettings == null) {
return null;
}
/// Create a copy of NullablePlayerSettings
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$SleepTimerSettingsCopyWith<$Res>? get sleepTimerSettings {
if (_value.sleepTimerSettings == null) {
return null;
}
return $SleepTimerSettingsCopyWith<$Res>(_value.sleepTimerSettings!,
(value) {
return _then(_value.copyWith(sleepTimerSettings: value) as $Val);
});
}
return $SleepTimerSettingsCopyWith<$Res>(_self.sleepTimerSettings!, (value) {
return _then(_self.copyWith(sleepTimerSettings: value));
});
}
}
/// @nodoc
abstract class _$$NullablePlayerSettingsImplCopyWith<$Res>
implements $NullablePlayerSettingsCopyWith<$Res> {
factory _$$NullablePlayerSettingsImplCopyWith(
_$NullablePlayerSettingsImpl value,
$Res Function(_$NullablePlayerSettingsImpl) then) =
__$$NullablePlayerSettingsImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{MinimizedPlayerSettings? miniPlayerSettings,
ExpandedPlayerSettings? expandedPlayerSettings,
double? preferredDefaultVolume,
double? preferredDefaultSpeed,
List<double>? speedOptions,
SleepTimerSettings? sleepTimerSettings,
Duration? playbackReportInterval});
@override
$MinimizedPlayerSettingsCopyWith<$Res>? get miniPlayerSettings;
@override
$ExpandedPlayerSettingsCopyWith<$Res>? get expandedPlayerSettings;
@override
$SleepTimerSettingsCopyWith<$Res>? get sleepTimerSettings;
/// Adds pattern-matching-related methods to [NullablePlayerSettings].
extension NullablePlayerSettingsPatterns on NullablePlayerSettings {
/// 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( _NullablePlayerSettings value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _NullablePlayerSettings() 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( _NullablePlayerSettings value) $default,){
final _that = this;
switch (_that) {
case _NullablePlayerSettings():
return $default(_that);}
}
/// 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( _NullablePlayerSettings value)? $default,){
final _that = this;
switch (_that) {
case _NullablePlayerSettings() 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( MinimizedPlayerSettings? miniPlayerSettings, ExpandedPlayerSettings? expandedPlayerSettings, double? preferredDefaultVolume, double? preferredDefaultSpeed, List<double>? speedOptions, SleepTimerSettings? sleepTimerSettings, Duration? playbackReportInterval)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _NullablePlayerSettings() when $default != null:
return $default(_that.miniPlayerSettings,_that.expandedPlayerSettings,_that.preferredDefaultVolume,_that.preferredDefaultSpeed,_that.speedOptions,_that.sleepTimerSettings,_that.playbackReportInterval);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( MinimizedPlayerSettings? miniPlayerSettings, ExpandedPlayerSettings? expandedPlayerSettings, double? preferredDefaultVolume, double? preferredDefaultSpeed, List<double>? speedOptions, SleepTimerSettings? sleepTimerSettings, Duration? playbackReportInterval) $default,) {final _that = this;
switch (_that) {
case _NullablePlayerSettings():
return $default(_that.miniPlayerSettings,_that.expandedPlayerSettings,_that.preferredDefaultVolume,_that.preferredDefaultSpeed,_that.speedOptions,_that.sleepTimerSettings,_that.playbackReportInterval);}
}
/// 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( MinimizedPlayerSettings? miniPlayerSettings, ExpandedPlayerSettings? expandedPlayerSettings, double? preferredDefaultVolume, double? preferredDefaultSpeed, List<double>? speedOptions, SleepTimerSettings? sleepTimerSettings, Duration? playbackReportInterval)? $default,) {final _that = this;
switch (_that) {
case _NullablePlayerSettings() when $default != null:
return $default(_that.miniPlayerSettings,_that.expandedPlayerSettings,_that.preferredDefaultVolume,_that.preferredDefaultSpeed,_that.speedOptions,_that.sleepTimerSettings,_that.playbackReportInterval);case _:
return null;
}
}
/// @nodoc
class __$$NullablePlayerSettingsImplCopyWithImpl<$Res>
extends _$NullablePlayerSettingsCopyWithImpl<$Res,
_$NullablePlayerSettingsImpl>
implements _$$NullablePlayerSettingsImplCopyWith<$Res> {
__$$NullablePlayerSettingsImplCopyWithImpl(
_$NullablePlayerSettingsImpl _value,
$Res Function(_$NullablePlayerSettingsImpl) _then)
: super(_value, _then);
/// Create a copy of NullablePlayerSettings
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? miniPlayerSettings = freezed,
Object? expandedPlayerSettings = freezed,
Object? preferredDefaultVolume = freezed,
Object? preferredDefaultSpeed = freezed,
Object? speedOptions = freezed,
Object? sleepTimerSettings = freezed,
Object? playbackReportInterval = freezed,
}) {
return _then(_$NullablePlayerSettingsImpl(
miniPlayerSettings: freezed == miniPlayerSettings
? _value.miniPlayerSettings
: miniPlayerSettings // ignore: cast_nullable_to_non_nullable
as MinimizedPlayerSettings?,
expandedPlayerSettings: freezed == expandedPlayerSettings
? _value.expandedPlayerSettings
: expandedPlayerSettings // ignore: cast_nullable_to_non_nullable
as ExpandedPlayerSettings?,
preferredDefaultVolume: freezed == preferredDefaultVolume
? _value.preferredDefaultVolume
: preferredDefaultVolume // ignore: cast_nullable_to_non_nullable
as double?,
preferredDefaultSpeed: freezed == preferredDefaultSpeed
? _value.preferredDefaultSpeed
: preferredDefaultSpeed // ignore: cast_nullable_to_non_nullable
as double?,
speedOptions: freezed == speedOptions
? _value._speedOptions
: speedOptions // ignore: cast_nullable_to_non_nullable
as List<double>?,
sleepTimerSettings: freezed == sleepTimerSettings
? _value.sleepTimerSettings
: sleepTimerSettings // ignore: cast_nullable_to_non_nullable
as SleepTimerSettings?,
playbackReportInterval: freezed == playbackReportInterval
? _value.playbackReportInterval
: playbackReportInterval // ignore: cast_nullable_to_non_nullable
as Duration?,
));
}
}
/// @nodoc
@JsonSerializable()
class _$NullablePlayerSettingsImpl implements _NullablePlayerSettings {
const _$NullablePlayerSettingsImpl(
{this.miniPlayerSettings,
this.expandedPlayerSettings,
this.preferredDefaultVolume,
this.preferredDefaultSpeed,
final List<double>? speedOptions,
this.sleepTimerSettings,
this.playbackReportInterval})
: _speedOptions = speedOptions;
factory _$NullablePlayerSettingsImpl.fromJson(Map<String, dynamic> json) =>
_$$NullablePlayerSettingsImplFromJson(json);
class _NullablePlayerSettings implements NullablePlayerSettings {
const _NullablePlayerSettings({this.miniPlayerSettings, this.expandedPlayerSettings, this.preferredDefaultVolume, this.preferredDefaultSpeed, final List<double>? speedOptions, this.sleepTimerSettings, this.playbackReportInterval}): _speedOptions = speedOptions;
factory _NullablePlayerSettings.fromJson(Map<String, dynamic> json) => _$NullablePlayerSettingsFromJson(json);
@override
final MinimizedPlayerSettings? miniPlayerSettings;
@override
final ExpandedPlayerSettings? expandedPlayerSettings;
@override
final double? preferredDefaultVolume;
@override
final double? preferredDefaultSpeed;
final List<double>? _speedOptions;
@override
List<double>? get speedOptions {
final value = _speedOptions;
if (value == null) return null;
if (_speedOptions is EqualUnmodifiableListView) return _speedOptions;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(value);
}
@override
final SleepTimerSettings? sleepTimerSettings;
@override
final Duration? playbackReportInterval;
@override
String toString() {
return 'NullablePlayerSettings(miniPlayerSettings: $miniPlayerSettings, expandedPlayerSettings: $expandedPlayerSettings, preferredDefaultVolume: $preferredDefaultVolume, preferredDefaultSpeed: $preferredDefaultSpeed, speedOptions: $speedOptions, sleepTimerSettings: $sleepTimerSettings, playbackReportInterval: $playbackReportInterval)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$NullablePlayerSettingsImpl &&
(identical(other.miniPlayerSettings, miniPlayerSettings) ||
other.miniPlayerSettings == miniPlayerSettings) &&
(identical(other.expandedPlayerSettings, expandedPlayerSettings) ||
other.expandedPlayerSettings == expandedPlayerSettings) &&
(identical(other.preferredDefaultVolume, preferredDefaultVolume) ||
other.preferredDefaultVolume == preferredDefaultVolume) &&
(identical(other.preferredDefaultSpeed, preferredDefaultSpeed) ||
other.preferredDefaultSpeed == preferredDefaultSpeed) &&
const DeepCollectionEquality()
.equals(other._speedOptions, _speedOptions) &&
(identical(other.sleepTimerSettings, sleepTimerSettings) ||
other.sleepTimerSettings == sleepTimerSettings) &&
(identical(other.playbackReportInterval, playbackReportInterval) ||
other.playbackReportInterval == playbackReportInterval));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
miniPlayerSettings,
expandedPlayerSettings,
preferredDefaultVolume,
preferredDefaultSpeed,
const DeepCollectionEquality().hash(_speedOptions),
sleepTimerSettings,
playbackReportInterval);
/// Create a copy of NullablePlayerSettings
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$NullablePlayerSettingsImplCopyWith<_$NullablePlayerSettingsImpl>
get copyWith => __$$NullablePlayerSettingsImplCopyWithImpl<
_$NullablePlayerSettingsImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$NullablePlayerSettingsImplToJson(
this,
);
}
@override final MinimizedPlayerSettings? miniPlayerSettings;
@override final ExpandedPlayerSettings? expandedPlayerSettings;
@override final double? preferredDefaultVolume;
@override final double? preferredDefaultSpeed;
final List<double>? _speedOptions;
@override List<double>? get speedOptions {
final value = _speedOptions;
if (value == null) return null;
if (_speedOptions is EqualUnmodifiableListView) return _speedOptions;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(value);
}
abstract class _NullablePlayerSettings implements NullablePlayerSettings {
const factory _NullablePlayerSettings(
{final MinimizedPlayerSettings? miniPlayerSettings,
final ExpandedPlayerSettings? expandedPlayerSettings,
final double? preferredDefaultVolume,
final double? preferredDefaultSpeed,
final List<double>? speedOptions,
final SleepTimerSettings? sleepTimerSettings,
final Duration? playbackReportInterval}) = _$NullablePlayerSettingsImpl;
@override final SleepTimerSettings? sleepTimerSettings;
@override final Duration? playbackReportInterval;
factory _NullablePlayerSettings.fromJson(Map<String, dynamic> json) =
_$NullablePlayerSettingsImpl.fromJson;
/// Create a copy of NullablePlayerSettings
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$NullablePlayerSettingsCopyWith<_NullablePlayerSettings> get copyWith => __$NullablePlayerSettingsCopyWithImpl<_NullablePlayerSettings>(this, _$identity);
@override
MinimizedPlayerSettings? get miniPlayerSettings;
@override
ExpandedPlayerSettings? get expandedPlayerSettings;
@override
double? get preferredDefaultVolume;
@override
double? get preferredDefaultSpeed;
@override
List<double>? get speedOptions;
@override
SleepTimerSettings? get sleepTimerSettings;
@override
Duration? get playbackReportInterval;
/// Create a copy of NullablePlayerSettings
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$NullablePlayerSettingsImplCopyWith<_$NullablePlayerSettingsImpl>
get copyWith => throw _privateConstructorUsedError;
@override
Map<String, dynamic> toJson() {
return _$NullablePlayerSettingsToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _NullablePlayerSettings&&(identical(other.miniPlayerSettings, miniPlayerSettings) || other.miniPlayerSettings == miniPlayerSettings)&&(identical(other.expandedPlayerSettings, expandedPlayerSettings) || other.expandedPlayerSettings == expandedPlayerSettings)&&(identical(other.preferredDefaultVolume, preferredDefaultVolume) || other.preferredDefaultVolume == preferredDefaultVolume)&&(identical(other.preferredDefaultSpeed, preferredDefaultSpeed) || other.preferredDefaultSpeed == preferredDefaultSpeed)&&const DeepCollectionEquality().equals(other._speedOptions, _speedOptions)&&(identical(other.sleepTimerSettings, sleepTimerSettings) || other.sleepTimerSettings == sleepTimerSettings)&&(identical(other.playbackReportInterval, playbackReportInterval) || other.playbackReportInterval == playbackReportInterval));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,miniPlayerSettings,expandedPlayerSettings,preferredDefaultVolume,preferredDefaultSpeed,const DeepCollectionEquality().hash(_speedOptions),sleepTimerSettings,playbackReportInterval);
@override
String toString() {
return 'NullablePlayerSettings(miniPlayerSettings: $miniPlayerSettings, expandedPlayerSettings: $expandedPlayerSettings, preferredDefaultVolume: $preferredDefaultVolume, preferredDefaultSpeed: $preferredDefaultSpeed, speedOptions: $speedOptions, sleepTimerSettings: $sleepTimerSettings, playbackReportInterval: $playbackReportInterval)';
}
}
/// @nodoc
abstract mixin class _$NullablePlayerSettingsCopyWith<$Res> implements $NullablePlayerSettingsCopyWith<$Res> {
factory _$NullablePlayerSettingsCopyWith(_NullablePlayerSettings value, $Res Function(_NullablePlayerSettings) _then) = __$NullablePlayerSettingsCopyWithImpl;
@override @useResult
$Res call({
MinimizedPlayerSettings? miniPlayerSettings, ExpandedPlayerSettings? expandedPlayerSettings, double? preferredDefaultVolume, double? preferredDefaultSpeed, List<double>? speedOptions, SleepTimerSettings? sleepTimerSettings, Duration? playbackReportInterval
});
@override $MinimizedPlayerSettingsCopyWith<$Res>? get miniPlayerSettings;@override $ExpandedPlayerSettingsCopyWith<$Res>? get expandedPlayerSettings;@override $SleepTimerSettingsCopyWith<$Res>? get sleepTimerSettings;
}
/// @nodoc
class __$NullablePlayerSettingsCopyWithImpl<$Res>
implements _$NullablePlayerSettingsCopyWith<$Res> {
__$NullablePlayerSettingsCopyWithImpl(this._self, this._then);
final _NullablePlayerSettings _self;
final $Res Function(_NullablePlayerSettings) _then;
/// Create a copy of NullablePlayerSettings
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? miniPlayerSettings = freezed,Object? expandedPlayerSettings = freezed,Object? preferredDefaultVolume = freezed,Object? preferredDefaultSpeed = freezed,Object? speedOptions = freezed,Object? sleepTimerSettings = freezed,Object? playbackReportInterval = freezed,}) {
return _then(_NullablePlayerSettings(
miniPlayerSettings: freezed == miniPlayerSettings ? _self.miniPlayerSettings : miniPlayerSettings // ignore: cast_nullable_to_non_nullable
as MinimizedPlayerSettings?,expandedPlayerSettings: freezed == expandedPlayerSettings ? _self.expandedPlayerSettings : expandedPlayerSettings // ignore: cast_nullable_to_non_nullable
as ExpandedPlayerSettings?,preferredDefaultVolume: freezed == preferredDefaultVolume ? _self.preferredDefaultVolume : preferredDefaultVolume // ignore: cast_nullable_to_non_nullable
as double?,preferredDefaultSpeed: freezed == preferredDefaultSpeed ? _self.preferredDefaultSpeed : preferredDefaultSpeed // ignore: cast_nullable_to_non_nullable
as double?,speedOptions: freezed == speedOptions ? _self._speedOptions : speedOptions // ignore: cast_nullable_to_non_nullable
as List<double>?,sleepTimerSettings: freezed == sleepTimerSettings ? _self.sleepTimerSettings : sleepTimerSettings // ignore: cast_nullable_to_non_nullable
as SleepTimerSettings?,playbackReportInterval: freezed == playbackReportInterval ? _self.playbackReportInterval : playbackReportInterval // ignore: cast_nullable_to_non_nullable
as Duration?,
));
}
/// Create a copy of NullablePlayerSettings
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$MinimizedPlayerSettingsCopyWith<$Res>? get miniPlayerSettings {
if (_self.miniPlayerSettings == null) {
return null;
}
return $MinimizedPlayerSettingsCopyWith<$Res>(_self.miniPlayerSettings!, (value) {
return _then(_self.copyWith(miniPlayerSettings: value));
});
}/// Create a copy of NullablePlayerSettings
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ExpandedPlayerSettingsCopyWith<$Res>? get expandedPlayerSettings {
if (_self.expandedPlayerSettings == null) {
return null;
}
return $ExpandedPlayerSettingsCopyWith<$Res>(_self.expandedPlayerSettings!, (value) {
return _then(_self.copyWith(expandedPlayerSettings: value));
});
}/// Create a copy of NullablePlayerSettings
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$SleepTimerSettingsCopyWith<$Res>? get sleepTimerSettings {
if (_self.sleepTimerSettings == null) {
return null;
}
return $SleepTimerSettingsCopyWith<$Res>(_self.sleepTimerSettings!, (value) {
return _then(_self.copyWith(sleepTimerSettings: value));
});
}
}
// dart format on

View file

@ -6,42 +6,42 @@ part of 'nullable_player_settings.dart';
// JsonSerializableGenerator
// **************************************************************************
_$NullablePlayerSettingsImpl _$$NullablePlayerSettingsImplFromJson(
Map<String, dynamic> json) =>
_$NullablePlayerSettingsImpl(
miniPlayerSettings: json['miniPlayerSettings'] == null
? null
: MinimizedPlayerSettings.fromJson(
json['miniPlayerSettings'] as Map<String, dynamic>),
expandedPlayerSettings: json['expandedPlayerSettings'] == null
? null
: ExpandedPlayerSettings.fromJson(
json['expandedPlayerSettings'] as Map<String, dynamic>),
preferredDefaultVolume:
(json['preferredDefaultVolume'] as num?)?.toDouble(),
preferredDefaultSpeed:
(json['preferredDefaultSpeed'] as num?)?.toDouble(),
speedOptions: (json['speedOptions'] as List<dynamic>?)
?.map((e) => (e as num).toDouble())
.toList(),
sleepTimerSettings: json['sleepTimerSettings'] == null
? null
: SleepTimerSettings.fromJson(
json['sleepTimerSettings'] as Map<String, dynamic>),
playbackReportInterval: json['playbackReportInterval'] == null
? null
: Duration(
microseconds: (json['playbackReportInterval'] as num).toInt()),
);
_NullablePlayerSettings _$NullablePlayerSettingsFromJson(
Map<String, dynamic> json,
) => _NullablePlayerSettings(
miniPlayerSettings: json['miniPlayerSettings'] == null
? null
: MinimizedPlayerSettings.fromJson(
json['miniPlayerSettings'] as Map<String, dynamic>,
),
expandedPlayerSettings: json['expandedPlayerSettings'] == null
? null
: ExpandedPlayerSettings.fromJson(
json['expandedPlayerSettings'] as Map<String, dynamic>,
),
preferredDefaultVolume: (json['preferredDefaultVolume'] as num?)?.toDouble(),
preferredDefaultSpeed: (json['preferredDefaultSpeed'] as num?)?.toDouble(),
speedOptions: (json['speedOptions'] as List<dynamic>?)
?.map((e) => (e as num).toDouble())
.toList(),
sleepTimerSettings: json['sleepTimerSettings'] == null
? null
: SleepTimerSettings.fromJson(
json['sleepTimerSettings'] as Map<String, dynamic>,
),
playbackReportInterval: json['playbackReportInterval'] == null
? null
: Duration(microseconds: (json['playbackReportInterval'] as num).toInt()),
);
Map<String, dynamic> _$$NullablePlayerSettingsImplToJson(
_$NullablePlayerSettingsImpl instance) =>
<String, dynamic>{
'miniPlayerSettings': instance.miniPlayerSettings,
'expandedPlayerSettings': instance.expandedPlayerSettings,
'preferredDefaultVolume': instance.preferredDefaultVolume,
'preferredDefaultSpeed': instance.preferredDefaultSpeed,
'speedOptions': instance.speedOptions,
'sleepTimerSettings': instance.sleepTimerSettings,
'playbackReportInterval': instance.playbackReportInterval?.inMicroseconds,
};
Map<String, dynamic> _$NullablePlayerSettingsToJson(
_NullablePlayerSettings instance,
) => <String, dynamic>{
'miniPlayerSettings': instance.miniPlayerSettings,
'expandedPlayerSettings': instance.expandedPlayerSettings,
'preferredDefaultVolume': instance.preferredDefaultVolume,
'preferredDefaultSpeed': instance.preferredDefaultSpeed,
'speedOptions': instance.speedOptions,
'sleepTimerSettings': instance.sleepTimerSettings,
'playbackReportInterval': instance.playbackReportInterval?.inMicroseconds,
};

View file

@ -6,171 +6,102 @@ part of 'book_settings_provider.dart';
// RiverpodGenerator
// **************************************************************************
String _$bookSettingsHash() => r'b976df954edf98ec6ccb3eb41e9d07dd4a9193eb';
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
/// Copied from Dart SDK
class _SystemHash {
_SystemHash._();
static int combine(int hash, int value) {
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + value);
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
return hash ^ (hash >> 6);
}
static int finish(int hash) {
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
// ignore: parameter_assignments
hash = hash ^ (hash >> 11);
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
}
}
abstract class _$BookSettings
extends BuildlessAutoDisposeNotifier<model.BookSettings> {
late final String bookId;
model.BookSettings build(
String bookId,
);
}
/// See also [BookSettings].
@ProviderFor(BookSettings)
const bookSettingsProvider = BookSettingsFamily();
final bookSettingsProvider = BookSettingsFamily._();
/// See also [BookSettings].
class BookSettingsFamily extends Family<model.BookSettings> {
/// See also [BookSettings].
const BookSettingsFamily();
final class BookSettingsProvider
extends $NotifierProvider<BookSettings, model.BookSettings> {
BookSettingsProvider._({
required BookSettingsFamily super.from,
required String super.argument,
}) : super(
retry: null,
name: r'bookSettingsProvider',
isAutoDispose: true,
dependencies: null,
$allTransitiveDependencies: null,
);
/// See also [BookSettings].
BookSettingsProvider call(
String bookId,
) {
return BookSettingsProvider(
bookId,
);
@override
String debugGetCreateSourceHash() => _$bookSettingsHash();
@override
String toString() {
return r'bookSettingsProvider'
''
'($argument)';
}
@$internal
@override
BookSettingsProvider getProviderOverride(
covariant BookSettingsProvider provider,
) {
return call(
provider.bookId,
);
}
BookSettings create() => BookSettings();
static const Iterable<ProviderOrFamily>? _dependencies = null;
@override
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
@override
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
_allTransitiveDependencies;
@override
String? get name => r'bookSettingsProvider';
}
/// See also [BookSettings].
class BookSettingsProvider
extends AutoDisposeNotifierProviderImpl<BookSettings, model.BookSettings> {
/// See also [BookSettings].
BookSettingsProvider(
String bookId,
) : this._internal(
() => BookSettings()..bookId = bookId,
from: bookSettingsProvider,
name: r'bookSettingsProvider',
debugGetCreateSourceHash:
const bool.fromEnvironment('dart.vm.product')
? null
: _$bookSettingsHash,
dependencies: BookSettingsFamily._dependencies,
allTransitiveDependencies:
BookSettingsFamily._allTransitiveDependencies,
bookId: bookId,
);
BookSettingsProvider._internal(
super._createNotifier, {
required super.name,
required super.dependencies,
required super.allTransitiveDependencies,
required super.debugGetCreateSourceHash,
required super.from,
required this.bookId,
}) : super.internal();
final String bookId;
@override
model.BookSettings runNotifierBuild(
covariant BookSettings notifier,
) {
return notifier.build(
bookId,
);
}
@override
Override overrideWith(BookSettings Function() create) {
return ProviderOverride(
/// {@macro riverpod.override_with_value}
Override overrideWithValue(model.BookSettings value) {
return $ProviderOverride(
origin: this,
override: BookSettingsProvider._internal(
() => create()..bookId = bookId,
from: from,
name: null,
dependencies: null,
allTransitiveDependencies: null,
debugGetCreateSourceHash: null,
bookId: bookId,
),
providerOverride: $SyncValueProvider<model.BookSettings>(value),
);
}
@override
AutoDisposeNotifierProviderElement<BookSettings, model.BookSettings>
createElement() {
return _BookSettingsProviderElement(this);
}
@override
bool operator ==(Object other) {
return other is BookSettingsProvider && other.bookId == bookId;
return other is BookSettingsProvider && other.argument == argument;
}
@override
int get hashCode {
var hash = _SystemHash.combine(0, runtimeType.hashCode);
hash = _SystemHash.combine(hash, bookId.hashCode);
return _SystemHash.finish(hash);
return argument.hashCode;
}
}
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
mixin BookSettingsRef on AutoDisposeNotifierProviderRef<model.BookSettings> {
/// The parameter `bookId` of this provider.
String get bookId;
}
String _$bookSettingsHash() => r'b976df954edf98ec6ccb3eb41e9d07dd4a9193eb';
class _BookSettingsProviderElement
extends AutoDisposeNotifierProviderElement<BookSettings, model.BookSettings>
with BookSettingsRef {
_BookSettingsProviderElement(super.provider);
final class BookSettingsFamily extends $Family
with
$ClassFamilyOverride<
BookSettings,
model.BookSettings,
model.BookSettings,
model.BookSettings,
String
> {
BookSettingsFamily._()
: super(
retry: null,
name: r'bookSettingsProvider',
dependencies: null,
$allTransitiveDependencies: null,
isAutoDispose: true,
);
BookSettingsProvider call(String bookId) =>
BookSettingsProvider._(argument: bookId, from: this);
@override
String get bookId => (origin as BookSettingsProvider).bookId;
String toString() => r'bookSettingsProvider';
}
abstract class _$BookSettings extends $Notifier<model.BookSettings> {
late final _$args = ref.$arg as String;
String get bookId => _$args;
model.BookSettings build(String bookId);
@$mustCallSuper
@override
void runBuild() {
final ref = this.ref as $Ref<model.BookSettings, model.BookSettings>;
final element =
ref.element
as $ClassProviderElement<
AnyNotifier<model.BookSettings, model.BookSettings>,
model.BookSettings,
Object?,
Object?
>;
element.handleCreate(ref, () => build(_$args));
}
}
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

View file

@ -6,21 +6,55 @@ part of 'playback_reporter_provider.dart';
// RiverpodGenerator
// **************************************************************************
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
@ProviderFor(PlaybackReporter)
final playbackReporterProvider = PlaybackReporterProvider._();
final class PlaybackReporterProvider
extends $AsyncNotifierProvider<PlaybackReporter, core.PlaybackReporter> {
PlaybackReporterProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'playbackReporterProvider',
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$playbackReporterHash();
@$internal
@override
PlaybackReporter create() => PlaybackReporter();
}
String _$playbackReporterHash() => r'f5436d652e51c37bcc684acdaec94e17a97e68e5';
/// See also [PlaybackReporter].
@ProviderFor(PlaybackReporter)
final playbackReporterProvider =
AsyncNotifierProvider<PlaybackReporter, core.PlaybackReporter>.internal(
PlaybackReporter.new,
name: r'playbackReporterProvider',
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
? null
: _$playbackReporterHash,
dependencies: null,
allTransitiveDependencies: null,
);
typedef _$PlaybackReporter = AsyncNotifier<core.PlaybackReporter>;
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
abstract class _$PlaybackReporter
extends $AsyncNotifier<core.PlaybackReporter> {
FutureOr<core.PlaybackReporter> build();
@$mustCallSuper
@override
void runBuild() {
final ref =
this.ref
as $Ref<AsyncValue<core.PlaybackReporter>, core.PlaybackReporter>;
final element =
ref.element
as $ClassProviderElement<
AnyNotifier<
AsyncValue<core.PlaybackReporter>,
core.PlaybackReporter
>,
AsyncValue<core.PlaybackReporter>,
Object?,
Object?
>;
element.handleCreate(ref, build);
}
}

View file

@ -6,20 +6,57 @@ part of 'playlist_provider.dart';
// RiverpodGenerator
// **************************************************************************
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
@ProviderFor(Playlist)
final playlistProvider = PlaylistProvider._();
final class PlaylistProvider
extends $NotifierProvider<Playlist, AudiobookPlaylist> {
PlaylistProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'playlistProvider',
isAutoDispose: true,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$playlistHash();
@$internal
@override
Playlist create() => Playlist();
/// {@macro riverpod.override_with_value}
Override overrideWithValue(AudiobookPlaylist value) {
return $ProviderOverride(
origin: this,
providerOverride: $SyncValueProvider<AudiobookPlaylist>(value),
);
}
}
String _$playlistHash() => r'bed4642e4c2de829e4d0630cb5bf92bffeeb1f60';
/// See also [Playlist].
@ProviderFor(Playlist)
final playlistProvider =
AutoDisposeNotifierProvider<Playlist, AudiobookPlaylist>.internal(
Playlist.new,
name: r'playlistProvider',
debugGetCreateSourceHash:
const bool.fromEnvironment('dart.vm.product') ? null : _$playlistHash,
dependencies: null,
allTransitiveDependencies: null,
);
typedef _$Playlist = AutoDisposeNotifier<AudiobookPlaylist>;
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
abstract class _$Playlist extends $Notifier<AudiobookPlaylist> {
AudiobookPlaylist build();
@$mustCallSuper
@override
void runBuild() {
final ref = this.ref as $Ref<AudiobookPlaylist, AudiobookPlaylist>;
final element =
ref.element
as $ClassProviderElement<
AnyNotifier<AudiobookPlaylist, AudiobookPlaylist>,
AudiobookPlaylist,
Object?,
Object?
>;
element.handleCreate(ref, build);
}
}

View file

@ -6,41 +6,119 @@ part of 'audiobook_player.dart';
// RiverpodGenerator
// **************************************************************************
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
/// Simple because it doesn't rebuild when the player state changes
/// it only rebuilds when the token changes
@ProviderFor(SimpleAudiobookPlayer)
final simpleAudiobookPlayerProvider = SimpleAudiobookPlayerProvider._();
/// Simple because it doesn't rebuild when the player state changes
/// it only rebuilds when the token changes
final class SimpleAudiobookPlayerProvider
extends $NotifierProvider<SimpleAudiobookPlayer, core.AudiobookPlayer> {
/// Simple because it doesn't rebuild when the player state changes
/// it only rebuilds when the token changes
SimpleAudiobookPlayerProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'simpleAudiobookPlayerProvider',
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$simpleAudiobookPlayerHash();
@$internal
@override
SimpleAudiobookPlayer create() => SimpleAudiobookPlayer();
/// {@macro riverpod.override_with_value}
Override overrideWithValue(core.AudiobookPlayer value) {
return $ProviderOverride(
origin: this,
providerOverride: $SyncValueProvider<core.AudiobookPlayer>(value),
);
}
}
String _$simpleAudiobookPlayerHash() =>
r'5e94bbff4314adceb5affa704fc4d079d4016afa';
/// Simple because it doesn't rebuild when the player state changes
/// it only rebuilds when the token changes
///
/// Copied from [SimpleAudiobookPlayer].
@ProviderFor(SimpleAudiobookPlayer)
final simpleAudiobookPlayerProvider =
NotifierProvider<SimpleAudiobookPlayer, core.AudiobookPlayer>.internal(
SimpleAudiobookPlayer.new,
name: r'simpleAudiobookPlayerProvider',
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
? null
: _$simpleAudiobookPlayerHash,
dependencies: null,
allTransitiveDependencies: null,
);
typedef _$SimpleAudiobookPlayer = Notifier<core.AudiobookPlayer>;
abstract class _$SimpleAudiobookPlayer extends $Notifier<core.AudiobookPlayer> {
core.AudiobookPlayer build();
@$mustCallSuper
@override
void runBuild() {
final ref = this.ref as $Ref<core.AudiobookPlayer, core.AudiobookPlayer>;
final element =
ref.element
as $ClassProviderElement<
AnyNotifier<core.AudiobookPlayer, core.AudiobookPlayer>,
core.AudiobookPlayer,
Object?,
Object?
>;
element.handleCreate(ref, build);
}
}
@ProviderFor(AudiobookPlayer)
final audiobookPlayerProvider = AudiobookPlayerProvider._();
final class AudiobookPlayerProvider
extends $NotifierProvider<AudiobookPlayer, core.AudiobookPlayer> {
AudiobookPlayerProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'audiobookPlayerProvider',
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$audiobookPlayerHash();
@$internal
@override
AudiobookPlayer create() => AudiobookPlayer();
/// {@macro riverpod.override_with_value}
Override overrideWithValue(core.AudiobookPlayer value) {
return $ProviderOverride(
origin: this,
providerOverride: $SyncValueProvider<core.AudiobookPlayer>(value),
);
}
}
String _$audiobookPlayerHash() => r'0f180308067486896fec6a65a6afb0e6686ac4a0';
/// See also [AudiobookPlayer].
@ProviderFor(AudiobookPlayer)
final audiobookPlayerProvider =
NotifierProvider<AudiobookPlayer, core.AudiobookPlayer>.internal(
AudiobookPlayer.new,
name: r'audiobookPlayerProvider',
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
? null
: _$audiobookPlayerHash,
dependencies: null,
allTransitiveDependencies: null,
);
typedef _$AudiobookPlayer = Notifier<core.AudiobookPlayer>;
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
abstract class _$AudiobookPlayer extends $Notifier<core.AudiobookPlayer> {
core.AudiobookPlayer build();
@$mustCallSuper
@override
void runBuild() {
final ref = this.ref as $Ref<core.AudiobookPlayer, core.AudiobookPlayer>;
final element =
ref.element
as $ClassProviderElement<
AnyNotifier<core.AudiobookPlayer, core.AudiobookPlayer>,
core.AudiobookPlayer,
Object?,
Object?
>;
element.handleCreate(ref, build);
}
}

View file

@ -6,66 +6,147 @@ part of 'currently_playing_provider.dart';
// RiverpodGenerator
// **************************************************************************
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
@ProviderFor(currentlyPlayingBook)
final currentlyPlayingBookProvider = CurrentlyPlayingBookProvider._();
final class CurrentlyPlayingBookProvider
extends $FunctionalProvider<BookExpanded?, BookExpanded?, BookExpanded?>
with $Provider<BookExpanded?> {
CurrentlyPlayingBookProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'currentlyPlayingBookProvider',
isAutoDispose: true,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$currentlyPlayingBookHash();
@$internal
@override
$ProviderElement<BookExpanded?> $createElement($ProviderPointer pointer) =>
$ProviderElement(pointer);
@override
BookExpanded? create(Ref ref) {
return currentlyPlayingBook(ref);
}
/// {@macro riverpod.override_with_value}
Override overrideWithValue(BookExpanded? value) {
return $ProviderOverride(
origin: this,
providerOverride: $SyncValueProvider<BookExpanded?>(value),
);
}
}
String _$currentlyPlayingBookHash() =>
r'e4258694c8f0d1e89651b330fae0f672ca13a484';
/// See also [currentlyPlayingBook].
@ProviderFor(currentlyPlayingBook)
final currentlyPlayingBookProvider =
AutoDisposeProvider<BookExpanded?>.internal(
currentlyPlayingBook,
name: r'currentlyPlayingBookProvider',
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
? null
: _$currentlyPlayingBookHash,
dependencies: null,
allTransitiveDependencies: null,
);
/// provided the current chapter of the book being played
@ProviderFor(currentPlayingChapter)
final currentPlayingChapterProvider = CurrentPlayingChapterProvider._();
/// provided the current chapter of the book being played
final class CurrentPlayingChapterProvider
extends $FunctionalProvider<BookChapter?, BookChapter?, BookChapter?>
with $Provider<BookChapter?> {
/// provided the current chapter of the book being played
CurrentPlayingChapterProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'currentPlayingChapterProvider',
isAutoDispose: true,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$currentPlayingChapterHash();
@$internal
@override
$ProviderElement<BookChapter?> $createElement($ProviderPointer pointer) =>
$ProviderElement(pointer);
@override
BookChapter? create(Ref ref) {
return currentPlayingChapter(ref);
}
/// {@macro riverpod.override_with_value}
Override overrideWithValue(BookChapter? value) {
return $ProviderOverride(
origin: this,
providerOverride: $SyncValueProvider<BookChapter?>(value),
);
}
}
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
typedef CurrentlyPlayingBookRef = AutoDisposeProviderRef<BookExpanded?>;
String _$currentPlayingChapterHash() =>
r'73db8b8a9058573bb0c68ec5d5f8aba9306f3d24';
/// provided the current chapter of the book being played
///
/// Copied from [currentPlayingChapter].
@ProviderFor(currentPlayingChapter)
final currentPlayingChapterProvider =
AutoDisposeProvider<BookChapter?>.internal(
currentPlayingChapter,
name: r'currentPlayingChapterProvider',
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
? null
: _$currentPlayingChapterHash,
dependencies: null,
allTransitiveDependencies: null,
);
/// provides the book metadata of the currently playing book
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
typedef CurrentPlayingChapterRef = AutoDisposeProviderRef<BookChapter?>;
String _$currentBookMetadataHash() =>
r'f537ef4ef19280bc952de658ecf6520c535ae344';
@ProviderFor(currentBookMetadata)
final currentBookMetadataProvider = CurrentBookMetadataProvider._();
/// provides the book metadata of the currently playing book
///
/// Copied from [currentBookMetadata].
@ProviderFor(currentBookMetadata)
final currentBookMetadataProvider =
AutoDisposeProvider<BookMetadataExpanded?>.internal(
currentBookMetadata,
name: r'currentBookMetadataProvider',
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
? null
: _$currentBookMetadataHash,
dependencies: null,
allTransitiveDependencies: null,
);
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
typedef CurrentBookMetadataRef = AutoDisposeProviderRef<BookMetadataExpanded?>;
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
final class CurrentBookMetadataProvider
extends
$FunctionalProvider<
BookMetadataExpanded?,
BookMetadataExpanded?,
BookMetadataExpanded?
>
with $Provider<BookMetadataExpanded?> {
/// provides the book metadata of the currently playing book
CurrentBookMetadataProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'currentBookMetadataProvider',
isAutoDispose: true,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$currentBookMetadataHash();
@$internal
@override
$ProviderElement<BookMetadataExpanded?> $createElement(
$ProviderPointer pointer,
) => $ProviderElement(pointer);
@override
BookMetadataExpanded? create(Ref ref) {
return currentBookMetadata(ref);
}
/// {@macro riverpod.override_with_value}
Override overrideWithValue(BookMetadataExpanded? value) {
return $ProviderOverride(
origin: this,
providerOverride: $SyncValueProvider<BookMetadataExpanded?>(value),
);
}
}
String _$currentBookMetadataHash() =>
r'f537ef4ef19280bc952de658ecf6520c535ae344';

View file

@ -49,7 +49,7 @@ Raw<ValueNotifier<double>> playerExpandProgressNotifier(
double playerHeight(
Ref ref,
) {
final playerExpandProgress = ref.watch(playerExpandProgressNotifierProvider);
final playerExpandProgress = ref.watch(playerExpandProgressProvider);
// on change of the playerExpandProgress invalidate
playerExpandProgress.addListener(() {

View file

@ -6,58 +6,134 @@ part of 'player_form.dart';
// RiverpodGenerator
// **************************************************************************
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
@ProviderFor(playerExpandProgressNotifier)
final playerExpandProgressProvider = PlayerExpandProgressNotifierProvider._();
final class PlayerExpandProgressNotifierProvider
extends
$FunctionalProvider<
Raw<ValueNotifier<double>>,
Raw<ValueNotifier<double>>,
Raw<ValueNotifier<double>>
>
with $Provider<Raw<ValueNotifier<double>>> {
PlayerExpandProgressNotifierProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'playerExpandProgressProvider',
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$playerExpandProgressNotifierHash();
@$internal
@override
$ProviderElement<Raw<ValueNotifier<double>>> $createElement(
$ProviderPointer pointer,
) => $ProviderElement(pointer);
@override
Raw<ValueNotifier<double>> create(Ref ref) {
return playerExpandProgressNotifier(ref);
}
/// {@macro riverpod.override_with_value}
Override overrideWithValue(Raw<ValueNotifier<double>> value) {
return $ProviderOverride(
origin: this,
providerOverride: $SyncValueProvider<Raw<ValueNotifier<double>>>(value),
);
}
}
String _$playerExpandProgressNotifierHash() =>
r'1ac7172d90a070f96222286edd1a176be197f378';
/// See also [playerExpandProgressNotifier].
@ProviderFor(playerExpandProgressNotifier)
final playerExpandProgressNotifierProvider =
Provider<Raw<ValueNotifier<double>>>.internal(
playerExpandProgressNotifier,
name: r'playerExpandProgressNotifierProvider',
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
? null
: _$playerExpandProgressNotifierHash,
dependencies: null,
allTransitiveDependencies: null,
);
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
typedef PlayerExpandProgressNotifierRef
= ProviderRef<Raw<ValueNotifier<double>>>;
String _$playerHeightHash() => r'3f031eaffdffbb2c6ddf7eb1aba31bf1619260fc';
/// See also [playerHeight].
@ProviderFor(playerHeight)
final playerHeightProvider = Provider<double>.internal(
playerHeight,
name: r'playerHeightProvider',
debugGetCreateSourceHash:
const bool.fromEnvironment('dart.vm.product') ? null : _$playerHeightHash,
dependencies: null,
allTransitiveDependencies: null,
);
final playerHeightProvider = PlayerHeightProvider._();
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
typedef PlayerHeightRef = ProviderRef<double>;
String _$isPlayerActiveHash() => r'2c7ca125423126fb5f0ef218d37bc8fe0ca9ec98';
final class PlayerHeightProvider
extends $FunctionalProvider<double, double, double>
with $Provider<double> {
PlayerHeightProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'playerHeightProvider',
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$playerHeightHash();
@$internal
@override
$ProviderElement<double> $createElement($ProviderPointer pointer) =>
$ProviderElement(pointer);
@override
double create(Ref ref) {
return playerHeight(ref);
}
/// {@macro riverpod.override_with_value}
Override overrideWithValue(double value) {
return $ProviderOverride(
origin: this,
providerOverride: $SyncValueProvider<double>(value),
);
}
}
String _$playerHeightHash() => r'41144a733b5ffd1c872a237ed7c9ea5f450dd0d4';
/// See also [isPlayerActive].
@ProviderFor(isPlayerActive)
final isPlayerActiveProvider = Provider<bool>.internal(
isPlayerActive,
name: r'isPlayerActiveProvider',
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
? null
: _$isPlayerActiveHash,
dependencies: null,
allTransitiveDependencies: null,
);
final isPlayerActiveProvider = IsPlayerActiveProvider._();
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
typedef IsPlayerActiveRef = ProviderRef<bool>;
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
final class IsPlayerActiveProvider extends $FunctionalProvider<bool, bool, bool>
with $Provider<bool> {
IsPlayerActiveProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'isPlayerActiveProvider',
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$isPlayerActiveHash();
@$internal
@override
$ProviderElement<bool> $createElement($ProviderPointer pointer) =>
$ProviderElement(pointer);
@override
bool create(Ref ref) {
return isPlayerActive(ref);
}
/// {@macro riverpod.override_with_value}
Override overrideWithValue(bool value) {
return $ProviderOverride(
origin: this,
providerOverride: $SyncValueProvider<bool>(value),
);
}
}
String _$isPlayerActiveHash() => r'2c7ca125423126fb5f0ef218d37bc8fe0ca9ec98';

View file

@ -34,14 +34,14 @@ class AudiobookPlayer extends HookConsumerWidget {
final itemBeingPlayed =
ref.watch(libraryItemProvider(currentBook.libraryItemId));
final player = ref.watch(audiobookPlayerProvider);
final imageOfItemBeingPlayed = itemBeingPlayed.valueOrNull != null
final imageOfItemBeingPlayed = itemBeingPlayed.value != null
? ref.watch(
coverImageProvider(itemBeingPlayed.valueOrNull!.id),
coverImageProvider(itemBeingPlayed.value!.id),
)
: null;
final imgWidget = imageOfItemBeingPlayed?.valueOrNull != null
final imgWidget = imageOfItemBeingPlayed?.value != null
? Image.memory(
imageOfItemBeingPlayed!.valueOrNull!,
imageOfItemBeingPlayed!.value!,
fit: BoxFit.cover,
)
: const BookCoverSkeleton();
@ -63,7 +63,7 @@ class AudiobookPlayer extends HookConsumerWidget {
// theme from image
final imageTheme = ref.watch(
themeOfLibraryItemProvider(
itemBeingPlayed.valueOrNull?.id,
itemBeingPlayed.value?.id,
brightness: Theme.of(context).brightness,
highContrast: appSettings.themeSettings.highContrast ||
MediaQuery.of(context).highContrast,
@ -81,10 +81,10 @@ class AudiobookPlayer extends HookConsumerWidget {
final preferredVolume = appSettings.playerSettings.preferredDefaultVolume;
return Theme(
data: ThemeData(
colorScheme: imageTheme.valueOrNull ?? Theme.of(context).colorScheme,
colorScheme: imageTheme.value ?? Theme.of(context).colorScheme,
),
child: Miniplayer(
valueNotifier: ref.watch(playerExpandProgressNotifierProvider),
valueNotifier: ref.watch(playerExpandProgressProvider),
onDragDown: (percentage) async {
// preferred volume
// set volume to 0 when dragging down

View file

@ -6,21 +6,57 @@ part of 'shake_detector.dart';
// RiverpodGenerator
// **************************************************************************
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
@ProviderFor(ShakeDetector)
final shakeDetectorProvider = ShakeDetectorProvider._();
final class ShakeDetectorProvider
extends $NotifierProvider<ShakeDetector, core.ShakeDetector?> {
ShakeDetectorProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'shakeDetectorProvider',
isAutoDispose: true,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$shakeDetectorHash();
@$internal
@override
ShakeDetector create() => ShakeDetector();
/// {@macro riverpod.override_with_value}
Override overrideWithValue(core.ShakeDetector? value) {
return $ProviderOverride(
origin: this,
providerOverride: $SyncValueProvider<core.ShakeDetector?>(value),
);
}
}
String _$shakeDetectorHash() => r'2a380bab1d4021d05d2ae40fec964a5f33d3730c';
/// See also [ShakeDetector].
@ProviderFor(ShakeDetector)
final shakeDetectorProvider =
AutoDisposeNotifierProvider<ShakeDetector, core.ShakeDetector?>.internal(
ShakeDetector.new,
name: r'shakeDetectorProvider',
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
? null
: _$shakeDetectorHash,
dependencies: null,
allTransitiveDependencies: null,
);
typedef _$ShakeDetector = AutoDisposeNotifier<core.ShakeDetector?>;
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
abstract class _$ShakeDetector extends $Notifier<core.ShakeDetector?> {
core.ShakeDetector? build();
@$mustCallSuper
@override
void runBuild() {
final ref = this.ref as $Ref<core.ShakeDetector?, core.ShakeDetector?>;
final element =
ref.element
as $ClassProviderElement<
AnyNotifier<core.ShakeDetector?, core.ShakeDetector?>,
core.ShakeDetector?,
Object?,
Object?
>;
element.handleCreate(ref, build);
}
}

View file

@ -6,20 +6,57 @@ part of 'sleep_timer_provider.dart';
// RiverpodGenerator
// **************************************************************************
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
@ProviderFor(SleepTimer)
final sleepTimerProvider = SleepTimerProvider._();
final class SleepTimerProvider
extends $NotifierProvider<SleepTimer, core.SleepTimer?> {
SleepTimerProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'sleepTimerProvider',
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$sleepTimerHash();
@$internal
@override
SleepTimer create() => SleepTimer();
/// {@macro riverpod.override_with_value}
Override overrideWithValue(core.SleepTimer? value) {
return $ProviderOverride(
origin: this,
providerOverride: $SyncValueProvider<core.SleepTimer?>(value),
);
}
}
String _$sleepTimerHash() => r'2679454a217d0630a833d730557ab4e4feac2e56';
/// See also [SleepTimer].
@ProviderFor(SleepTimer)
final sleepTimerProvider =
NotifierProvider<SleepTimer, core.SleepTimer?>.internal(
SleepTimer.new,
name: r'sleepTimerProvider',
debugGetCreateSourceHash:
const bool.fromEnvironment('dart.vm.product') ? null : _$sleepTimerHash,
dependencies: null,
allTransitiveDependencies: null,
);
typedef _$SleepTimer = Notifier<core.SleepTimer?>;
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
abstract class _$SleepTimer extends $Notifier<core.SleepTimer?> {
core.SleepTimer? build();
@$mustCallSuper
@override
void runBuild() {
final ref = this.ref as $Ref<core.SleepTimer?, core.SleepTimer?>;
final element =
ref.element
as $ClassProviderElement<
AnyNotifier<core.SleepTimer?, core.SleepTimer?>,
core.SleepTimer?,
Object?,
Object?
>;
element.handleCreate(ref, build);
}
}

View file

@ -76,9 +76,9 @@ class MyApp extends ConsumerWidget {
if (themeSettings.useMaterialThemeFromSystem) {
var themes =
ref.watch(systemThemeProvider(highContrast: shouldUseHighContrast));
if (themes.valueOrNull != null) {
lightColorScheme = themes.valueOrNull!.$1;
darkColorScheme = themes.valueOrNull!.$2;
if (themes.value != null) {
lightColorScheme = themes.value!.$1;
darkColorScheme = themes.value!.$2;
}
}
@ -100,9 +100,9 @@ class MyApp extends ConsumerWidget {
brightness: Brightness.dark,
),
);
if (themeLight.valueOrNull != null && themeDark.valueOrNull != null) {
lightColorScheme = themeLight.valueOrNull!;
darkColorScheme = themeDark.valueOrNull!;
if (themeLight.value != null && themeDark.value != null) {
lightColorScheme = themeLight.value!;
darkColorScheme = themeDark.value!;
}
}
} catch (e) {

View file

@ -11,7 +11,7 @@ part 'library_item_extras.freezed.dart';
/// [book] is the book that the item represents
/// [heroTagSuffix] is the suffix to use for the hero tag to avoid conflicts
@freezed
class LibraryItemExtras with _$LibraryItemExtras {
sealed class LibraryItemExtras with _$LibraryItemExtras {
const factory LibraryItemExtras({
BookMinified? book,
@Default('') String heroTagSuffix,

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,156 +9,260 @@ part of 'library_item_extras.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 _$LibraryItemExtras {
BookMinified? get book => throw _privateConstructorUsedError;
String get heroTagSuffix => throw _privateConstructorUsedError;
/// Create a copy of LibraryItemExtras
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$LibraryItemExtrasCopyWith<LibraryItemExtras> get copyWith =>
throw _privateConstructorUsedError;
BookMinified? get book; String get heroTagSuffix;
/// Create a copy of LibraryItemExtras
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$LibraryItemExtrasCopyWith<LibraryItemExtras> get copyWith => _$LibraryItemExtrasCopyWithImpl<LibraryItemExtras>(this as LibraryItemExtras, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is LibraryItemExtras&&(identical(other.book, book) || other.book == book)&&(identical(other.heroTagSuffix, heroTagSuffix) || other.heroTagSuffix == heroTagSuffix));
}
@override
int get hashCode => Object.hash(runtimeType,book,heroTagSuffix);
@override
String toString() {
return 'LibraryItemExtras(book: $book, heroTagSuffix: $heroTagSuffix)';
}
}
/// @nodoc
abstract class $LibraryItemExtrasCopyWith<$Res> {
factory $LibraryItemExtrasCopyWith(
LibraryItemExtras value, $Res Function(LibraryItemExtras) then) =
_$LibraryItemExtrasCopyWithImpl<$Res, LibraryItemExtras>;
@useResult
$Res call({BookMinified? book, String heroTagSuffix});
}
abstract mixin class $LibraryItemExtrasCopyWith<$Res> {
factory $LibraryItemExtrasCopyWith(LibraryItemExtras value, $Res Function(LibraryItemExtras) _then) = _$LibraryItemExtrasCopyWithImpl;
@useResult
$Res call({
BookMinified? book, String heroTagSuffix
});
}
/// @nodoc
class _$LibraryItemExtrasCopyWithImpl<$Res, $Val extends LibraryItemExtras>
class _$LibraryItemExtrasCopyWithImpl<$Res>
implements $LibraryItemExtrasCopyWith<$Res> {
_$LibraryItemExtrasCopyWithImpl(this._value, this._then);
_$LibraryItemExtrasCopyWithImpl(this._self, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
final LibraryItemExtras _self;
final $Res Function(LibraryItemExtras) _then;
/// Create a copy of LibraryItemExtras
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? book = freezed,
Object? heroTagSuffix = null,
}) {
return _then(_value.copyWith(
book: freezed == book
? _value.book
: book // ignore: cast_nullable_to_non_nullable
as BookMinified?,
heroTagSuffix: null == heroTagSuffix
? _value.heroTagSuffix
: heroTagSuffix // ignore: cast_nullable_to_non_nullable
as String,
) as $Val);
}
/// Create a copy of LibraryItemExtras
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? book = freezed,Object? heroTagSuffix = null,}) {
return _then(_self.copyWith(
book: freezed == book ? _self.book : book // ignore: cast_nullable_to_non_nullable
as BookMinified?,heroTagSuffix: null == heroTagSuffix ? _self.heroTagSuffix : heroTagSuffix // ignore: cast_nullable_to_non_nullable
as String,
));
}
/// @nodoc
abstract class _$$LibraryItemExtrasImplCopyWith<$Res>
implements $LibraryItemExtrasCopyWith<$Res> {
factory _$$LibraryItemExtrasImplCopyWith(_$LibraryItemExtrasImpl value,
$Res Function(_$LibraryItemExtrasImpl) then) =
__$$LibraryItemExtrasImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({BookMinified? book, String heroTagSuffix});
}
/// @nodoc
class __$$LibraryItemExtrasImplCopyWithImpl<$Res>
extends _$LibraryItemExtrasCopyWithImpl<$Res, _$LibraryItemExtrasImpl>
implements _$$LibraryItemExtrasImplCopyWith<$Res> {
__$$LibraryItemExtrasImplCopyWithImpl(_$LibraryItemExtrasImpl _value,
$Res Function(_$LibraryItemExtrasImpl) _then)
: super(_value, _then);
/// Create a copy of LibraryItemExtras
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? book = freezed,
Object? heroTagSuffix = null,
}) {
return _then(_$LibraryItemExtrasImpl(
book: freezed == book
? _value.book
: book // ignore: cast_nullable_to_non_nullable
as BookMinified?,
heroTagSuffix: null == heroTagSuffix
? _value.heroTagSuffix
: heroTagSuffix // ignore: cast_nullable_to_non_nullable
as String,
));
}
/// Adds pattern-matching-related methods to [LibraryItemExtras].
extension LibraryItemExtrasPatterns on LibraryItemExtras {
/// 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( _LibraryItemExtras value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _LibraryItemExtras() 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( _LibraryItemExtras value) $default,){
final _that = this;
switch (_that) {
case _LibraryItemExtras():
return $default(_that);}
}
/// 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( _LibraryItemExtras value)? $default,){
final _that = this;
switch (_that) {
case _LibraryItemExtras() 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( BookMinified? book, String heroTagSuffix)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _LibraryItemExtras() when $default != null:
return $default(_that.book,_that.heroTagSuffix);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( BookMinified? book, String heroTagSuffix) $default,) {final _that = this;
switch (_that) {
case _LibraryItemExtras():
return $default(_that.book,_that.heroTagSuffix);}
}
/// 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( BookMinified? book, String heroTagSuffix)? $default,) {final _that = this;
switch (_that) {
case _LibraryItemExtras() when $default != null:
return $default(_that.book,_that.heroTagSuffix);case _:
return null;
}
}
}
/// @nodoc
class _$LibraryItemExtrasImpl implements _LibraryItemExtras {
const _$LibraryItemExtrasImpl({this.book, this.heroTagSuffix = ''});
@override
final BookMinified? book;
@override
@JsonKey()
final String heroTagSuffix;
class _LibraryItemExtras implements LibraryItemExtras {
const _LibraryItemExtras({this.book, this.heroTagSuffix = ''});
@override
String toString() {
return 'LibraryItemExtras(book: $book, heroTagSuffix: $heroTagSuffix)';
}
@override final BookMinified? book;
@override@JsonKey() final String heroTagSuffix;
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$LibraryItemExtrasImpl &&
(identical(other.book, book) || other.book == book) &&
(identical(other.heroTagSuffix, heroTagSuffix) ||
other.heroTagSuffix == heroTagSuffix));
}
/// Create a copy of LibraryItemExtras
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$LibraryItemExtrasCopyWith<_LibraryItemExtras> get copyWith => __$LibraryItemExtrasCopyWithImpl<_LibraryItemExtras>(this, _$identity);
@override
int get hashCode => Object.hash(runtimeType, book, heroTagSuffix);
/// Create a copy of LibraryItemExtras
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$LibraryItemExtrasImplCopyWith<_$LibraryItemExtrasImpl> get copyWith =>
__$$LibraryItemExtrasImplCopyWithImpl<_$LibraryItemExtrasImpl>(
this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LibraryItemExtras&&(identical(other.book, book) || other.book == book)&&(identical(other.heroTagSuffix, heroTagSuffix) || other.heroTagSuffix == heroTagSuffix));
}
abstract class _LibraryItemExtras implements LibraryItemExtras {
const factory _LibraryItemExtras(
{final BookMinified? book,
final String heroTagSuffix}) = _$LibraryItemExtrasImpl;
@override
BookMinified? get book;
@override
String get heroTagSuffix;
@override
int get hashCode => Object.hash(runtimeType,book,heroTagSuffix);
/// Create a copy of LibraryItemExtras
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$LibraryItemExtrasImplCopyWith<_$LibraryItemExtrasImpl> get copyWith =>
throw _privateConstructorUsedError;
@override
String toString() {
return 'LibraryItemExtras(book: $book, heroTagSuffix: $heroTagSuffix)';
}
}
/// @nodoc
abstract mixin class _$LibraryItemExtrasCopyWith<$Res> implements $LibraryItemExtrasCopyWith<$Res> {
factory _$LibraryItemExtrasCopyWith(_LibraryItemExtras value, $Res Function(_LibraryItemExtras) _then) = __$LibraryItemExtrasCopyWithImpl;
@override @useResult
$Res call({
BookMinified? book, String heroTagSuffix
});
}
/// @nodoc
class __$LibraryItemExtrasCopyWithImpl<$Res>
implements _$LibraryItemExtrasCopyWith<$Res> {
__$LibraryItemExtrasCopyWithImpl(this._self, this._then);
final _LibraryItemExtras _self;
final $Res Function(_LibraryItemExtras) _then;
/// Create a copy of LibraryItemExtras
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? book = freezed,Object? heroTagSuffix = null,}) {
return _then(_LibraryItemExtras(
book: freezed == book ? _self.book : book // ignore: cast_nullable_to_non_nullable
as BookMinified?,heroTagSuffix: null == heroTagSuffix ? _self.heroTagSuffix : heroTagSuffix // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
// dart format on

View file

@ -23,10 +23,8 @@ const bottomBarHeight = 64;
/// BottomNavigationBar, where [child] is placed in the body of the Scaffold.
class ScaffoldWithNavBar extends HookConsumerWidget {
/// Constructs an [ScaffoldWithNavBar].
const ScaffoldWithNavBar({
required this.navigationShell,
Key? key,
}) : super(key: key ?? const ValueKey<String>('ScaffoldWithNavBar'));
const ScaffoldWithNavBar({required this.navigationShell, Key? key})
: super(key: key ?? const ValueKey<String>('ScaffoldWithNavBar'));
/// The navigation shell and container for the branch Navigators.
final StatefulNavigationShell navigationShell;
@ -35,10 +33,11 @@ class ScaffoldWithNavBar extends HookConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
// playerExpandProgress is used to animate bottom navigation bar to opacity 0 and slide down when player is expanded
// final playerProgress =
// useValueListenable(ref.watch(playerExpandProgressNotifierProvider));
// useValueListenable(ref.watch(playerExpandProgressProvider));
final playerProgress = ref.watch(playerHeightProvider);
final playerMaxHeight = MediaQuery.of(context).size.height;
var percentExpandedMiniPlayer = (playerProgress - playerMinHeight) /
var percentExpandedMiniPlayer =
(playerProgress - playerMinHeight) /
(playerMaxHeight - playerMinHeight);
// Clamp the value between 0 and 1
percentExpandedMiniPlayer = percentExpandedMiniPlayer.clamp(0.0, 1.0);
@ -52,9 +51,7 @@ class ScaffoldWithNavBar extends HookConsumerWidget {
// close miniplayer if it is open
if (isPlayerExpanded && pendingPlayerModals == 0) {
appLogger.fine(
'BackButtonListener: closing the player',
);
appLogger.fine('BackButtonListener: closing the player');
audioBookMiniplayerController.animateToHeight(state: PanelState.MIN);
return true;
}
@ -96,12 +93,7 @@ class ScaffoldWithNavBar extends HookConsumerWidget {
return BackButtonListener(
onBackButtonPressed: onBackButtonPressed,
child: Scaffold(
body: Stack(
children: [
navigationShell,
const AudiobookPlayer(),
],
),
body: Stack(children: [navigationShell, const AudiobookPlayer()]),
bottomNavigationBar: Opacity(
// Opacity is interpolated from 1 to 0 when player is expanded
opacity: 1 - percentExpandedMiniPlayer,
@ -116,11 +108,8 @@ class ScaffoldWithNavBar extends HookConsumerWidget {
// `navigationShell.route.branches`.
destinations: _navigationItems.map((item) {
final isDestinationLibrary = item.name == 'Library';
var currentLibrary =
ref.watch(currentLibraryProvider).valueOrNull;
final libraryIcon = AbsIcons.getIconByName(
currentLibrary?.icon,
);
var currentLibrary = ref.watch(currentLibraryProvider).value;
final libraryIcon = AbsIcons.getIconByName(currentLibrary?.icon);
final destinationWidget = NavigationDestination(
icon: Icon(
isDestinationLibrary ? libraryIcon ?? item.icon : item.icon,

View file

@ -17,7 +17,7 @@ class ApiSettings extends _$ApiSettings {
@override
model.ApiSettings build() {
state = readFromBoxOrCreate();
ref.listenSelf((_, __) {
listenSelf((_, __) {
writeToBox();
});

View file

@ -6,20 +6,57 @@ part of 'api_settings_provider.dart';
// RiverpodGenerator
// **************************************************************************
String _$apiSettingsHash() => r'5bc1e16e9d72b77fb10637aabadf08e8947da580';
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
/// See also [ApiSettings].
@ProviderFor(ApiSettings)
final apiSettingsProvider =
NotifierProvider<ApiSettings, model.ApiSettings>.internal(
ApiSettings.new,
name: r'apiSettingsProvider',
debugGetCreateSourceHash:
const bool.fromEnvironment('dart.vm.product') ? null : _$apiSettingsHash,
dependencies: null,
allTransitiveDependencies: null,
);
final apiSettingsProvider = ApiSettingsProvider._();
typedef _$ApiSettings = Notifier<model.ApiSettings>;
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
final class ApiSettingsProvider
extends $NotifierProvider<ApiSettings, model.ApiSettings> {
ApiSettingsProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'apiSettingsProvider',
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$apiSettingsHash();
@$internal
@override
ApiSettings create() => ApiSettings();
/// {@macro riverpod.override_with_value}
Override overrideWithValue(model.ApiSettings value) {
return $ProviderOverride(
origin: this,
providerOverride: $SyncValueProvider<model.ApiSettings>(value),
);
}
}
String _$apiSettingsHash() => r'02af850985338eade33d76fc9965808bed548290';
abstract class _$ApiSettings extends $Notifier<model.ApiSettings> {
model.ApiSettings build();
@$mustCallSuper
@override
void runBuild() {
final ref = this.ref as $Ref<model.ApiSettings, model.ApiSettings>;
final element =
ref.element
as $ClassProviderElement<
AnyNotifier<model.ApiSettings, model.ApiSettings>,
model.ApiSettings,
Object?,
Object?
>;
element.handleCreate(ref, build);
}
}

View file

@ -34,7 +34,7 @@ class AppSettings extends _$AppSettings {
@override
model.AppSettings build() {
state = loadOrCreateAppSettings();
ref.listenSelf((_, __) {
listenSelf((_, __) {
writeToBox();
});
return state;

View file

@ -6,37 +6,112 @@ part of 'app_settings_provider.dart';
// RiverpodGenerator
// **************************************************************************
String _$appSettingsHash() => r'314d7936f54550f57d308056a99230402342a6d0';
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
/// See also [AppSettings].
@ProviderFor(AppSettings)
final appSettingsProvider =
NotifierProvider<AppSettings, model.AppSettings>.internal(
AppSettings.new,
name: r'appSettingsProvider',
debugGetCreateSourceHash:
const bool.fromEnvironment('dart.vm.product') ? null : _$appSettingsHash,
dependencies: null,
allTransitiveDependencies: null,
);
final appSettingsProvider = AppSettingsProvider._();
final class AppSettingsProvider
extends $NotifierProvider<AppSettings, model.AppSettings> {
AppSettingsProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'appSettingsProvider',
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$appSettingsHash();
@$internal
@override
AppSettings create() => AppSettings();
/// {@macro riverpod.override_with_value}
Override overrideWithValue(model.AppSettings value) {
return $ProviderOverride(
origin: this,
providerOverride: $SyncValueProvider<model.AppSettings>(value),
);
}
}
String _$appSettingsHash() => r'744d7e0157eb3b089c4187b35b845fc78547a44e';
abstract class _$AppSettings extends $Notifier<model.AppSettings> {
model.AppSettings build();
@$mustCallSuper
@override
void runBuild() {
final ref = this.ref as $Ref<model.AppSettings, model.AppSettings>;
final element =
ref.element
as $ClassProviderElement<
AnyNotifier<model.AppSettings, model.AppSettings>,
model.AppSettings,
Object?,
Object?
>;
element.handleCreate(ref, build);
}
}
@ProviderFor(SleepTimerSettings)
final sleepTimerSettingsProvider = SleepTimerSettingsProvider._();
final class SleepTimerSettingsProvider
extends $NotifierProvider<SleepTimerSettings, model.SleepTimerSettings> {
SleepTimerSettingsProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'sleepTimerSettingsProvider',
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$sleepTimerSettingsHash();
@$internal
@override
SleepTimerSettings create() => SleepTimerSettings();
/// {@macro riverpod.override_with_value}
Override overrideWithValue(model.SleepTimerSettings value) {
return $ProviderOverride(
origin: this,
providerOverride: $SyncValueProvider<model.SleepTimerSettings>(value),
);
}
}
typedef _$AppSettings = Notifier<model.AppSettings>;
String _$sleepTimerSettingsHash() =>
r'85bb3d3fb292b9a3a5b771d86e5fc57718519c69';
/// See also [SleepTimerSettings].
@ProviderFor(SleepTimerSettings)
final sleepTimerSettingsProvider =
NotifierProvider<SleepTimerSettings, model.SleepTimerSettings>.internal(
SleepTimerSettings.new,
name: r'sleepTimerSettingsProvider',
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
? null
: _$sleepTimerSettingsHash,
dependencies: null,
allTransitiveDependencies: null,
);
typedef _$SleepTimerSettings = Notifier<model.SleepTimerSettings>;
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
abstract class _$SleepTimerSettings
extends $Notifier<model.SleepTimerSettings> {
model.SleepTimerSettings build();
@$mustCallSuper
@override
void runBuild() {
final ref =
this.ref as $Ref<model.SleepTimerSettings, model.SleepTimerSettings>;
final element =
ref.element
as $ClassProviderElement<
AnyNotifier<model.SleepTimerSettings, model.SleepTimerSettings>,
model.SleepTimerSettings,
Object?,
Object?
>;
element.handleCreate(ref, build);
}
}

View file

@ -6,72 +6,138 @@ part of 'metadata_provider.dart';
// RiverpodGenerator
// **************************************************************************
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
@ProviderFor(deviceName)
final deviceNameProvider = DeviceNameProvider._();
final class DeviceNameProvider
extends $FunctionalProvider<AsyncValue<String>, String, FutureOr<String>>
with $FutureModifier<String>, $FutureProvider<String> {
DeviceNameProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'deviceNameProvider',
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$deviceNameHash();
@$internal
@override
$FutureProviderElement<String> $createElement($ProviderPointer pointer) =>
$FutureProviderElement(pointer);
@override
FutureOr<String> create(Ref ref) {
return deviceName(ref);
}
}
String _$deviceNameHash() => r'9e38adda74e70a91851a682f05228bd759356dcc';
/// See also [deviceName].
@ProviderFor(deviceName)
final deviceNameProvider = FutureProvider<String>.internal(
deviceName,
name: r'deviceNameProvider',
debugGetCreateSourceHash:
const bool.fromEnvironment('dart.vm.product') ? null : _$deviceNameHash,
dependencies: null,
allTransitiveDependencies: null,
);
@ProviderFor(deviceModel)
final deviceModelProvider = DeviceModelProvider._();
final class DeviceModelProvider
extends $FunctionalProvider<AsyncValue<String>, String, FutureOr<String>>
with $FutureModifier<String>, $FutureProvider<String> {
DeviceModelProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'deviceModelProvider',
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$deviceModelHash();
@$internal
@override
$FutureProviderElement<String> $createElement($ProviderPointer pointer) =>
$FutureProviderElement(pointer);
@override
FutureOr<String> create(Ref ref) {
return deviceModel(ref);
}
}
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
typedef DeviceNameRef = FutureProviderRef<String>;
String _$deviceModelHash() => r'922b13d9e35b5b5c5b8e96f2f2c2ae594f4f41f2';
/// See also [deviceModel].
@ProviderFor(deviceModel)
final deviceModelProvider = FutureProvider<String>.internal(
deviceModel,
name: r'deviceModelProvider',
debugGetCreateSourceHash:
const bool.fromEnvironment('dart.vm.product') ? null : _$deviceModelHash,
dependencies: null,
allTransitiveDependencies: null,
);
@ProviderFor(deviceSdkVersion)
final deviceSdkVersionProvider = DeviceSdkVersionProvider._();
final class DeviceSdkVersionProvider
extends $FunctionalProvider<AsyncValue<String>, String, FutureOr<String>>
with $FutureModifier<String>, $FutureProvider<String> {
DeviceSdkVersionProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'deviceSdkVersionProvider',
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$deviceSdkVersionHash();
@$internal
@override
$FutureProviderElement<String> $createElement($ProviderPointer pointer) =>
$FutureProviderElement(pointer);
@override
FutureOr<String> create(Ref ref) {
return deviceSdkVersion(ref);
}
}
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
typedef DeviceModelRef = FutureProviderRef<String>;
String _$deviceSdkVersionHash() => r'33178d80590808d1f4cca2be8a3b52c6f6724cac';
/// See also [deviceSdkVersion].
@ProviderFor(deviceSdkVersion)
final deviceSdkVersionProvider = FutureProvider<String>.internal(
deviceSdkVersion,
name: r'deviceSdkVersionProvider',
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
? null
: _$deviceSdkVersionHash,
dependencies: null,
allTransitiveDependencies: null,
);
@ProviderFor(deviceManufacturer)
final deviceManufacturerProvider = DeviceManufacturerProvider._();
final class DeviceManufacturerProvider
extends $FunctionalProvider<AsyncValue<String>, String, FutureOr<String>>
with $FutureModifier<String>, $FutureProvider<String> {
DeviceManufacturerProvider._()
: super(
from: null,
argument: null,
retry: null,
name: r'deviceManufacturerProvider',
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$deviceManufacturerHash();
@$internal
@override
$FutureProviderElement<String> $createElement($ProviderPointer pointer) =>
$FutureProviderElement(pointer);
@override
FutureOr<String> create(Ref ref) {
return deviceManufacturer(ref);
}
}
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
typedef DeviceSdkVersionRef = FutureProviderRef<String>;
String _$deviceManufacturerHash() =>
r'39250767deb8635fa7c7e18bae23576b9b863e04';
/// See also [deviceManufacturer].
@ProviderFor(deviceManufacturer)
final deviceManufacturerProvider = FutureProvider<String>.internal(
deviceManufacturer,
name: r'deviceManufacturerProvider',
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
? null
: _$deviceManufacturerHash,
dependencies: null,
allTransitiveDependencies: null,
);
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
typedef DeviceManufacturerRef = FutureProviderRef<String>;
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

View file

@ -11,7 +11,7 @@ part 'api_settings.g.dart';
///
/// all settings that are needed to interact with the server are stored here
@freezed
class ApiSettings with _$ApiSettings {
sealed class ApiSettings with _$ApiSettings {
const factory ApiSettings({
AudiobookShelfServer? activeServer,
AuthenticatedUser? activeUser,

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,238 +9,317 @@ part of 'api_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');
ApiSettings _$ApiSettingsFromJson(Map<String, dynamic> json) {
return _ApiSettings.fromJson(json);
}
/// @nodoc
mixin _$ApiSettings {
AudiobookShelfServer? get activeServer => throw _privateConstructorUsedError;
AuthenticatedUser? get activeUser => throw _privateConstructorUsedError;
String? get activeLibraryId => throw _privateConstructorUsedError;
AudiobookShelfServer? get activeServer; AuthenticatedUser? get activeUser; String? get activeLibraryId;
/// Create a copy of ApiSettings
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$ApiSettingsCopyWith<ApiSettings> get copyWith => _$ApiSettingsCopyWithImpl<ApiSettings>(this as ApiSettings, _$identity);
/// Serializes this ApiSettings to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is ApiSettings&&(identical(other.activeServer, activeServer) || other.activeServer == activeServer)&&(identical(other.activeUser, activeUser) || other.activeUser == activeUser)&&(identical(other.activeLibraryId, activeLibraryId) || other.activeLibraryId == activeLibraryId));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,activeServer,activeUser,activeLibraryId);
@override
String toString() {
return 'ApiSettings(activeServer: $activeServer, activeUser: $activeUser, activeLibraryId: $activeLibraryId)';
}
/// Create a copy of ApiSettings
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ApiSettingsCopyWith<ApiSettings> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ApiSettingsCopyWith<$Res> {
factory $ApiSettingsCopyWith(
ApiSettings value, $Res Function(ApiSettings) then) =
_$ApiSettingsCopyWithImpl<$Res, ApiSettings>;
@useResult
$Res call(
{AudiobookShelfServer? activeServer,
AuthenticatedUser? activeUser,
String? activeLibraryId});
abstract mixin class $ApiSettingsCopyWith<$Res> {
factory $ApiSettingsCopyWith(ApiSettings value, $Res Function(ApiSettings) _then) = _$ApiSettingsCopyWithImpl;
@useResult
$Res call({
AudiobookShelfServer? activeServer, AuthenticatedUser? activeUser, String? activeLibraryId
});
$AudiobookShelfServerCopyWith<$Res>? get activeServer;$AuthenticatedUserCopyWith<$Res>? get activeUser;
$AudiobookShelfServerCopyWith<$Res>? get activeServer;
$AuthenticatedUserCopyWith<$Res>? get activeUser;
}
/// @nodoc
class _$ApiSettingsCopyWithImpl<$Res, $Val extends ApiSettings>
class _$ApiSettingsCopyWithImpl<$Res>
implements $ApiSettingsCopyWith<$Res> {
_$ApiSettingsCopyWithImpl(this._value, this._then);
_$ApiSettingsCopyWithImpl(this._self, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
final ApiSettings _self;
final $Res Function(ApiSettings) _then;
/// Create a copy of ApiSettings
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? activeServer = freezed,
Object? activeUser = freezed,
Object? activeLibraryId = freezed,
}) {
return _then(_value.copyWith(
activeServer: freezed == activeServer
? _value.activeServer
: activeServer // ignore: cast_nullable_to_non_nullable
as AudiobookShelfServer?,
activeUser: freezed == activeUser
? _value.activeUser
: activeUser // ignore: cast_nullable_to_non_nullable
as AuthenticatedUser?,
activeLibraryId: freezed == activeLibraryId
? _value.activeLibraryId
: activeLibraryId // ignore: cast_nullable_to_non_nullable
as String?,
) as $Val);
/// Create a copy of ApiSettings
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? activeServer = freezed,Object? activeUser = freezed,Object? activeLibraryId = freezed,}) {
return _then(_self.copyWith(
activeServer: freezed == activeServer ? _self.activeServer : activeServer // ignore: cast_nullable_to_non_nullable
as AudiobookShelfServer?,activeUser: freezed == activeUser ? _self.activeUser : activeUser // ignore: cast_nullable_to_non_nullable
as AuthenticatedUser?,activeLibraryId: freezed == activeLibraryId ? _self.activeLibraryId : activeLibraryId // ignore: cast_nullable_to_non_nullable
as String?,
));
}
/// Create a copy of ApiSettings
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$AudiobookShelfServerCopyWith<$Res>? get activeServer {
if (_self.activeServer == null) {
return null;
}
/// Create a copy of ApiSettings
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$AudiobookShelfServerCopyWith<$Res>? get activeServer {
if (_value.activeServer == null) {
return null;
}
return $AudiobookShelfServerCopyWith<$Res>(_value.activeServer!, (value) {
return _then(_value.copyWith(activeServer: value) as $Val);
});
return $AudiobookShelfServerCopyWith<$Res>(_self.activeServer!, (value) {
return _then(_self.copyWith(activeServer: value));
});
}/// Create a copy of ApiSettings
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$AuthenticatedUserCopyWith<$Res>? get activeUser {
if (_self.activeUser == null) {
return null;
}
/// Create a copy of ApiSettings
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$AuthenticatedUserCopyWith<$Res>? get activeUser {
if (_value.activeUser == null) {
return null;
}
return $AuthenticatedUserCopyWith<$Res>(_value.activeUser!, (value) {
return _then(_value.copyWith(activeUser: value) as $Val);
});
}
return $AuthenticatedUserCopyWith<$Res>(_self.activeUser!, (value) {
return _then(_self.copyWith(activeUser: value));
});
}
}
/// @nodoc
abstract class _$$ApiSettingsImplCopyWith<$Res>
implements $ApiSettingsCopyWith<$Res> {
factory _$$ApiSettingsImplCopyWith(
_$ApiSettingsImpl value, $Res Function(_$ApiSettingsImpl) then) =
__$$ApiSettingsImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{AudiobookShelfServer? activeServer,
AuthenticatedUser? activeUser,
String? activeLibraryId});
@override
$AudiobookShelfServerCopyWith<$Res>? get activeServer;
@override
$AuthenticatedUserCopyWith<$Res>? get activeUser;
/// Adds pattern-matching-related methods to [ApiSettings].
extension ApiSettingsPatterns on ApiSettings {
/// 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( _ApiSettings value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _ApiSettings() 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( _ApiSettings value) $default,){
final _that = this;
switch (_that) {
case _ApiSettings():
return $default(_that);}
}
/// 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( _ApiSettings value)? $default,){
final _that = this;
switch (_that) {
case _ApiSettings() 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( AudiobookShelfServer? activeServer, AuthenticatedUser? activeUser, String? activeLibraryId)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _ApiSettings() when $default != null:
return $default(_that.activeServer,_that.activeUser,_that.activeLibraryId);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( AudiobookShelfServer? activeServer, AuthenticatedUser? activeUser, String? activeLibraryId) $default,) {final _that = this;
switch (_that) {
case _ApiSettings():
return $default(_that.activeServer,_that.activeUser,_that.activeLibraryId);}
}
/// 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( AudiobookShelfServer? activeServer, AuthenticatedUser? activeUser, String? activeLibraryId)? $default,) {final _that = this;
switch (_that) {
case _ApiSettings() when $default != null:
return $default(_that.activeServer,_that.activeUser,_that.activeLibraryId);case _:
return null;
}
}
/// @nodoc
class __$$ApiSettingsImplCopyWithImpl<$Res>
extends _$ApiSettingsCopyWithImpl<$Res, _$ApiSettingsImpl>
implements _$$ApiSettingsImplCopyWith<$Res> {
__$$ApiSettingsImplCopyWithImpl(
_$ApiSettingsImpl _value, $Res Function(_$ApiSettingsImpl) _then)
: super(_value, _then);
/// Create a copy of ApiSettings
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? activeServer = freezed,
Object? activeUser = freezed,
Object? activeLibraryId = freezed,
}) {
return _then(_$ApiSettingsImpl(
activeServer: freezed == activeServer
? _value.activeServer
: activeServer // ignore: cast_nullable_to_non_nullable
as AudiobookShelfServer?,
activeUser: freezed == activeUser
? _value.activeUser
: activeUser // ignore: cast_nullable_to_non_nullable
as AuthenticatedUser?,
activeLibraryId: freezed == activeLibraryId
? _value.activeLibraryId
: activeLibraryId // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
@JsonSerializable()
class _$ApiSettingsImpl implements _ApiSettings {
const _$ApiSettingsImpl(
{this.activeServer, this.activeUser, this.activeLibraryId});
factory _$ApiSettingsImpl.fromJson(Map<String, dynamic> json) =>
_$$ApiSettingsImplFromJson(json);
class _ApiSettings implements ApiSettings {
const _ApiSettings({this.activeServer, this.activeUser, this.activeLibraryId});
factory _ApiSettings.fromJson(Map<String, dynamic> json) => _$ApiSettingsFromJson(json);
@override
final AudiobookShelfServer? activeServer;
@override
final AuthenticatedUser? activeUser;
@override
final String? activeLibraryId;
@override final AudiobookShelfServer? activeServer;
@override final AuthenticatedUser? activeUser;
@override final String? activeLibraryId;
@override
String toString() {
return 'ApiSettings(activeServer: $activeServer, activeUser: $activeUser, activeLibraryId: $activeLibraryId)';
}
/// Create a copy of ApiSettings
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$ApiSettingsCopyWith<_ApiSettings> get copyWith => __$ApiSettingsCopyWithImpl<_ApiSettings>(this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ApiSettingsImpl &&
(identical(other.activeServer, activeServer) ||
other.activeServer == activeServer) &&
(identical(other.activeUser, activeUser) ||
other.activeUser == activeUser) &&
(identical(other.activeLibraryId, activeLibraryId) ||
other.activeLibraryId == activeLibraryId));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode =>
Object.hash(runtimeType, activeServer, activeUser, activeLibraryId);
/// Create a copy of ApiSettings
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ApiSettingsImplCopyWith<_$ApiSettingsImpl> get copyWith =>
__$$ApiSettingsImplCopyWithImpl<_$ApiSettingsImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$ApiSettingsImplToJson(
this,
);
}
@override
Map<String, dynamic> toJson() {
return _$ApiSettingsToJson(this, );
}
abstract class _ApiSettings implements ApiSettings {
const factory _ApiSettings(
{final AudiobookShelfServer? activeServer,
final AuthenticatedUser? activeUser,
final String? activeLibraryId}) = _$ApiSettingsImpl;
factory _ApiSettings.fromJson(Map<String, dynamic> json) =
_$ApiSettingsImpl.fromJson;
@override
AudiobookShelfServer? get activeServer;
@override
AuthenticatedUser? get activeUser;
@override
String? get activeLibraryId;
/// Create a copy of ApiSettings
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ApiSettingsImplCopyWith<_$ApiSettingsImpl> get copyWith =>
throw _privateConstructorUsedError;
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ApiSettings&&(identical(other.activeServer, activeServer) || other.activeServer == activeServer)&&(identical(other.activeUser, activeUser) || other.activeUser == activeUser)&&(identical(other.activeLibraryId, activeLibraryId) || other.activeLibraryId == activeLibraryId));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,activeServer,activeUser,activeLibraryId);
@override
String toString() {
return 'ApiSettings(activeServer: $activeServer, activeUser: $activeUser, activeLibraryId: $activeLibraryId)';
}
}
/// @nodoc
abstract mixin class _$ApiSettingsCopyWith<$Res> implements $ApiSettingsCopyWith<$Res> {
factory _$ApiSettingsCopyWith(_ApiSettings value, $Res Function(_ApiSettings) _then) = __$ApiSettingsCopyWithImpl;
@override @useResult
$Res call({
AudiobookShelfServer? activeServer, AuthenticatedUser? activeUser, String? activeLibraryId
});
@override $AudiobookShelfServerCopyWith<$Res>? get activeServer;@override $AuthenticatedUserCopyWith<$Res>? get activeUser;
}
/// @nodoc
class __$ApiSettingsCopyWithImpl<$Res>
implements _$ApiSettingsCopyWith<$Res> {
__$ApiSettingsCopyWithImpl(this._self, this._then);
final _ApiSettings _self;
final $Res Function(_ApiSettings) _then;
/// Create a copy of ApiSettings
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? activeServer = freezed,Object? activeUser = freezed,Object? activeLibraryId = freezed,}) {
return _then(_ApiSettings(
activeServer: freezed == activeServer ? _self.activeServer : activeServer // ignore: cast_nullable_to_non_nullable
as AudiobookShelfServer?,activeUser: freezed == activeUser ? _self.activeUser : activeUser // ignore: cast_nullable_to_non_nullable
as AuthenticatedUser?,activeLibraryId: freezed == activeLibraryId ? _self.activeLibraryId : activeLibraryId // ignore: cast_nullable_to_non_nullable
as String?,
));
}
/// Create a copy of ApiSettings
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$AudiobookShelfServerCopyWith<$Res>? get activeServer {
if (_self.activeServer == null) {
return null;
}
return $AudiobookShelfServerCopyWith<$Res>(_self.activeServer!, (value) {
return _then(_self.copyWith(activeServer: value));
});
}/// Create a copy of ApiSettings
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$AuthenticatedUserCopyWith<$Res>? get activeUser {
if (_self.activeUser == null) {
return null;
}
return $AuthenticatedUserCopyWith<$Res>(_self.activeUser!, (value) {
return _then(_self.copyWith(activeUser: value));
});
}
}
// dart format on

View file

@ -6,20 +6,19 @@ part of 'api_settings.dart';
// JsonSerializableGenerator
// **************************************************************************
_$ApiSettingsImpl _$$ApiSettingsImplFromJson(Map<String, dynamic> json) =>
_$ApiSettingsImpl(
activeServer: json['activeServer'] == null
? null
: AudiobookShelfServer.fromJson(
json['activeServer'] as Map<String, dynamic>),
activeUser: json['activeUser'] == null
? null
: AuthenticatedUser.fromJson(
json['activeUser'] as Map<String, dynamic>),
activeLibraryId: json['activeLibraryId'] as String?,
);
_ApiSettings _$ApiSettingsFromJson(Map<String, dynamic> json) => _ApiSettings(
activeServer: json['activeServer'] == null
? null
: AudiobookShelfServer.fromJson(
json['activeServer'] as Map<String, dynamic>,
),
activeUser: json['activeUser'] == null
? null
: AuthenticatedUser.fromJson(json['activeUser'] as Map<String, dynamic>),
activeLibraryId: json['activeLibraryId'] as String?,
);
Map<String, dynamic> _$$ApiSettingsImplToJson(_$ApiSettingsImpl instance) =>
Map<String, dynamic> _$ApiSettingsToJson(_ApiSettings instance) =>
<String, dynamic>{
'activeServer': instance.activeServer,
'activeUser': instance.activeUser,

View file

@ -10,7 +10,7 @@ part 'app_settings.g.dart';
///
/// only the visual settings are stored here
@freezed
class AppSettings with _$AppSettings {
sealed class AppSettings with _$AppSettings {
const factory AppSettings({
@Default(ThemeSettings()) ThemeSettings themeSettings,
@Default(PlayerSettings()) PlayerSettings playerSettings,
@ -27,7 +27,7 @@ class AppSettings with _$AppSettings {
}
@freezed
class ThemeSettings with _$ThemeSettings {
sealed class ThemeSettings with _$ThemeSettings {
const factory ThemeSettings({
@Default(ThemeMode.system) ThemeMode themeMode,
@Default(false) bool highContrast,
@ -42,7 +42,7 @@ class ThemeSettings with _$ThemeSettings {
}
@freezed
class PlayerSettings with _$PlayerSettings {
sealed class PlayerSettings with _$PlayerSettings {
const factory PlayerSettings({
@Default(MinimizedPlayerSettings())
MinimizedPlayerSettings miniPlayerSettings,
@ -65,7 +65,7 @@ class PlayerSettings with _$PlayerSettings {
}
@freezed
class ExpandedPlayerSettings with _$ExpandedPlayerSettings {
sealed class ExpandedPlayerSettings with _$ExpandedPlayerSettings {
const factory ExpandedPlayerSettings({
@Default(false) bool showTotalProgress,
@Default(true) bool showChapterProgress,
@ -76,28 +76,25 @@ class ExpandedPlayerSettings with _$ExpandedPlayerSettings {
}
@freezed
class MinimizedPlayerSettings with _$MinimizedPlayerSettings {
const factory MinimizedPlayerSettings({
@Default(false) bool useChapterInfo,
}) = _MinimizedPlayerSettings;
sealed class MinimizedPlayerSettings with _$MinimizedPlayerSettings {
const factory MinimizedPlayerSettings({@Default(false) bool useChapterInfo}) =
_MinimizedPlayerSettings;
factory MinimizedPlayerSettings.fromJson(Map<String, dynamic> json) =>
_$MinimizedPlayerSettingsFromJson(json);
}
@freezed
class SleepTimerSettings with _$SleepTimerSettings {
sealed class SleepTimerSettings with _$SleepTimerSettings {
const factory SleepTimerSettings({
@Default(Duration(minutes: 15)) Duration defaultDuration,
@Default(
[
Duration(minutes: 5),
Duration(minutes: 10),
Duration(minutes: 15),
Duration(minutes: 20),
Duration(minutes: 30),
],
)
@Default([
Duration(minutes: 5),
Duration(minutes: 10),
Duration(minutes: 15),
Duration(minutes: 20),
Duration(minutes: 30),
])
List<Duration> presetDurations,
@Default(Duration(minutes: 100)) Duration maxDuration,
@Default(false) bool fadeOutAudio,
@ -134,7 +131,7 @@ class SleepTimerSettings with _$SleepTimerSettings {
}
@freezed
class DownloadSettings with _$DownloadSettings {
sealed class DownloadSettings with _$DownloadSettings {
const factory DownloadSettings({
@Default(true) bool requiresWiFi,
@Default(3) int retries,
@ -149,21 +146,19 @@ class DownloadSettings with _$DownloadSettings {
}
@freezed
class NotificationSettings with _$NotificationSettings {
sealed class NotificationSettings with _$NotificationSettings {
const factory NotificationSettings({
@Default(Duration(seconds: 30)) Duration fastForwardInterval,
@Default(Duration(seconds: 10)) Duration rewindInterval,
@Default(true) bool progressBarIsChapterProgress,
@Default('\$bookTitle') String primaryTitle,
@Default('\$author') String secondaryTitle,
@Default(
[
NotificationMediaControl.rewind,
NotificationMediaControl.fastForward,
NotificationMediaControl.skipToPreviousChapter,
NotificationMediaControl.skipToNextChapter,
],
)
@Default([
NotificationMediaControl.rewind,
NotificationMediaControl.fastForward,
NotificationMediaControl.skipToPreviousChapter,
NotificationMediaControl.skipToNextChapter,
])
List<NotificationMediaControl> mediaControls,
}) = _NotificationSettings;
@ -196,7 +191,7 @@ enum NotificationMediaControl {
/// Shake Detection Settings
@freezed
class ShakeDetectionSettings with _$ShakeDetectionSettings {
sealed class ShakeDetectionSettings with _$ShakeDetectionSettings {
const factory ShakeDetectionSettings({
@Default(true) bool isEnabled,
@Default(ShakeDirection.horizontal) ShakeDirection direction,
@ -222,18 +217,12 @@ class ShakeDetectionSettings with _$ShakeDetectionSettings {
enum ShakeDirection { horizontal, vertical }
enum ShakeAction {
none,
playPause,
resetSleepTimer,
fastForward,
rewind,
}
enum ShakeAction { none, playPause, resetSleepTimer, fastForward, rewind }
enum ShakeDetectedFeedback { vibrate, beep }
@freezed
class HomePageSettings with _$HomePageSettings {
sealed class HomePageSettings with _$HomePageSettings {
const factory HomePageSettings({
@Default(true) bool showPlayButtonOnContinueListeningShelf,
@Default(false) bool showPlayButtonOnContinueSeriesShelf,

File diff suppressed because it is too large Load diff

View file

@ -6,39 +6,41 @@ part of 'app_settings.dart';
// JsonSerializableGenerator
// **************************************************************************
_$AppSettingsImpl _$$AppSettingsImplFromJson(Map<String, dynamic> json) =>
_$AppSettingsImpl(
themeSettings: json['themeSettings'] == null
? const ThemeSettings()
: ThemeSettings.fromJson(
json['themeSettings'] as Map<String, dynamic>),
playerSettings: json['playerSettings'] == null
? const PlayerSettings()
: PlayerSettings.fromJson(
json['playerSettings'] as Map<String, dynamic>),
sleepTimerSettings: json['sleepTimerSettings'] == null
? const SleepTimerSettings()
: SleepTimerSettings.fromJson(
json['sleepTimerSettings'] as Map<String, dynamic>),
downloadSettings: json['downloadSettings'] == null
? const DownloadSettings()
: DownloadSettings.fromJson(
json['downloadSettings'] as Map<String, dynamic>),
notificationSettings: json['notificationSettings'] == null
? const NotificationSettings()
: NotificationSettings.fromJson(
json['notificationSettings'] as Map<String, dynamic>),
shakeDetectionSettings: json['shakeDetectionSettings'] == null
? const ShakeDetectionSettings()
: ShakeDetectionSettings.fromJson(
json['shakeDetectionSettings'] as Map<String, dynamic>),
homePageSettings: json['homePageSettings'] == null
? const HomePageSettings()
: HomePageSettings.fromJson(
json['homePageSettings'] as Map<String, dynamic>),
);
_AppSettings _$AppSettingsFromJson(Map<String, dynamic> json) => _AppSettings(
themeSettings: json['themeSettings'] == null
? const ThemeSettings()
: ThemeSettings.fromJson(json['themeSettings'] as Map<String, dynamic>),
playerSettings: json['playerSettings'] == null
? const PlayerSettings()
: PlayerSettings.fromJson(json['playerSettings'] as Map<String, dynamic>),
sleepTimerSettings: json['sleepTimerSettings'] == null
? const SleepTimerSettings()
: SleepTimerSettings.fromJson(
json['sleepTimerSettings'] as Map<String, dynamic>,
),
downloadSettings: json['downloadSettings'] == null
? const DownloadSettings()
: DownloadSettings.fromJson(
json['downloadSettings'] as Map<String, dynamic>,
),
notificationSettings: json['notificationSettings'] == null
? const NotificationSettings()
: NotificationSettings.fromJson(
json['notificationSettings'] as Map<String, dynamic>,
),
shakeDetectionSettings: json['shakeDetectionSettings'] == null
? const ShakeDetectionSettings()
: ShakeDetectionSettings.fromJson(
json['shakeDetectionSettings'] as Map<String, dynamic>,
),
homePageSettings: json['homePageSettings'] == null
? const HomePageSettings()
: HomePageSettings.fromJson(
json['homePageSettings'] as Map<String, dynamic>,
),
);
Map<String, dynamic> _$$AppSettingsImplToJson(_$AppSettingsImpl instance) =>
Map<String, dynamic> _$AppSettingsToJson(_AppSettings instance) =>
<String, dynamic>{
'themeSettings': instance.themeSettings,
'playerSettings': instance.playerSettings,
@ -49,9 +51,10 @@ Map<String, dynamic> _$$AppSettingsImplToJson(_$AppSettingsImpl instance) =>
'homePageSettings': instance.homePageSettings,
};
_$ThemeSettingsImpl _$$ThemeSettingsImplFromJson(Map<String, dynamic> json) =>
_$ThemeSettingsImpl(
themeMode: $enumDecodeNullable(_$ThemeModeEnumMap, json['themeMode']) ??
_ThemeSettings _$ThemeSettingsFromJson(Map<String, dynamic> json) =>
_ThemeSettings(
themeMode:
$enumDecodeNullable(_$ThemeModeEnumMap, json['themeMode']) ??
ThemeMode.system,
highContrast: json['highContrast'] as bool? ?? false,
useMaterialThemeFromSystem:
@ -63,7 +66,7 @@ _$ThemeSettingsImpl _$$ThemeSettingsImplFromJson(Map<String, dynamic> json) =>
json['useCurrentPlayerThemeThroughoutApp'] as bool? ?? true,
);
Map<String, dynamic> _$$ThemeSettingsImplToJson(_$ThemeSettingsImpl instance) =>
Map<String, dynamic> _$ThemeSettingsToJson(_ThemeSettings instance) =>
<String, dynamic>{
'themeMode': _$ThemeModeEnumMap[instance.themeMode]!,
'highContrast': instance.highContrast,
@ -80,96 +83,97 @@ const _$ThemeModeEnumMap = {
ThemeMode.dark: 'dark',
};
_$PlayerSettingsImpl _$$PlayerSettingsImplFromJson(Map<String, dynamic> json) =>
_$PlayerSettingsImpl(
miniPlayerSettings: json['miniPlayerSettings'] == null
? const MinimizedPlayerSettings()
: MinimizedPlayerSettings.fromJson(
json['miniPlayerSettings'] as Map<String, dynamic>),
expandedPlayerSettings: json['expandedPlayerSettings'] == null
? const ExpandedPlayerSettings()
: ExpandedPlayerSettings.fromJson(
json['expandedPlayerSettings'] as Map<String, dynamic>),
preferredDefaultVolume:
(json['preferredDefaultVolume'] as num?)?.toDouble() ?? 1,
preferredDefaultSpeed:
(json['preferredDefaultSpeed'] as num?)?.toDouble() ?? 1,
speedOptions: (json['speedOptions'] as List<dynamic>?)
?.map((e) => (e as num).toDouble())
.toList() ??
const [1, 1.25, 1.5, 1.75, 2],
speedIncrement: (json['speedIncrement'] as num?)?.toDouble() ?? 0.05,
minSpeed: (json['minSpeed'] as num?)?.toDouble() ?? 0.1,
maxSpeed: (json['maxSpeed'] as num?)?.toDouble() ?? 4,
minimumPositionForReporting: json['minimumPositionForReporting'] == null
? const Duration(seconds: 10)
: Duration(
microseconds:
(json['minimumPositionForReporting'] as num).toInt()),
playbackReportInterval: json['playbackReportInterval'] == null
? const Duration(seconds: 10)
: Duration(
microseconds: (json['playbackReportInterval'] as num).toInt()),
markCompleteWhenTimeLeft: json['markCompleteWhenTimeLeft'] == null
? const Duration(seconds: 15)
: Duration(
microseconds: (json['markCompleteWhenTimeLeft'] as num).toInt()),
configurePlayerForEveryBook:
json['configurePlayerForEveryBook'] as bool? ?? true,
);
_PlayerSettings _$PlayerSettingsFromJson(
Map<String, dynamic> json,
) => _PlayerSettings(
miniPlayerSettings: json['miniPlayerSettings'] == null
? const MinimizedPlayerSettings()
: MinimizedPlayerSettings.fromJson(
json['miniPlayerSettings'] as Map<String, dynamic>,
),
expandedPlayerSettings: json['expandedPlayerSettings'] == null
? const ExpandedPlayerSettings()
: ExpandedPlayerSettings.fromJson(
json['expandedPlayerSettings'] as Map<String, dynamic>,
),
preferredDefaultVolume:
(json['preferredDefaultVolume'] as num?)?.toDouble() ?? 1,
preferredDefaultSpeed:
(json['preferredDefaultSpeed'] as num?)?.toDouble() ?? 1,
speedOptions:
(json['speedOptions'] as List<dynamic>?)
?.map((e) => (e as num).toDouble())
.toList() ??
const [1, 1.25, 1.5, 1.75, 2],
speedIncrement: (json['speedIncrement'] as num?)?.toDouble() ?? 0.05,
minSpeed: (json['minSpeed'] as num?)?.toDouble() ?? 0.1,
maxSpeed: (json['maxSpeed'] as num?)?.toDouble() ?? 4,
minimumPositionForReporting: json['minimumPositionForReporting'] == null
? const Duration(seconds: 10)
: Duration(
microseconds: (json['minimumPositionForReporting'] as num).toInt(),
),
playbackReportInterval: json['playbackReportInterval'] == null
? const Duration(seconds: 10)
: Duration(microseconds: (json['playbackReportInterval'] as num).toInt()),
markCompleteWhenTimeLeft: json['markCompleteWhenTimeLeft'] == null
? const Duration(seconds: 15)
: Duration(
microseconds: (json['markCompleteWhenTimeLeft'] as num).toInt(),
),
configurePlayerForEveryBook:
json['configurePlayerForEveryBook'] as bool? ?? true,
);
Map<String, dynamic> _$$PlayerSettingsImplToJson(
_$PlayerSettingsImpl instance) =>
<String, dynamic>{
'miniPlayerSettings': instance.miniPlayerSettings,
'expandedPlayerSettings': instance.expandedPlayerSettings,
'preferredDefaultVolume': instance.preferredDefaultVolume,
'preferredDefaultSpeed': instance.preferredDefaultSpeed,
'speedOptions': instance.speedOptions,
'speedIncrement': instance.speedIncrement,
'minSpeed': instance.minSpeed,
'maxSpeed': instance.maxSpeed,
'minimumPositionForReporting':
instance.minimumPositionForReporting.inMicroseconds,
'playbackReportInterval': instance.playbackReportInterval.inMicroseconds,
'markCompleteWhenTimeLeft':
instance.markCompleteWhenTimeLeft.inMicroseconds,
'configurePlayerForEveryBook': instance.configurePlayerForEveryBook,
};
Map<String, dynamic> _$PlayerSettingsToJson(
_PlayerSettings instance,
) => <String, dynamic>{
'miniPlayerSettings': instance.miniPlayerSettings,
'expandedPlayerSettings': instance.expandedPlayerSettings,
'preferredDefaultVolume': instance.preferredDefaultVolume,
'preferredDefaultSpeed': instance.preferredDefaultSpeed,
'speedOptions': instance.speedOptions,
'speedIncrement': instance.speedIncrement,
'minSpeed': instance.minSpeed,
'maxSpeed': instance.maxSpeed,
'minimumPositionForReporting':
instance.minimumPositionForReporting.inMicroseconds,
'playbackReportInterval': instance.playbackReportInterval.inMicroseconds,
'markCompleteWhenTimeLeft': instance.markCompleteWhenTimeLeft.inMicroseconds,
'configurePlayerForEveryBook': instance.configurePlayerForEveryBook,
};
_$ExpandedPlayerSettingsImpl _$$ExpandedPlayerSettingsImplFromJson(
Map<String, dynamic> json) =>
_$ExpandedPlayerSettingsImpl(
showTotalProgress: json['showTotalProgress'] as bool? ?? false,
showChapterProgress: json['showChapterProgress'] as bool? ?? true,
);
_ExpandedPlayerSettings _$ExpandedPlayerSettingsFromJson(
Map<String, dynamic> json,
) => _ExpandedPlayerSettings(
showTotalProgress: json['showTotalProgress'] as bool? ?? false,
showChapterProgress: json['showChapterProgress'] as bool? ?? true,
);
Map<String, dynamic> _$$ExpandedPlayerSettingsImplToJson(
_$ExpandedPlayerSettingsImpl instance) =>
<String, dynamic>{
'showTotalProgress': instance.showTotalProgress,
'showChapterProgress': instance.showChapterProgress,
};
Map<String, dynamic> _$ExpandedPlayerSettingsToJson(
_ExpandedPlayerSettings instance,
) => <String, dynamic>{
'showTotalProgress': instance.showTotalProgress,
'showChapterProgress': instance.showChapterProgress,
};
_$MinimizedPlayerSettingsImpl _$$MinimizedPlayerSettingsImplFromJson(
Map<String, dynamic> json) =>
_$MinimizedPlayerSettingsImpl(
useChapterInfo: json['useChapterInfo'] as bool? ?? false,
);
_MinimizedPlayerSettings _$MinimizedPlayerSettingsFromJson(
Map<String, dynamic> json,
) => _MinimizedPlayerSettings(
useChapterInfo: json['useChapterInfo'] as bool? ?? false,
);
Map<String, dynamic> _$$MinimizedPlayerSettingsImplToJson(
_$MinimizedPlayerSettingsImpl instance) =>
<String, dynamic>{
'useChapterInfo': instance.useChapterInfo,
};
Map<String, dynamic> _$MinimizedPlayerSettingsToJson(
_MinimizedPlayerSettings instance,
) => <String, dynamic>{'useChapterInfo': instance.useChapterInfo};
_$SleepTimerSettingsImpl _$$SleepTimerSettingsImplFromJson(
Map<String, dynamic> json) =>
_$SleepTimerSettingsImpl(
_SleepTimerSettings _$SleepTimerSettingsFromJson(Map<String, dynamic> json) =>
_SleepTimerSettings(
defaultDuration: json['defaultDuration'] == null
? const Duration(minutes: 15)
: Duration(microseconds: (json['defaultDuration'] as num).toInt()),
presetDurations: (json['presetDurations'] as List<dynamic>?)
presetDurations:
(json['presetDurations'] as List<dynamic>?)
?.map((e) => Duration(microseconds: (e as num).toInt()))
.toList() ??
const [
@ -177,7 +181,7 @@ _$SleepTimerSettingsImpl _$$SleepTimerSettingsImplFromJson(
Duration(minutes: 10),
Duration(minutes: 15),
Duration(minutes: 20),
Duration(minutes: 30)
Duration(minutes: 30),
],
maxDuration: json['maxDuration'] == null
? const Duration(minutes: 100)
@ -189,16 +193,18 @@ _$SleepTimerSettingsImpl _$$SleepTimerSettingsImplFromJson(
autoRewindWhenStopped: json['autoRewindWhenStopped'] as bool? ?? false,
autoRewindDurations:
(json['autoRewindDurations'] as Map<String, dynamic>?)?.map(
(k, e) => MapEntry(
int.parse(k), Duration(microseconds: (e as num).toInt())),
) ??
const {
5: Duration(seconds: 10),
15: Duration(seconds: 30),
45: Duration(seconds: 45),
60: Duration(minutes: 1),
120: Duration(minutes: 2)
},
(k, e) => MapEntry(
int.parse(k),
Duration(microseconds: (e as num).toInt()),
),
) ??
const {
5: Duration(seconds: 10),
15: Duration(seconds: 30),
45: Duration(seconds: 45),
60: Duration(minutes: 1),
120: Duration(minutes: 2),
},
autoTurnOnTimer: json['autoTurnOnTimer'] as bool? ?? false,
alwaysAutoTurnOnTimer: json['alwaysAutoTurnOnTimer'] as bool? ?? false,
autoTurnOnTime: json['autoTurnOnTime'] == null
@ -209,27 +215,27 @@ _$SleepTimerSettingsImpl _$$SleepTimerSettingsImplFromJson(
: Duration(microseconds: (json['autoTurnOffTime'] as num).toInt()),
);
Map<String, dynamic> _$$SleepTimerSettingsImplToJson(
_$SleepTimerSettingsImpl instance) =>
Map<String, dynamic> _$SleepTimerSettingsToJson(_SleepTimerSettings instance) =>
<String, dynamic>{
'defaultDuration': instance.defaultDuration.inMicroseconds,
'presetDurations':
instance.presetDurations.map((e) => e.inMicroseconds).toList(),
'presetDurations': instance.presetDurations
.map((e) => e.inMicroseconds)
.toList(),
'maxDuration': instance.maxDuration.inMicroseconds,
'fadeOutAudio': instance.fadeOutAudio,
'fadeOutDuration': instance.fadeOutDuration.inMicroseconds,
'autoRewindWhenStopped': instance.autoRewindWhenStopped,
'autoRewindDurations': instance.autoRewindDurations
.map((k, e) => MapEntry(k.toString(), e.inMicroseconds)),
'autoRewindDurations': instance.autoRewindDurations.map(
(k, e) => MapEntry(k.toString(), e.inMicroseconds),
),
'autoTurnOnTimer': instance.autoTurnOnTimer,
'alwaysAutoTurnOnTimer': instance.alwaysAutoTurnOnTimer,
'autoTurnOnTime': instance.autoTurnOnTime.inMicroseconds,
'autoTurnOffTime': instance.autoTurnOffTime.inMicroseconds,
};
_$DownloadSettingsImpl _$$DownloadSettingsImplFromJson(
Map<String, dynamic> json) =>
_$DownloadSettingsImpl(
_DownloadSettings _$DownloadSettingsFromJson(Map<String, dynamic> json) =>
_DownloadSettings(
requiresWiFi: json['requiresWiFi'] as bool? ?? true,
retries: (json['retries'] as num?)?.toInt() ?? 3,
allowPause: json['allowPause'] as bool? ?? true,
@ -239,8 +245,7 @@ _$DownloadSettingsImpl _$$DownloadSettingsImplFromJson(
(json['maxConcurrentByGroup'] as num?)?.toInt() ?? 3,
);
Map<String, dynamic> _$$DownloadSettingsImplToJson(
_$DownloadSettingsImpl instance) =>
Map<String, dynamic> _$DownloadSettingsToJson(_DownloadSettings instance) =>
<String, dynamic>{
'requiresWiFi': instance.requiresWiFi,
'retries': instance.retries,
@ -250,43 +255,43 @@ Map<String, dynamic> _$$DownloadSettingsImplToJson(
'maxConcurrentByGroup': instance.maxConcurrentByGroup,
};
_$NotificationSettingsImpl _$$NotificationSettingsImplFromJson(
Map<String, dynamic> json) =>
_$NotificationSettingsImpl(
fastForwardInterval: json['fastForwardInterval'] == null
? const Duration(seconds: 30)
: Duration(
microseconds: (json['fastForwardInterval'] as num).toInt()),
rewindInterval: json['rewindInterval'] == null
? const Duration(seconds: 10)
: Duration(microseconds: (json['rewindInterval'] as num).toInt()),
progressBarIsChapterProgress:
json['progressBarIsChapterProgress'] as bool? ?? true,
primaryTitle: json['primaryTitle'] as String? ?? '\$bookTitle',
secondaryTitle: json['secondaryTitle'] as String? ?? '\$author',
mediaControls: (json['mediaControls'] as List<dynamic>?)
?.map((e) => $enumDecode(_$NotificationMediaControlEnumMap, e))
.toList() ??
const [
NotificationMediaControl.rewind,
NotificationMediaControl.fastForward,
NotificationMediaControl.skipToPreviousChapter,
NotificationMediaControl.skipToNextChapter
],
);
_NotificationSettings _$NotificationSettingsFromJson(
Map<String, dynamic> json,
) => _NotificationSettings(
fastForwardInterval: json['fastForwardInterval'] == null
? const Duration(seconds: 30)
: Duration(microseconds: (json['fastForwardInterval'] as num).toInt()),
rewindInterval: json['rewindInterval'] == null
? const Duration(seconds: 10)
: Duration(microseconds: (json['rewindInterval'] as num).toInt()),
progressBarIsChapterProgress:
json['progressBarIsChapterProgress'] as bool? ?? true,
primaryTitle: json['primaryTitle'] as String? ?? '\$bookTitle',
secondaryTitle: json['secondaryTitle'] as String? ?? '\$author',
mediaControls:
(json['mediaControls'] as List<dynamic>?)
?.map((e) => $enumDecode(_$NotificationMediaControlEnumMap, e))
.toList() ??
const [
NotificationMediaControl.rewind,
NotificationMediaControl.fastForward,
NotificationMediaControl.skipToPreviousChapter,
NotificationMediaControl.skipToNextChapter,
],
);
Map<String, dynamic> _$$NotificationSettingsImplToJson(
_$NotificationSettingsImpl instance) =>
<String, dynamic>{
'fastForwardInterval': instance.fastForwardInterval.inMicroseconds,
'rewindInterval': instance.rewindInterval.inMicroseconds,
'progressBarIsChapterProgress': instance.progressBarIsChapterProgress,
'primaryTitle': instance.primaryTitle,
'secondaryTitle': instance.secondaryTitle,
'mediaControls': instance.mediaControls
.map((e) => _$NotificationMediaControlEnumMap[e]!)
.toList(),
};
Map<String, dynamic> _$NotificationSettingsToJson(
_NotificationSettings instance,
) => <String, dynamic>{
'fastForwardInterval': instance.fastForwardInterval.inMicroseconds,
'rewindInterval': instance.rewindInterval.inMicroseconds,
'progressBarIsChapterProgress': instance.progressBarIsChapterProgress,
'primaryTitle': instance.primaryTitle,
'secondaryTitle': instance.secondaryTitle,
'mediaControls': instance.mediaControls
.map((e) => _$NotificationMediaControlEnumMap[e]!)
.toList(),
};
const _$NotificationMediaControlEnumMap = {
NotificationMediaControl.fastForward: 'fastForward',
@ -297,47 +302,47 @@ const _$NotificationMediaControlEnumMap = {
NotificationMediaControl.skipToPreviousChapter: 'skipToPreviousChapter',
};
_$ShakeDetectionSettingsImpl _$$ShakeDetectionSettingsImplFromJson(
Map<String, dynamic> json) =>
_$ShakeDetectionSettingsImpl(
isEnabled: json['isEnabled'] as bool? ?? true,
direction:
$enumDecodeNullable(_$ShakeDirectionEnumMap, json['direction']) ??
ShakeDirection.horizontal,
threshold: (json['threshold'] as num?)?.toDouble() ?? 5,
shakeAction:
$enumDecodeNullable(_$ShakeActionEnumMap, json['shakeAction']) ??
ShakeAction.resetSleepTimer,
feedback: (json['feedback'] as List<dynamic>?)
?.map((e) => $enumDecode(_$ShakeDetectedFeedbackEnumMap, e))
.toSet() ??
const {ShakeDetectedFeedback.vibrate},
beepVolume: (json['beepVolume'] as num?)?.toDouble() ?? 0.5,
shakeTriggerCoolDown: json['shakeTriggerCoolDown'] == null
? const Duration(seconds: 2)
: Duration(
microseconds: (json['shakeTriggerCoolDown'] as num).toInt()),
shakeTriggerCount: (json['shakeTriggerCount'] as num?)?.toInt() ?? 2,
samplingPeriod: json['samplingPeriod'] == null
? const Duration(milliseconds: 100)
: Duration(microseconds: (json['samplingPeriod'] as num).toInt()),
);
_ShakeDetectionSettings _$ShakeDetectionSettingsFromJson(
Map<String, dynamic> json,
) => _ShakeDetectionSettings(
isEnabled: json['isEnabled'] as bool? ?? true,
direction:
$enumDecodeNullable(_$ShakeDirectionEnumMap, json['direction']) ??
ShakeDirection.horizontal,
threshold: (json['threshold'] as num?)?.toDouble() ?? 5,
shakeAction:
$enumDecodeNullable(_$ShakeActionEnumMap, json['shakeAction']) ??
ShakeAction.resetSleepTimer,
feedback:
(json['feedback'] as List<dynamic>?)
?.map((e) => $enumDecode(_$ShakeDetectedFeedbackEnumMap, e))
.toSet() ??
const {ShakeDetectedFeedback.vibrate},
beepVolume: (json['beepVolume'] as num?)?.toDouble() ?? 0.5,
shakeTriggerCoolDown: json['shakeTriggerCoolDown'] == null
? const Duration(seconds: 2)
: Duration(microseconds: (json['shakeTriggerCoolDown'] as num).toInt()),
shakeTriggerCount: (json['shakeTriggerCount'] as num?)?.toInt() ?? 2,
samplingPeriod: json['samplingPeriod'] == null
? const Duration(milliseconds: 100)
: Duration(microseconds: (json['samplingPeriod'] as num).toInt()),
);
Map<String, dynamic> _$$ShakeDetectionSettingsImplToJson(
_$ShakeDetectionSettingsImpl instance) =>
<String, dynamic>{
'isEnabled': instance.isEnabled,
'direction': _$ShakeDirectionEnumMap[instance.direction]!,
'threshold': instance.threshold,
'shakeAction': _$ShakeActionEnumMap[instance.shakeAction]!,
'feedback': instance.feedback
.map((e) => _$ShakeDetectedFeedbackEnumMap[e]!)
.toList(),
'beepVolume': instance.beepVolume,
'shakeTriggerCoolDown': instance.shakeTriggerCoolDown.inMicroseconds,
'shakeTriggerCount': instance.shakeTriggerCount,
'samplingPeriod': instance.samplingPeriod.inMicroseconds,
};
Map<String, dynamic> _$ShakeDetectionSettingsToJson(
_ShakeDetectionSettings instance,
) => <String, dynamic>{
'isEnabled': instance.isEnabled,
'direction': _$ShakeDirectionEnumMap[instance.direction]!,
'threshold': instance.threshold,
'shakeAction': _$ShakeActionEnumMap[instance.shakeAction]!,
'feedback': instance.feedback
.map((e) => _$ShakeDetectedFeedbackEnumMap[e]!)
.toList(),
'beepVolume': instance.beepVolume,
'shakeTriggerCoolDown': instance.shakeTriggerCoolDown.inMicroseconds,
'shakeTriggerCount': instance.shakeTriggerCount,
'samplingPeriod': instance.samplingPeriod.inMicroseconds,
};
const _$ShakeDirectionEnumMap = {
ShakeDirection.horizontal: 'horizontal',
@ -357,9 +362,8 @@ const _$ShakeDetectedFeedbackEnumMap = {
ShakeDetectedFeedback.beep: 'beep',
};
_$HomePageSettingsImpl _$$HomePageSettingsImplFromJson(
Map<String, dynamic> json) =>
_$HomePageSettingsImpl(
_HomePageSettings _$HomePageSettingsFromJson(Map<String, dynamic> json) =>
_HomePageSettings(
showPlayButtonOnContinueListeningShelf:
json['showPlayButtonOnContinueListeningShelf'] as bool? ?? true,
showPlayButtonOnContinueSeriesShelf:
@ -370,15 +374,14 @@ _$HomePageSettingsImpl _$$HomePageSettingsImplFromJson(
json['showPlayButtonOnListenAgainShelf'] as bool? ?? false,
);
Map<String, dynamic> _$$HomePageSettingsImplToJson(
_$HomePageSettingsImpl instance) =>
<String, dynamic>{
'showPlayButtonOnContinueListeningShelf':
instance.showPlayButtonOnContinueListeningShelf,
'showPlayButtonOnContinueSeriesShelf':
instance.showPlayButtonOnContinueSeriesShelf,
'showPlayButtonOnAllRemainingShelves':
instance.showPlayButtonOnAllRemainingShelves,
'showPlayButtonOnListenAgainShelf':
instance.showPlayButtonOnListenAgainShelf,
};
Map<String, dynamic> _$HomePageSettingsToJson(
_HomePageSettings instance,
) => <String, dynamic>{
'showPlayButtonOnContinueListeningShelf':
instance.showPlayButtonOnContinueListeningShelf,
'showPlayButtonOnContinueSeriesShelf':
instance.showPlayButtonOnContinueSeriesShelf,
'showPlayButtonOnAllRemainingShelves':
instance.showPlayButtonOnAllRemainingShelves,
'showPlayButtonOnListenAgainShelf': instance.showPlayButtonOnListenAgainShelf,
};

View file

@ -7,7 +7,7 @@ typedef AudiobookShelfUri = Uri;
/// Represents a audiobookshelf server
@freezed
class AudiobookShelfServer with _$AudiobookShelfServer {
sealed class AudiobookShelfServer with _$AudiobookShelfServer {
const factory AudiobookShelfServer({
required AudiobookShelfUri serverUrl,
// String? serverName,

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,161 +9,263 @@ part of 'audiobookshelf_server.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');
AudiobookShelfServer _$AudiobookShelfServerFromJson(Map<String, dynamic> json) {
return _AudiobookShelfServer.fromJson(json);
}
/// @nodoc
mixin _$AudiobookShelfServer {
Uri get serverUrl => throw _privateConstructorUsedError;
AudiobookShelfUri get serverUrl;
/// Create a copy of AudiobookShelfServer
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$AudiobookShelfServerCopyWith<AudiobookShelfServer> get copyWith => _$AudiobookShelfServerCopyWithImpl<AudiobookShelfServer>(this as AudiobookShelfServer, _$identity);
/// Serializes this AudiobookShelfServer to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is AudiobookShelfServer&&(identical(other.serverUrl, serverUrl) || other.serverUrl == serverUrl));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,serverUrl);
@override
String toString() {
return 'AudiobookShelfServer(serverUrl: $serverUrl)';
}
/// Create a copy of AudiobookShelfServer
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$AudiobookShelfServerCopyWith<AudiobookShelfServer> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $AudiobookShelfServerCopyWith<$Res> {
factory $AudiobookShelfServerCopyWith(AudiobookShelfServer value,
$Res Function(AudiobookShelfServer) then) =
_$AudiobookShelfServerCopyWithImpl<$Res, AudiobookShelfServer>;
@useResult
$Res call({Uri serverUrl});
}
abstract mixin class $AudiobookShelfServerCopyWith<$Res> {
factory $AudiobookShelfServerCopyWith(AudiobookShelfServer value, $Res Function(AudiobookShelfServer) _then) = _$AudiobookShelfServerCopyWithImpl;
@useResult
$Res call({
AudiobookShelfUri serverUrl
});
}
/// @nodoc
class _$AudiobookShelfServerCopyWithImpl<$Res,
$Val extends AudiobookShelfServer>
class _$AudiobookShelfServerCopyWithImpl<$Res>
implements $AudiobookShelfServerCopyWith<$Res> {
_$AudiobookShelfServerCopyWithImpl(this._value, this._then);
_$AudiobookShelfServerCopyWithImpl(this._self, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
final AudiobookShelfServer _self;
final $Res Function(AudiobookShelfServer) _then;
/// Create a copy of AudiobookShelfServer
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? serverUrl = null,
}) {
return _then(_value.copyWith(
serverUrl: null == serverUrl
? _value.serverUrl
: serverUrl // ignore: cast_nullable_to_non_nullable
as Uri,
) as $Val);
}
/// Create a copy of AudiobookShelfServer
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? serverUrl = null,}) {
return _then(_self.copyWith(
serverUrl: null == serverUrl ? _self.serverUrl : serverUrl // ignore: cast_nullable_to_non_nullable
as AudiobookShelfUri,
));
}
/// @nodoc
abstract class _$$AudiobookShelfServerImplCopyWith<$Res>
implements $AudiobookShelfServerCopyWith<$Res> {
factory _$$AudiobookShelfServerImplCopyWith(_$AudiobookShelfServerImpl value,
$Res Function(_$AudiobookShelfServerImpl) then) =
__$$AudiobookShelfServerImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({Uri serverUrl});
}
/// @nodoc
class __$$AudiobookShelfServerImplCopyWithImpl<$Res>
extends _$AudiobookShelfServerCopyWithImpl<$Res, _$AudiobookShelfServerImpl>
implements _$$AudiobookShelfServerImplCopyWith<$Res> {
__$$AudiobookShelfServerImplCopyWithImpl(_$AudiobookShelfServerImpl _value,
$Res Function(_$AudiobookShelfServerImpl) _then)
: super(_value, _then);
/// Create a copy of AudiobookShelfServer
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? serverUrl = null,
}) {
return _then(_$AudiobookShelfServerImpl(
serverUrl: null == serverUrl
? _value.serverUrl
: serverUrl // ignore: cast_nullable_to_non_nullable
as Uri,
));
}
/// Adds pattern-matching-related methods to [AudiobookShelfServer].
extension AudiobookShelfServerPatterns on AudiobookShelfServer {
/// 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( _AudiobookShelfServer value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _AudiobookShelfServer() 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( _AudiobookShelfServer value) $default,){
final _that = this;
switch (_that) {
case _AudiobookShelfServer():
return $default(_that);}
}
/// 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( _AudiobookShelfServer value)? $default,){
final _that = this;
switch (_that) {
case _AudiobookShelfServer() 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( AudiobookShelfUri serverUrl)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _AudiobookShelfServer() when $default != null:
return $default(_that.serverUrl);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( AudiobookShelfUri serverUrl) $default,) {final _that = this;
switch (_that) {
case _AudiobookShelfServer():
return $default(_that.serverUrl);}
}
/// 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( AudiobookShelfUri serverUrl)? $default,) {final _that = this;
switch (_that) {
case _AudiobookShelfServer() when $default != null:
return $default(_that.serverUrl);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _$AudiobookShelfServerImpl implements _AudiobookShelfServer {
const _$AudiobookShelfServerImpl({required this.serverUrl});
factory _$AudiobookShelfServerImpl.fromJson(Map<String, dynamic> json) =>
_$$AudiobookShelfServerImplFromJson(json);
class _AudiobookShelfServer implements AudiobookShelfServer {
const _AudiobookShelfServer({required this.serverUrl});
factory _AudiobookShelfServer.fromJson(Map<String, dynamic> json) => _$AudiobookShelfServerFromJson(json);
@override
final Uri serverUrl;
@override final AudiobookShelfUri serverUrl;
@override
String toString() {
return 'AudiobookShelfServer(serverUrl: $serverUrl)';
}
/// Create a copy of AudiobookShelfServer
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$AudiobookShelfServerCopyWith<_AudiobookShelfServer> get copyWith => __$AudiobookShelfServerCopyWithImpl<_AudiobookShelfServer>(this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$AudiobookShelfServerImpl &&
(identical(other.serverUrl, serverUrl) ||
other.serverUrl == serverUrl));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, serverUrl);
/// Create a copy of AudiobookShelfServer
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$AudiobookShelfServerImplCopyWith<_$AudiobookShelfServerImpl>
get copyWith =>
__$$AudiobookShelfServerImplCopyWithImpl<_$AudiobookShelfServerImpl>(
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$AudiobookShelfServerImplToJson(
this,
);
}
@override
Map<String, dynamic> toJson() {
return _$AudiobookShelfServerToJson(this, );
}
abstract class _AudiobookShelfServer implements AudiobookShelfServer {
const factory _AudiobookShelfServer({required final Uri serverUrl}) =
_$AudiobookShelfServerImpl;
factory _AudiobookShelfServer.fromJson(Map<String, dynamic> json) =
_$AudiobookShelfServerImpl.fromJson;
@override
Uri get serverUrl;
/// Create a copy of AudiobookShelfServer
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$AudiobookShelfServerImplCopyWith<_$AudiobookShelfServerImpl>
get copyWith => throw _privateConstructorUsedError;
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _AudiobookShelfServer&&(identical(other.serverUrl, serverUrl) || other.serverUrl == serverUrl));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,serverUrl);
@override
String toString() {
return 'AudiobookShelfServer(serverUrl: $serverUrl)';
}
}
/// @nodoc
abstract mixin class _$AudiobookShelfServerCopyWith<$Res> implements $AudiobookShelfServerCopyWith<$Res> {
factory _$AudiobookShelfServerCopyWith(_AudiobookShelfServer value, $Res Function(_AudiobookShelfServer) _then) = __$AudiobookShelfServerCopyWithImpl;
@override @useResult
$Res call({
AudiobookShelfUri serverUrl
});
}
/// @nodoc
class __$AudiobookShelfServerCopyWithImpl<$Res>
implements _$AudiobookShelfServerCopyWith<$Res> {
__$AudiobookShelfServerCopyWithImpl(this._self, this._then);
final _AudiobookShelfServer _self;
final $Res Function(_AudiobookShelfServer) _then;
/// Create a copy of AudiobookShelfServer
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? serverUrl = null,}) {
return _then(_AudiobookShelfServer(
serverUrl: null == serverUrl ? _self.serverUrl : serverUrl // ignore: cast_nullable_to_non_nullable
as AudiobookShelfUri,
));
}
}
// dart format on

View file

@ -6,14 +6,10 @@ part of 'audiobookshelf_server.dart';
// JsonSerializableGenerator
// **************************************************************************
_$AudiobookShelfServerImpl _$$AudiobookShelfServerImplFromJson(
Map<String, dynamic> json) =>
_$AudiobookShelfServerImpl(
serverUrl: Uri.parse(json['serverUrl'] as String),
);
_AudiobookShelfServer _$AudiobookShelfServerFromJson(
Map<String, dynamic> json,
) => _AudiobookShelfServer(serverUrl: Uri.parse(json['serverUrl'] as String));
Map<String, dynamic> _$$AudiobookShelfServerImplToJson(
_$AudiobookShelfServerImpl instance) =>
<String, dynamic>{
'serverUrl': instance.serverUrl.toString(),
};
Map<String, dynamic> _$AudiobookShelfServerToJson(
_AudiobookShelfServer instance,
) => <String, dynamic>{'serverUrl': instance.serverUrl.toString()};

View file

@ -6,7 +6,7 @@ part 'authenticated_user.g.dart';
/// authenticated user with server and credentials
@freezed
class AuthenticatedUser with _$AuthenticatedUser {
sealed class AuthenticatedUser with _$AuthenticatedUser {
const factory AuthenticatedUser({
required AudiobookShelfServer server,
required String authToken,

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,238 +9,290 @@ part of 'authenticated_user.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');
AuthenticatedUser _$AuthenticatedUserFromJson(Map<String, dynamic> json) {
return _AuthenticatedUser.fromJson(json);
}
/// @nodoc
mixin _$AuthenticatedUser {
AudiobookShelfServer get server => throw _privateConstructorUsedError;
String get authToken => throw _privateConstructorUsedError;
String get id => throw _privateConstructorUsedError;
String? get username => throw _privateConstructorUsedError;
AudiobookShelfServer get server; String get authToken; String get id; String? get username;
/// Create a copy of AuthenticatedUser
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$AuthenticatedUserCopyWith<AuthenticatedUser> get copyWith => _$AuthenticatedUserCopyWithImpl<AuthenticatedUser>(this as AuthenticatedUser, _$identity);
/// Serializes this AuthenticatedUser to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is AuthenticatedUser&&(identical(other.server, server) || other.server == server)&&(identical(other.authToken, authToken) || other.authToken == authToken)&&(identical(other.id, id) || other.id == id)&&(identical(other.username, username) || other.username == username));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,server,authToken,id,username);
@override
String toString() {
return 'AuthenticatedUser(server: $server, authToken: $authToken, id: $id, username: $username)';
}
/// Create a copy of AuthenticatedUser
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$AuthenticatedUserCopyWith<AuthenticatedUser> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $AuthenticatedUserCopyWith<$Res> {
factory $AuthenticatedUserCopyWith(
AuthenticatedUser value, $Res Function(AuthenticatedUser) then) =
_$AuthenticatedUserCopyWithImpl<$Res, AuthenticatedUser>;
@useResult
$Res call(
{AudiobookShelfServer server,
String authToken,
String id,
String? username});
abstract mixin class $AuthenticatedUserCopyWith<$Res> {
factory $AuthenticatedUserCopyWith(AuthenticatedUser value, $Res Function(AuthenticatedUser) _then) = _$AuthenticatedUserCopyWithImpl;
@useResult
$Res call({
AudiobookShelfServer server, String authToken, String id, String? username
});
$AudiobookShelfServerCopyWith<$Res> get server;
$AudiobookShelfServerCopyWith<$Res> get server;
}
/// @nodoc
class _$AuthenticatedUserCopyWithImpl<$Res, $Val extends AuthenticatedUser>
class _$AuthenticatedUserCopyWithImpl<$Res>
implements $AuthenticatedUserCopyWith<$Res> {
_$AuthenticatedUserCopyWithImpl(this._value, this._then);
_$AuthenticatedUserCopyWithImpl(this._self, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
final AuthenticatedUser _self;
final $Res Function(AuthenticatedUser) _then;
/// Create a copy of AuthenticatedUser
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? server = null,
Object? authToken = null,
Object? id = null,
Object? username = freezed,
}) {
return _then(_value.copyWith(
server: null == server
? _value.server
: server // ignore: cast_nullable_to_non_nullable
as AudiobookShelfServer,
authToken: null == authToken
? _value.authToken
: authToken // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String,
username: freezed == username
? _value.username
: username // ignore: cast_nullable_to_non_nullable
as String?,
) as $Val);
}
/// Create a copy of AuthenticatedUser
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$AudiobookShelfServerCopyWith<$Res> get server {
return $AudiobookShelfServerCopyWith<$Res>(_value.server, (value) {
return _then(_value.copyWith(server: value) as $Val);
});
}
/// Create a copy of AuthenticatedUser
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? server = null,Object? authToken = null,Object? id = null,Object? username = freezed,}) {
return _then(_self.copyWith(
server: null == server ? _self.server : server // ignore: cast_nullable_to_non_nullable
as AudiobookShelfServer,authToken: null == authToken ? _self.authToken : authToken // ignore: cast_nullable_to_non_nullable
as String,id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,username: freezed == username ? _self.username : username // ignore: cast_nullable_to_non_nullable
as String?,
));
}
/// Create a copy of AuthenticatedUser
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$AudiobookShelfServerCopyWith<$Res> get server {
return $AudiobookShelfServerCopyWith<$Res>(_self.server, (value) {
return _then(_self.copyWith(server: value));
});
}
}
/// @nodoc
abstract class _$$AuthenticatedUserImplCopyWith<$Res>
implements $AuthenticatedUserCopyWith<$Res> {
factory _$$AuthenticatedUserImplCopyWith(_$AuthenticatedUserImpl value,
$Res Function(_$AuthenticatedUserImpl) then) =
__$$AuthenticatedUserImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{AudiobookShelfServer server,
String authToken,
String id,
String? username});
@override
$AudiobookShelfServerCopyWith<$Res> get server;
/// Adds pattern-matching-related methods to [AuthenticatedUser].
extension AuthenticatedUserPatterns on AuthenticatedUser {
/// 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( _AuthenticatedUser value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _AuthenticatedUser() 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( _AuthenticatedUser value) $default,){
final _that = this;
switch (_that) {
case _AuthenticatedUser():
return $default(_that);}
}
/// 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( _AuthenticatedUser value)? $default,){
final _that = this;
switch (_that) {
case _AuthenticatedUser() 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( AudiobookShelfServer server, String authToken, String id, String? username)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _AuthenticatedUser() when $default != null:
return $default(_that.server,_that.authToken,_that.id,_that.username);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( AudiobookShelfServer server, String authToken, String id, String? username) $default,) {final _that = this;
switch (_that) {
case _AuthenticatedUser():
return $default(_that.server,_that.authToken,_that.id,_that.username);}
}
/// 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( AudiobookShelfServer server, String authToken, String id, String? username)? $default,) {final _that = this;
switch (_that) {
case _AuthenticatedUser() when $default != null:
return $default(_that.server,_that.authToken,_that.id,_that.username);case _:
return null;
}
}
/// @nodoc
class __$$AuthenticatedUserImplCopyWithImpl<$Res>
extends _$AuthenticatedUserCopyWithImpl<$Res, _$AuthenticatedUserImpl>
implements _$$AuthenticatedUserImplCopyWith<$Res> {
__$$AuthenticatedUserImplCopyWithImpl(_$AuthenticatedUserImpl _value,
$Res Function(_$AuthenticatedUserImpl) _then)
: super(_value, _then);
/// Create a copy of AuthenticatedUser
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? server = null,
Object? authToken = null,
Object? id = null,
Object? username = freezed,
}) {
return _then(_$AuthenticatedUserImpl(
server: null == server
? _value.server
: server // ignore: cast_nullable_to_non_nullable
as AudiobookShelfServer,
authToken: null == authToken
? _value.authToken
: authToken // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String,
username: freezed == username
? _value.username
: username // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
@JsonSerializable()
class _$AuthenticatedUserImpl implements _AuthenticatedUser {
const _$AuthenticatedUserImpl(
{required this.server,
required this.authToken,
required this.id,
this.username});
factory _$AuthenticatedUserImpl.fromJson(Map<String, dynamic> json) =>
_$$AuthenticatedUserImplFromJson(json);
class _AuthenticatedUser implements AuthenticatedUser {
const _AuthenticatedUser({required this.server, required this.authToken, required this.id, this.username});
factory _AuthenticatedUser.fromJson(Map<String, dynamic> json) => _$AuthenticatedUserFromJson(json);
@override
final AudiobookShelfServer server;
@override
final String authToken;
@override
final String id;
@override
final String? username;
@override final AudiobookShelfServer server;
@override final String authToken;
@override final String id;
@override final String? username;
@override
String toString() {
return 'AuthenticatedUser(server: $server, authToken: $authToken, id: $id, username: $username)';
}
/// Create a copy of AuthenticatedUser
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$AuthenticatedUserCopyWith<_AuthenticatedUser> get copyWith => __$AuthenticatedUserCopyWithImpl<_AuthenticatedUser>(this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$AuthenticatedUserImpl &&
(identical(other.server, server) || other.server == server) &&
(identical(other.authToken, authToken) ||
other.authToken == authToken) &&
(identical(other.id, id) || other.id == id) &&
(identical(other.username, username) ||
other.username == username));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, server, authToken, id, username);
/// Create a copy of AuthenticatedUser
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$AuthenticatedUserImplCopyWith<_$AuthenticatedUserImpl> get copyWith =>
__$$AuthenticatedUserImplCopyWithImpl<_$AuthenticatedUserImpl>(
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$AuthenticatedUserImplToJson(
this,
);
}
@override
Map<String, dynamic> toJson() {
return _$AuthenticatedUserToJson(this, );
}
abstract class _AuthenticatedUser implements AuthenticatedUser {
const factory _AuthenticatedUser(
{required final AudiobookShelfServer server,
required final String authToken,
required final String id,
final String? username}) = _$AuthenticatedUserImpl;
factory _AuthenticatedUser.fromJson(Map<String, dynamic> json) =
_$AuthenticatedUserImpl.fromJson;
@override
AudiobookShelfServer get server;
@override
String get authToken;
@override
String get id;
@override
String? get username;
/// Create a copy of AuthenticatedUser
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$AuthenticatedUserImplCopyWith<_$AuthenticatedUserImpl> get copyWith =>
throw _privateConstructorUsedError;
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _AuthenticatedUser&&(identical(other.server, server) || other.server == server)&&(identical(other.authToken, authToken) || other.authToken == authToken)&&(identical(other.id, id) || other.id == id)&&(identical(other.username, username) || other.username == username));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,server,authToken,id,username);
@override
String toString() {
return 'AuthenticatedUser(server: $server, authToken: $authToken, id: $id, username: $username)';
}
}
/// @nodoc
abstract mixin class _$AuthenticatedUserCopyWith<$Res> implements $AuthenticatedUserCopyWith<$Res> {
factory _$AuthenticatedUserCopyWith(_AuthenticatedUser value, $Res Function(_AuthenticatedUser) _then) = __$AuthenticatedUserCopyWithImpl;
@override @useResult
$Res call({
AudiobookShelfServer server, String authToken, String id, String? username
});
@override $AudiobookShelfServerCopyWith<$Res> get server;
}
/// @nodoc
class __$AuthenticatedUserCopyWithImpl<$Res>
implements _$AuthenticatedUserCopyWith<$Res> {
__$AuthenticatedUserCopyWithImpl(this._self, this._then);
final _AuthenticatedUser _self;
final $Res Function(_AuthenticatedUser) _then;
/// Create a copy of AuthenticatedUser
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? server = null,Object? authToken = null,Object? id = null,Object? username = freezed,}) {
return _then(_AuthenticatedUser(
server: null == server ? _self.server : server // ignore: cast_nullable_to_non_nullable
as AudiobookShelfServer,authToken: null == authToken ? _self.authToken : authToken // ignore: cast_nullable_to_non_nullable
as String,id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,username: freezed == username ? _self.username : username // ignore: cast_nullable_to_non_nullable
as String?,
));
}
/// Create a copy of AuthenticatedUser
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$AudiobookShelfServerCopyWith<$Res> get server {
return $AudiobookShelfServerCopyWith<$Res>(_self.server, (value) {
return _then(_self.copyWith(server: value));
});
}
}
// dart format on

View file

@ -6,18 +6,17 @@ part of 'authenticated_user.dart';
// JsonSerializableGenerator
// **************************************************************************
_$AuthenticatedUserImpl _$$AuthenticatedUserImplFromJson(
Map<String, dynamic> json) =>
_$AuthenticatedUserImpl(
server:
AudiobookShelfServer.fromJson(json['server'] as Map<String, dynamic>),
_AuthenticatedUser _$AuthenticatedUserFromJson(Map<String, dynamic> json) =>
_AuthenticatedUser(
server: AudiobookShelfServer.fromJson(
json['server'] as Map<String, dynamic>,
),
authToken: json['authToken'] as String,
id: json['id'] as String,
username: json['username'] as String?,
);
Map<String, dynamic> _$$AuthenticatedUserImplToJson(
_$AuthenticatedUserImpl instance) =>
Map<String, dynamic> _$AuthenticatedUserToJson(_AuthenticatedUser instance) =>
<String, dynamic>{
'server': instance.server,
'authToken': instance.authToken,

View file

@ -217,7 +217,7 @@ class _BookOnShelfPlayButton extends HookConsumerWidget {
player.book?.libraryItemId == libraryItemId;
final isPlayingThisBook = player.playing && isCurrentBookSetInPlayer;
final userProgress = me.valueOrNull?.mediaProgress
final userProgress = me.value?.mediaProgress
?.firstWhereOrNull((element) => element.libraryItemId == libraryItemId);
final isBookCompleted = userProgress?.isFinished ?? false;
@ -243,7 +243,7 @@ class _BookOnShelfPlayButton extends HookConsumerWidget {
// if current book is set in player, get theme from the cover image
data: ThemeData(
colorScheme:
coverColorScheme.valueOrNull ?? Theme.of(context).colorScheme,
coverColorScheme.value ?? Theme.of(context).colorScheme,
),
child: Padding(
padding: EdgeInsets.all(strokeWidth / 2 + 2),

View file

@ -6,174 +6,91 @@ part of 'system_theme_provider.dart';
// RiverpodGenerator
// **************************************************************************
String _$systemThemeHash() => r'c78d3d94683624a80b296594268c5fd4295e77a3';
/// Copied from Dart SDK
class _SystemHash {
_SystemHash._();
static int combine(int hash, int value) {
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + value);
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
return hash ^ (hash >> 6);
}
static int finish(int hash) {
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
// ignore: parameter_assignments
hash = hash ^ (hash >> 11);
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
}
}
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
/// copied from [DynamicColorBuilder]
///
/// Copied from [systemTheme].
@ProviderFor(systemTheme)
const systemThemeProvider = SystemThemeFamily();
final systemThemeProvider = SystemThemeFamily._();
/// copied from [DynamicColorBuilder]
///
/// Copied from [systemTheme].
class SystemThemeFamily
extends Family<AsyncValue<(ColorScheme light, ColorScheme dark)?>> {
/// copied from [DynamicColorBuilder]
///
/// Copied from [systemTheme].
const SystemThemeFamily();
final class SystemThemeProvider
extends
$FunctionalProvider<
AsyncValue<(ColorScheme, ColorScheme)?>,
(ColorScheme, ColorScheme)?,
FutureOr<(ColorScheme, ColorScheme)?>
>
with
$FutureModifier<(ColorScheme, ColorScheme)?>,
$FutureProvider<(ColorScheme, ColorScheme)?> {
/// copied from [DynamicColorBuilder]
///
/// Copied from [systemTheme].
SystemThemeProvider call({
bool highContrast = false,
}) {
return SystemThemeProvider(
highContrast: highContrast,
);
SystemThemeProvider._({
required SystemThemeFamily super.from,
required bool super.argument,
}) : super(
retry: null,
name: r'systemThemeProvider',
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
String debugGetCreateSourceHash() => _$systemThemeHash();
@override
String toString() {
return r'systemThemeProvider'
''
'($argument)';
}
@$internal
@override
SystemThemeProvider getProviderOverride(
covariant SystemThemeProvider provider,
) {
return call(
highContrast: provider.highContrast,
);
}
static const Iterable<ProviderOrFamily>? _dependencies = null;
$FutureProviderElement<(ColorScheme, ColorScheme)?> $createElement(
$ProviderPointer pointer,
) => $FutureProviderElement(pointer);
@override
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
@override
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
_allTransitiveDependencies;
@override
String? get name => r'systemThemeProvider';
}
/// copied from [DynamicColorBuilder]
///
/// Copied from [systemTheme].
class SystemThemeProvider
extends FutureProvider<(ColorScheme light, ColorScheme dark)?> {
/// copied from [DynamicColorBuilder]
///
/// Copied from [systemTheme].
SystemThemeProvider({
bool highContrast = false,
}) : this._internal(
(ref) => systemTheme(
ref as SystemThemeRef,
highContrast: highContrast,
),
from: systemThemeProvider,
name: r'systemThemeProvider',
debugGetCreateSourceHash:
const bool.fromEnvironment('dart.vm.product')
? null
: _$systemThemeHash,
dependencies: SystemThemeFamily._dependencies,
allTransitiveDependencies:
SystemThemeFamily._allTransitiveDependencies,
highContrast: highContrast,
);
SystemThemeProvider._internal(
super._createNotifier, {
required super.name,
required super.dependencies,
required super.allTransitiveDependencies,
required super.debugGetCreateSourceHash,
required super.from,
required this.highContrast,
}) : super.internal();
final bool highContrast;
@override
Override overrideWith(
FutureOr<(ColorScheme light, ColorScheme dark)?> Function(
SystemThemeRef provider)
create,
) {
return ProviderOverride(
origin: this,
override: SystemThemeProvider._internal(
(ref) => create(ref as SystemThemeRef),
from: from,
name: null,
dependencies: null,
allTransitiveDependencies: null,
debugGetCreateSourceHash: null,
highContrast: highContrast,
),
);
}
@override
FutureProviderElement<(ColorScheme light, ColorScheme dark)?>
createElement() {
return _SystemThemeProviderElement(this);
FutureOr<(ColorScheme, ColorScheme)?> create(Ref ref) {
final argument = this.argument as bool;
return systemTheme(ref, highContrast: argument);
}
@override
bool operator ==(Object other) {
return other is SystemThemeProvider && other.highContrast == highContrast;
return other is SystemThemeProvider && other.argument == argument;
}
@override
int get hashCode {
var hash = _SystemHash.combine(0, runtimeType.hashCode);
hash = _SystemHash.combine(hash, highContrast.hashCode);
return _SystemHash.finish(hash);
return argument.hashCode;
}
}
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
mixin SystemThemeRef
on FutureProviderRef<(ColorScheme light, ColorScheme dark)?> {
/// The parameter `highContrast` of this provider.
bool get highContrast;
}
String _$systemThemeHash() => r'c78d3d94683624a80b296594268c5fd4295e77a3';
class _SystemThemeProviderElement
extends FutureProviderElement<(ColorScheme light, ColorScheme dark)?>
with SystemThemeRef {
_SystemThemeProviderElement(super.provider);
/// copied from [DynamicColorBuilder]
final class SystemThemeFamily extends $Family
with
$FunctionalFamilyOverride<FutureOr<(ColorScheme, ColorScheme)?>, bool> {
SystemThemeFamily._()
: super(
retry: null,
name: r'systemThemeProvider',
dependencies: null,
$allTransitiveDependencies: null,
isAutoDispose: false,
);
/// copied from [DynamicColorBuilder]
SystemThemeProvider call({bool highContrast = false}) =>
SystemThemeProvider._(argument: highContrast, from: this);
@override
bool get highContrast => (origin as SystemThemeProvider).highContrast;
String toString() => r'systemThemeProvider';
}
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

View file

@ -6,355 +6,197 @@ part of 'theme_from_cover_provider.dart';
// RiverpodGenerator
// **************************************************************************
String _$themeFromCoverHash() => r'afdeddc4bfe2fe46a4185143d3a88a23565e33f4';
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
/// Copied from Dart SDK
class _SystemHash {
_SystemHash._();
static int combine(int hash, int value) {
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + value);
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
return hash ^ (hash >> 6);
}
static int finish(int hash) {
// ignore: parameter_assignments
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
// ignore: parameter_assignments
hash = hash ^ (hash >> 11);
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
}
}
/// See also [themeFromCover].
@ProviderFor(themeFromCover)
const themeFromCoverProvider = ThemeFromCoverFamily();
final themeFromCoverProvider = ThemeFromCoverFamily._();
/// See also [themeFromCover].
class ThemeFromCoverFamily extends Family<AsyncValue<FutureOr<ColorScheme?>>> {
/// See also [themeFromCover].
const ThemeFromCoverFamily();
final class ThemeFromCoverProvider
extends
$FunctionalProvider<
AsyncValue<FutureOr<ColorScheme?>>,
FutureOr<ColorScheme?>,
FutureOr<FutureOr<ColorScheme?>>
>
with
$FutureModifier<FutureOr<ColorScheme?>>,
$FutureProvider<FutureOr<ColorScheme?>> {
ThemeFromCoverProvider._({
required ThemeFromCoverFamily super.from,
required (ImageProvider<Object>, {Brightness brightness, bool highContrast})
super.argument,
}) : super(
retry: null,
name: r'themeFromCoverProvider',
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
/// See also [themeFromCover].
ThemeFromCoverProvider call(
ImageProvider<Object> img, {
Brightness brightness = Brightness.dark,
bool highContrast = false,
}) {
return ThemeFromCoverProvider(
img,
brightness: brightness,
highContrast: highContrast,
);
@override
String debugGetCreateSourceHash() => _$themeFromCoverHash();
@override
String toString() {
return r'themeFromCoverProvider'
''
'$argument';
}
@$internal
@override
ThemeFromCoverProvider getProviderOverride(
covariant ThemeFromCoverProvider provider,
) {
return call(
provider.img,
brightness: provider.brightness,
highContrast: provider.highContrast,
$FutureProviderElement<FutureOr<ColorScheme?>> $createElement(
$ProviderPointer pointer,
) => $FutureProviderElement(pointer);
@override
FutureOr<FutureOr<ColorScheme?>> create(Ref ref) {
final argument =
this.argument
as (
ImageProvider<Object>, {
Brightness brightness,
bool highContrast,
});
return themeFromCover(
ref,
argument.$1,
brightness: argument.brightness,
highContrast: argument.highContrast,
);
}
static const Iterable<ProviderOrFamily>? _dependencies = null;
@override
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
@override
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
_allTransitiveDependencies;
@override
String? get name => r'themeFromCoverProvider';
}
/// See also [themeFromCover].
class ThemeFromCoverProvider extends FutureProvider<FutureOr<ColorScheme?>> {
/// See also [themeFromCover].
ThemeFromCoverProvider(
ImageProvider<Object> img, {
Brightness brightness = Brightness.dark,
bool highContrast = false,
}) : this._internal(
(ref) => themeFromCover(
ref as ThemeFromCoverRef,
img,
brightness: brightness,
highContrast: highContrast,
),
from: themeFromCoverProvider,
name: r'themeFromCoverProvider',
debugGetCreateSourceHash:
const bool.fromEnvironment('dart.vm.product')
? null
: _$themeFromCoverHash,
dependencies: ThemeFromCoverFamily._dependencies,
allTransitiveDependencies:
ThemeFromCoverFamily._allTransitiveDependencies,
img: img,
brightness: brightness,
highContrast: highContrast,
);
ThemeFromCoverProvider._internal(
super._createNotifier, {
required super.name,
required super.dependencies,
required super.allTransitiveDependencies,
required super.debugGetCreateSourceHash,
required super.from,
required this.img,
required this.brightness,
required this.highContrast,
}) : super.internal();
final ImageProvider<Object> img;
final Brightness brightness;
final bool highContrast;
@override
Override overrideWith(
FutureOr<FutureOr<ColorScheme?>> Function(ThemeFromCoverRef provider)
create,
) {
return ProviderOverride(
origin: this,
override: ThemeFromCoverProvider._internal(
(ref) => create(ref as ThemeFromCoverRef),
from: from,
name: null,
dependencies: null,
allTransitiveDependencies: null,
debugGetCreateSourceHash: null,
img: img,
brightness: brightness,
highContrast: highContrast,
),
);
}
@override
FutureProviderElement<FutureOr<ColorScheme?>> createElement() {
return _ThemeFromCoverProviderElement(this);
}
@override
bool operator ==(Object other) {
return other is ThemeFromCoverProvider &&
other.img == img &&
other.brightness == brightness &&
other.highContrast == highContrast;
return other is ThemeFromCoverProvider && other.argument == argument;
}
@override
int get hashCode {
var hash = _SystemHash.combine(0, runtimeType.hashCode);
hash = _SystemHash.combine(hash, img.hashCode);
hash = _SystemHash.combine(hash, brightness.hashCode);
hash = _SystemHash.combine(hash, highContrast.hashCode);
return _SystemHash.finish(hash);
return argument.hashCode;
}
}
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
mixin ThemeFromCoverRef on FutureProviderRef<FutureOr<ColorScheme?>> {
/// The parameter `img` of this provider.
ImageProvider<Object> get img;
String _$themeFromCoverHash() => r'afdeddc4bfe2fe46a4185143d3a88a23565e33f4';
/// The parameter `brightness` of this provider.
Brightness get brightness;
final class ThemeFromCoverFamily extends $Family
with
$FunctionalFamilyOverride<
FutureOr<FutureOr<ColorScheme?>>,
(ImageProvider<Object>, {Brightness brightness, bool highContrast})
> {
ThemeFromCoverFamily._()
: super(
retry: null,
name: r'themeFromCoverProvider',
dependencies: null,
$allTransitiveDependencies: null,
isAutoDispose: false,
);
/// The parameter `highContrast` of this provider.
bool get highContrast;
ThemeFromCoverProvider call(
ImageProvider<Object> img, {
Brightness brightness = Brightness.dark,
bool highContrast = false,
}) => ThemeFromCoverProvider._(
argument: (img, brightness: brightness, highContrast: highContrast),
from: this,
);
@override
String toString() => r'themeFromCoverProvider';
}
class _ThemeFromCoverProviderElement
extends FutureProviderElement<FutureOr<ColorScheme?>>
with ThemeFromCoverRef {
_ThemeFromCoverProviderElement(super.provider);
@ProviderFor(themeOfLibraryItem)
final themeOfLibraryItemProvider = ThemeOfLibraryItemFamily._();
final class ThemeOfLibraryItemProvider
extends
$FunctionalProvider<
AsyncValue<ColorScheme?>,
ColorScheme?,
FutureOr<ColorScheme?>
>
with $FutureModifier<ColorScheme?>, $FutureProvider<ColorScheme?> {
ThemeOfLibraryItemProvider._({
required ThemeOfLibraryItemFamily super.from,
required (String?, {Brightness brightness, bool highContrast})
super.argument,
}) : super(
retry: null,
name: r'themeOfLibraryItemProvider',
isAutoDispose: false,
dependencies: null,
$allTransitiveDependencies: null,
);
@override
ImageProvider<Object> get img => (origin as ThemeFromCoverProvider).img;
String debugGetCreateSourceHash() => _$themeOfLibraryItemHash();
@override
Brightness get brightness => (origin as ThemeFromCoverProvider).brightness;
String toString() {
return r'themeOfLibraryItemProvider'
''
'$argument';
}
@$internal
@override
bool get highContrast => (origin as ThemeFromCoverProvider).highContrast;
$FutureProviderElement<ColorScheme?> $createElement(
$ProviderPointer pointer,
) => $FutureProviderElement(pointer);
@override
FutureOr<ColorScheme?> create(Ref ref) {
final argument =
this.argument as (String?, {Brightness brightness, bool highContrast});
return themeOfLibraryItem(
ref,
argument.$1,
brightness: argument.brightness,
highContrast: argument.highContrast,
);
}
@override
bool operator ==(Object other) {
return other is ThemeOfLibraryItemProvider && other.argument == argument;
}
@override
int get hashCode {
return argument.hashCode;
}
}
String _$themeOfLibraryItemHash() =>
r'0b2df397b2938003a9de6beb6d4204401a05370c';
/// See also [themeOfLibraryItem].
@ProviderFor(themeOfLibraryItem)
const themeOfLibraryItemProvider = ThemeOfLibraryItemFamily();
final class ThemeOfLibraryItemFamily extends $Family
with
$FunctionalFamilyOverride<
FutureOr<ColorScheme?>,
(String?, {Brightness brightness, bool highContrast})
> {
ThemeOfLibraryItemFamily._()
: super(
retry: null,
name: r'themeOfLibraryItemProvider',
dependencies: null,
$allTransitiveDependencies: null,
isAutoDispose: false,
);
/// See also [themeOfLibraryItem].
class ThemeOfLibraryItemFamily extends Family<AsyncValue<ColorScheme?>> {
/// See also [themeOfLibraryItem].
const ThemeOfLibraryItemFamily();
/// See also [themeOfLibraryItem].
ThemeOfLibraryItemProvider call(
String? itemId, {
Brightness brightness = Brightness.dark,
bool highContrast = false,
}) {
return ThemeOfLibraryItemProvider(
itemId,
brightness: brightness,
highContrast: highContrast,
);
}
}) => ThemeOfLibraryItemProvider._(
argument: (itemId, brightness: brightness, highContrast: highContrast),
from: this,
);
@override
ThemeOfLibraryItemProvider getProviderOverride(
covariant ThemeOfLibraryItemProvider provider,
) {
return call(
provider.itemId,
brightness: provider.brightness,
highContrast: provider.highContrast,
);
}
static const Iterable<ProviderOrFamily>? _dependencies = null;
@override
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
@override
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
_allTransitiveDependencies;
@override
String? get name => r'themeOfLibraryItemProvider';
String toString() => r'themeOfLibraryItemProvider';
}
/// See also [themeOfLibraryItem].
class ThemeOfLibraryItemProvider extends FutureProvider<ColorScheme?> {
/// See also [themeOfLibraryItem].
ThemeOfLibraryItemProvider(
String? itemId, {
Brightness brightness = Brightness.dark,
bool highContrast = false,
}) : this._internal(
(ref) => themeOfLibraryItem(
ref as ThemeOfLibraryItemRef,
itemId,
brightness: brightness,
highContrast: highContrast,
),
from: themeOfLibraryItemProvider,
name: r'themeOfLibraryItemProvider',
debugGetCreateSourceHash:
const bool.fromEnvironment('dart.vm.product')
? null
: _$themeOfLibraryItemHash,
dependencies: ThemeOfLibraryItemFamily._dependencies,
allTransitiveDependencies:
ThemeOfLibraryItemFamily._allTransitiveDependencies,
itemId: itemId,
brightness: brightness,
highContrast: highContrast,
);
ThemeOfLibraryItemProvider._internal(
super._createNotifier, {
required super.name,
required super.dependencies,
required super.allTransitiveDependencies,
required super.debugGetCreateSourceHash,
required super.from,
required this.itemId,
required this.brightness,
required this.highContrast,
}) : super.internal();
final String? itemId;
final Brightness brightness;
final bool highContrast;
@override
Override overrideWith(
FutureOr<ColorScheme?> Function(ThemeOfLibraryItemRef provider) create,
) {
return ProviderOverride(
origin: this,
override: ThemeOfLibraryItemProvider._internal(
(ref) => create(ref as ThemeOfLibraryItemRef),
from: from,
name: null,
dependencies: null,
allTransitiveDependencies: null,
debugGetCreateSourceHash: null,
itemId: itemId,
brightness: brightness,
highContrast: highContrast,
),
);
}
@override
FutureProviderElement<ColorScheme?> createElement() {
return _ThemeOfLibraryItemProviderElement(this);
}
@override
bool operator ==(Object other) {
return other is ThemeOfLibraryItemProvider &&
other.itemId == itemId &&
other.brightness == brightness &&
other.highContrast == highContrast;
}
@override
int get hashCode {
var hash = _SystemHash.combine(0, runtimeType.hashCode);
hash = _SystemHash.combine(hash, itemId.hashCode);
hash = _SystemHash.combine(hash, brightness.hashCode);
hash = _SystemHash.combine(hash, highContrast.hashCode);
return _SystemHash.finish(hash);
}
}
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
mixin ThemeOfLibraryItemRef on FutureProviderRef<ColorScheme?> {
/// The parameter `itemId` of this provider.
String? get itemId;
/// The parameter `brightness` of this provider.
Brightness get brightness;
/// The parameter `highContrast` of this provider.
bool get highContrast;
}
class _ThemeOfLibraryItemProviderElement
extends FutureProviderElement<ColorScheme?> with ThemeOfLibraryItemRef {
_ThemeOfLibraryItemProviderElement(super.provider);
@override
String? get itemId => (origin as ThemeOfLibraryItemProvider).itemId;
@override
Brightness get brightness =>
(origin as ThemeOfLibraryItemProvider).brightness;
@override
bool get highContrast => (origin as ThemeOfLibraryItemProvider).highContrast;
}
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

View file

@ -7,7 +7,7 @@
#include "generated_plugin_registrant.h"
#include <dynamic_color/dynamic_color_plugin.h>
#include <isar_flutter_libs/isar_flutter_libs_plugin.h>
#include <isar_plus_flutter_libs/isar_plus_flutter_libs_plugin.h>
#include <media_kit_libs_linux/media_kit_libs_linux_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>
@ -15,9 +15,9 @@ void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) dynamic_color_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "DynamicColorPlugin");
dynamic_color_plugin_register_with_registrar(dynamic_color_registrar);
g_autoptr(FlPluginRegistrar) isar_flutter_libs_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "IsarFlutterLibsPlugin");
isar_flutter_libs_plugin_register_with_registrar(isar_flutter_libs_registrar);
g_autoptr(FlPluginRegistrar) isar_plus_flutter_libs_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "IsarPlusFlutterLibsPlugin");
isar_plus_flutter_libs_plugin_register_with_registrar(isar_plus_flutter_libs_registrar);
g_autoptr(FlPluginRegistrar) media_kit_libs_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "MediaKitLibsLinuxPlugin");
media_kit_libs_linux_plugin_register_with_registrar(media_kit_libs_linux_registrar);

View file

@ -4,7 +4,7 @@
list(APPEND FLUTTER_PLUGIN_LIST
dynamic_color
isar_flutter_libs
isar_plus_flutter_libs
media_kit_libs_linux
url_launcher_linux
)

View file

@ -5,31 +5,26 @@ packages:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab"
sha256: c209688d9f5a5f26b2fb47a188131a6fb9e876ae9e47af3737c0b4f58a93470d
url: "https://pub.dev"
source: hosted
version: "76.0.0"
_macros:
dependency: transitive
description: dart
source: sdk
version: "0.3.3"
version: "91.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e"
sha256: f51c8499b35f9b26820cfe914828a6a98a94efd5cc78b37bb7d03debae3a1d08
url: "https://pub.dev"
source: hosted
version: "6.11.0"
analyzer_plugin:
version: "8.4.1"
analyzer_buffer:
dependency: transitive
description:
name: analyzer_plugin
sha256: "9661b30b13a685efaee9f02e5d01ed9f2b423bd889d28a304d02d704aee69161"
name: analyzer_buffer
sha256: aba2f75e63b3135fd1efaa8b6abefe1aa6e41b6bd9806221620fa48f98156033
url: "https://pub.dev"
source: hosted
version: "0.11.3"
version: "0.1.11"
animated_list_plus:
dependency: "direct main"
description:
@ -138,18 +133,18 @@ packages:
dependency: transitive
description:
name: build
sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0
sha256: c1668065e9ba04752570ad7e038288559d1e2ca5c6d0131c0f5f55e39e777413
url: "https://pub.dev"
source: hosted
version: "2.4.2"
version: "4.0.3"
build_config:
dependency: transitive
description:
name: build_config
sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33"
sha256: "4f64382b97504dc2fcdf487d5aae33418e08b4703fc21249e4db6d804a4d0187"
url: "https://pub.dev"
source: hosted
version: "1.1.2"
version: "1.2.0"
build_daemon:
dependency: transitive
description:
@ -158,30 +153,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.0.4"
build_resolvers:
dependency: transitive
description:
name: build_resolvers
sha256: b9e4fda21d846e192628e7a4f6deda6888c36b5b69ba02ff291a01fd529140f0
url: "https://pub.dev"
source: hosted
version: "2.4.4"
build_runner:
dependency: "direct dev"
description:
name: build_runner
sha256: "058fe9dce1de7d69c4b84fada934df3e0153dd000758c4d65964d0166779aa99"
sha256: "110c56ef29b5eb367b4d17fc79375fa8c18a6cd7acd92c05bb3986c17a079057"
url: "https://pub.dev"
source: hosted
version: "2.4.15"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021"
url: "https://pub.dev"
source: hosted
version: "8.0.0"
version: "2.10.4"
built_collection:
dependency: transitive
description:
@ -194,10 +173,10 @@ packages:
dependency: transitive
description:
name: built_value
sha256: "7193c909c8608d3e1a263093ff045f7140bcc1bf3f7de2c5ec7ad027891d2d22"
sha256: "426cf75afdb23aa74bd4e471704de3f9393f3c7b04c1e2d9c6f1073ae0b8b139"
url: "https://pub.dev"
source: hosted
version: "8.10.0"
version: "8.12.1"
cached_network_image:
dependency: "direct main"
description:
@ -246,22 +225,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.3"
ci:
cli_config:
dependency: transitive
description:
name: ci
sha256: "145d095ce05cddac4d797a158bc4cf3b6016d1fe63d8c3d2fbd7212590adca13"
name: cli_config
sha256: ac20a183a07002b700f0c25e61b7ee46b23c309d76ab7b7640a028f18e4d99ec
url: "https://pub.dev"
source: hosted
version: "0.1.0"
cli_util:
dependency: transitive
description:
name: cli_util
sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c
url: "https://pub.dev"
source: hosted
version: "0.4.2"
version: "0.2.0"
clock:
dependency: transitive
description:
@ -302,6 +273,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.1.2"
coverage:
dependency: transitive
description:
name: coverage
sha256: "5da775aa218eaf2151c721b16c01c7676fbfdd99cebba2bf64e8b807a28ff94d"
url: "https://pub.dev"
source: hosted
version: "1.15.0"
cross_file:
dependency: transitive
description:
@ -326,46 +305,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.8"
custom_lint:
dependency: "direct dev"
description:
name: custom_lint
sha256: "3486c470bb93313a9417f926c7dd694a2e349220992d7b9d14534dc49c15bba9"
url: "https://pub.dev"
source: hosted
version: "0.7.0"
custom_lint_builder:
dependency: transitive
description:
name: custom_lint_builder
sha256: "42cdc41994eeeddab0d7a722c7093ec52bd0761921eeb2cbdbf33d192a234759"
url: "https://pub.dev"
source: hosted
version: "0.7.0"
custom_lint_core:
dependency: transitive
description:
name: custom_lint_core
sha256: "02450c3e45e2a6e8b26c4d16687596ab3c4644dd5792e3313aa9ceba5a49b7f5"
url: "https://pub.dev"
source: hosted
version: "0.7.0"
custom_lint_visitor:
dependency: transitive
description:
name: custom_lint_visitor
sha256: bfe9b7a09c4775a587b58d10ebb871d4fe618237639b1e84d5ec62d7dfef25f9
url: "https://pub.dev"
source: hosted
version: "1.0.0+6.11.0"
dart_style:
dependency: transitive
description:
name: dart_style
sha256: "7306ab8a2359a48d22310ad823521d723acfed60ee1f7e37388e8986853b6820"
sha256: a9c30492da18ff84efe2422ba2d319a89942d93e58eb0b73d32abe822ef54b7b
url: "https://pub.dev"
source: hosted
version: "2.3.8"
version: "3.1.3"
device_info_plus:
dependency: "direct main"
description:
@ -511,10 +458,10 @@ packages:
dependency: transitive
description:
name: flutter_riverpod
sha256: "9532ee6db4a943a1ed8383072a2e3eeda041db5657cdf6d2acecf3c21ecbe7e1"
sha256: "38ec6c303e2c83ee84512f5fc2a82ae311531021938e63d7137eccc107bf3c02"
url: "https://pub.dev"
source: hosted
version: "2.6.1"
version: "3.1.0"
flutter_settings_ui:
dependency: "direct main"
description:
@ -553,18 +500,18 @@ packages:
dependency: "direct dev"
description:
name: freezed
sha256: "44c19278dd9d89292cf46e97dc0c1e52ce03275f40a97c5a348e802a924bf40e"
sha256: "13065f10e135263a4f5a4391b79a8efc5fb8106f8dd555a9e49b750b45393d77"
url: "https://pub.dev"
source: hosted
version: "2.5.7"
version: "3.2.3"
freezed_annotation:
dependency: "direct main"
description:
name: freezed_annotation
sha256: c2e2d632dd9b8a2b7751117abcfc2b4888ecfe181bd9fca7170d9ef02e595fe2
sha256: "7294967ff0a6d98638e7acb774aac3af2550777accd8149c90af5b014e6d44d8"
url: "https://pub.dev"
source: hosted
version: "2.4.4"
version: "3.1.0"
frontend_server_client:
dependency: transitive
description:
@ -597,30 +544,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.3.2"
hive:
hive_plus_secure:
dependency: "direct main"
description:
name: hive
sha256: "10819524df282842ebae12870e2e0e9ebc3e5c4637bec741ad39b919c589cb20"
name: hive_plus_secure
sha256: "0bf08f07b42bc42137cfb151ee7fbe417c8295db69d13bb316d81abecfb02aed"
url: "https://pub.dev"
source: hosted
version: "4.0.0-dev.2"
version: "1.1.25"
hooks_riverpod:
dependency: "direct main"
description:
name: hooks_riverpod
sha256: "70bba33cfc5670c84b796e6929c54b8bc5be7d0fe15bb28c2560500b9ad06966"
sha256: b880efcd17757af0aa242e5dceac2fb781a014c22a32435a5daa8f17e9d5d8a9
url: "https://pub.dev"
source: hosted
version: "2.6.1"
hotreloader:
dependency: transitive
description:
name: hotreloader
sha256: bc167a1163807b03bada490bfe2df25b0d744df359227880220a5cbd04e5734b
url: "https://pub.dev"
source: hosted
version: "4.3.0"
version: "3.1.0"
http:
dependency: transitive
description:
@ -677,22 +616,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.5"
isar:
isar_plus:
dependency: "direct main"
description:
name: isar
sha256: ebf74d87c400bd9f7da14acb31932b50c2407edbbd40930da3a6c2a8143f85a8
name: isar_plus
sha256: "43d874216d2f1fcec06f209ebbc75e7ca9705076d8c7077ec6ac5ea511dad9dd"
url: "https://pub.dev"
source: hosted
version: "4.0.0-dev.14"
isar_flutter_libs:
version: "1.2.0"
isar_plus_flutter_libs:
dependency: "direct main"
description:
name: isar_flutter_libs
sha256: "04a3f4035e213ddb6e78d0132a7c80296a085c2088c2a761b4a42ee5add36983"
name: isar_plus_flutter_libs
sha256: e142590a13b5c9d349555ebd72a25ee34901992a2bb32ba6ccfd414519b48adf
url: "https://pub.dev"
source: hosted
version: "4.0.0-dev.14"
version: "1.2.0"
js:
dependency: transitive
description:
@ -713,10 +652,10 @@ packages:
dependency: "direct dev"
description:
name: json_serializable
sha256: c2fcb3920cf2b6ae6845954186420fca40bc0a8abcc84903b7801f17d7050d7c
sha256: c5b2ee75210a0f263c6c7b9eeea80553dbae96ea1bf57f02484e806a3ffdffa3
url: "https://pub.dev"
source: hosted
version: "6.9.0"
version: "6.11.2"
just_audio:
dependency: "direct main"
description:
@ -762,26 +701,26 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
url: "https://pub.dev"
source: hosted
version: "10.0.9"
version: "11.0.2"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
url: "https://pub.dev"
source: hosted
version: "3.0.9"
version: "3.0.10"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
version: "3.0.2"
lints:
dependency: transitive
description:
@ -798,6 +737,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.0.3"
logger:
dependency: transitive
description:
name: logger
sha256: a7967e31b703831a893bbc3c3dd11db08126fe5f369b5c648a36f821979f5be3
url: "https://pub.dev"
source: hosted
version: "2.6.2"
logging:
dependency: "direct main"
description:
@ -822,14 +769,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.3.1"
macros:
dependency: transitive
description:
name: macros
sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656"
url: "https://pub.dev"
source: hosted
version: "0.1.3-main.0"
matcher:
dependency: transitive
description:
@ -882,10 +821,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
url: "https://pub.dev"
source: hosted
version: "1.16.0"
version: "1.17.0"
mime:
dependency: transitive
description:
@ -903,6 +842,22 @@ packages:
url: "https://github.com/Dr-Blank/miniplayer.git"
source: git
version: "1.0.3"
mockito:
dependency: transitive
description:
name: mockito
sha256: dac24d461418d363778d53198d9ac0510b9d073869f078450f195766ec48d05e
url: "https://pub.dev"
source: hosted
version: "5.6.1"
node_preamble:
dependency: transitive
description:
name: node_preamble
sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db"
url: "https://pub.dev"
source: hosted
version: "2.0.2"
numberpicker:
dependency: "direct main"
description:
@ -1107,42 +1062,34 @@ packages:
dependency: transitive
description:
name: riverpod
sha256: "59062512288d3056b2321804332a13ffdd1bf16df70dcc8e506e411280a72959"
sha256: "16ff608d21e8ea64364f2b7c049c94a02ab81668f78845862b6e88b71dd4935a"
url: "https://pub.dev"
source: hosted
version: "2.6.1"
version: "3.1.0"
riverpod_analyzer_utils:
dependency: transitive
description:
name: riverpod_analyzer_utils
sha256: c6b8222b2b483cb87ae77ad147d6408f400c64f060df7a225b127f4afef4f8c8
sha256: "947b05d04c52a546a2ac6b19ef2a54b08520ff6bdf9f23d67957a4c8df1c3bc0"
url: "https://pub.dev"
source: hosted
version: "0.5.8"
version: "1.0.0-dev.8"
riverpod_annotation:
dependency: "direct main"
description:
name: riverpod_annotation
sha256: e14b0bf45b71326654e2705d462f21b958f987087be850afd60578fcd502d1b8
sha256: cc1474bc2df55ec3c1da1989d139dcef22cd5e2bd78da382e867a69a8eca2e46
url: "https://pub.dev"
source: hosted
version: "2.6.1"
version: "4.0.0"
riverpod_generator:
dependency: "direct dev"
description:
name: riverpod_generator
sha256: "63546d70952015f0981361636bf8f356d9cfd9d7f6f0815e3c07789a41233188"
sha256: e43b1537229cc8f487f09b0c20d15dba840acbadcf5fc6dad7ad5e8ab75950dc
url: "https://pub.dev"
source: hosted
version: "2.6.3"
riverpod_lint:
dependency: "direct dev"
description:
name: riverpod_lint
sha256: "83e4caa337a9840469b7b9bd8c2351ce85abad80f570d84146911b32086fbd99"
url: "https://pub.dev"
source: hosted
version: "2.6.3"
version: "4.0.0+1"
rxdart:
dependency: transitive
description:
@ -1207,6 +1154,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.4.2"
shelf_packages_handler:
dependency: transitive
description:
name: shelf_packages_handler
sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
shelf_static:
dependency: transitive
description:
name: shelf_static
sha256: c87c3875f91262785dade62d135760c2c69cb217ac759485334c5857ad89f6e3
url: "https://pub.dev"
source: hosted
version: "1.1.3"
shelf_web_socket:
dependency: transitive
description:
@ -1255,18 +1218,34 @@ packages:
dependency: transitive
description:
name: source_gen
sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832"
sha256: "07b277b67e0096c45196cbddddf2d8c6ffc49342e88bf31d460ce04605ddac75"
url: "https://pub.dev"
source: hosted
version: "1.5.0"
version: "4.1.1"
source_helper:
dependency: transitive
description:
name: source_helper
sha256: "86d247119aedce8e63f4751bd9626fc9613255935558447569ad42f9f5b48b3c"
sha256: "6a3c6cc82073a8797f8c4dc4572146114a39652851c157db37e964d9c7038723"
url: "https://pub.dev"
source: hosted
version: "1.3.5"
version: "1.3.8"
source_map_stack_trace:
dependency: transitive
description:
name: source_map_stack_trace
sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b
url: "https://pub.dev"
source: hosted
version: "2.1.2"
source_maps:
dependency: transitive
description:
name: source_maps
sha256: "190222579a448b03896e0ca6eca5998fa810fda630c1d65e2f78b3f638f54812"
url: "https://pub.dev"
source: hosted
version: "0.10.13"
source_span:
dependency: transitive
description:
@ -1379,22 +1358,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.2.2"
test:
dependency: transitive
description:
name: test
sha256: "75906bf273541b676716d1ca7627a17e4c4070a3a16272b7a3dc7da3b9f3f6b7"
url: "https://pub.dev"
source: hosted
version: "1.26.3"
test_api:
dependency: transitive
description:
name: test_api
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
url: "https://pub.dev"
source: hosted
version: "0.7.4"
timing:
version: "0.7.7"
test_core:
dependency: transitive
description:
name: timing
sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe"
name: test_core
sha256: "0cc24b5ff94b38d2ae73e1eb43cc302b77964fbf67abad1e296025b78deb53d0"
url: "https://pub.dev"
source: hosted
version: "1.0.2"
version: "0.6.12"
typed_data:
dependency: transitive
description:
@ -1495,10 +1482,10 @@ packages:
dependency: transitive
description:
name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
url: "https://pub.dev"
source: hosted
version: "2.1.4"
version: "2.2.0"
vibration:
dependency: "direct main"
description:
@ -1555,6 +1542,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.3"
webkit_inspection_protocol:
dependency: transitive
description:
name: webkit_inspection_protocol
sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572"
url: "https://pub.dev"
source: hosted
version: "1.2.1"
win32:
dependency: transitive
description:
@ -1596,5 +1591,5 @@ packages:
source: hosted
version: "3.1.3"
sdks:
dart: ">=3.7.0 <4.0.0"
flutter: ">=3.32.8"
dart: ">=3.10.0 <4.0.0"
flutter: "3.38.6"

View file

@ -19,8 +19,8 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 0.0.18+9
environment:
sdk: ">=3.3.4 <4.0.0"
flutter: 3.32.8
sdk: ">=3.10.0 <4.0.0"
flutter: 3.38.6
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
@ -53,12 +53,12 @@ dependencies:
flutter_hooks: ^0.21.2
flutter_settings_ui: ^3.0.1
font_awesome_flutter: ^10.7.0
freezed_annotation: ^2.4.1
freezed_annotation: ^3.1.0
go_router: ^14.0.2
hive: ^4.0.0-dev.2
hooks_riverpod: ^2.5.1
isar: ^4.0.0-dev.13
isar_flutter_libs: ^4.0.0-dev.13
hive_plus_secure: ^1.1.25
hooks_riverpod: ^3.0.0
isar_plus: ^1.1.0
isar_plus_flutter_libs: ^1.1.0
json_annotation: ^4.9.0
just_audio: ^0.9.37
just_audio_background:
@ -85,7 +85,7 @@ dependencies:
path: ^1.9.0
path_provider: ^2.1.0
permission_handler: ^11.3.1
riverpod_annotation: ^2.3.5
riverpod_annotation: 4.0.0
scroll_loop_auto_scroll: ^0.0.5
sensors_plus: ^6.0.1
share_plus: ^10.0.2
@ -96,14 +96,13 @@ dependencies:
vibration: ^3.1.3
dev_dependencies:
build_runner: ^2.4.9
custom_lint: ^0.7.0
# custom_lint: ^0.8.1
flutter_lints: ^5.0.0
flutter_test:
sdk: flutter
freezed: ^2.5.2
freezed: ^3.1.0
json_serializable: ^6.8.0
riverpod_generator: ^2.4.2
riverpod_lint: ^2.3.10
riverpod_generator: ^4.0.0+1
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

@ -1 +1 @@
Subproject commit e1848a42c27257146015a33e9427f197f522fe03
Subproject commit 34b2b98a90e3851f50f9657b1ff5bae5f385dbf9

View file

@ -7,7 +7,7 @@
#include "generated_plugin_registrant.h"
#include <dynamic_color/dynamic_color_plugin_c_api.h>
#include <isar_flutter_libs/isar_flutter_libs_plugin.h>
#include <isar_plus_flutter_libs/isar_plus_flutter_libs_plugin.h>
#include <media_kit_libs_windows_audio/media_kit_libs_windows_audio_plugin_c_api.h>
#include <permission_handler_windows/permission_handler_windows_plugin.h>
#include <share_plus/share_plus_windows_plugin_c_api.h>
@ -16,8 +16,8 @@
void RegisterPlugins(flutter::PluginRegistry* registry) {
DynamicColorPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("DynamicColorPluginCApi"));
IsarFlutterLibsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("IsarFlutterLibsPlugin"));
IsarPlusFlutterLibsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("IsarPlusFlutterLibsPlugin"));
MediaKitLibsWindowsAudioPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("MediaKitLibsWindowsAudioPluginCApi"));
PermissionHandlerWindowsPluginRegisterWithRegistrar(

View file

@ -4,7 +4,7 @@
list(APPEND FLUTTER_PLUGIN_LIST
dynamic_color
isar_flutter_libs
isar_plus_flutter_libs
media_kit_libs_windows_audio
permission_handler_windows
share_plus