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

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,