mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2025-12-15 15:39:29 +00:00
intercept back button to minimize player first
and also navigate stack of branches like youtube
This commit is contained in:
parent
ed236ef117
commit
402e264137
4 changed files with 106 additions and 68 deletions
|
|
@ -58,10 +58,4 @@ double playerHeight(
|
|||
return playerExpandProgress.value;
|
||||
}
|
||||
|
||||
// a final MiniplayerController controller = MiniplayerController();
|
||||
@Riverpod(keepAlive: true)
|
||||
Raw<MiniplayerController> miniplayerController(
|
||||
MiniplayerControllerRef ref,
|
||||
) {
|
||||
return MiniplayerController();
|
||||
}
|
||||
final audioBookMiniplayerController = MiniplayerController();
|
||||
|
|
|
|||
|
|
@ -38,22 +38,5 @@ final playerHeightProvider = Provider<double>.internal(
|
|||
);
|
||||
|
||||
typedef PlayerHeightRef = ProviderRef<double>;
|
||||
String _$miniplayerControllerHash() =>
|
||||
r'a3677e63a9823881f45a12855e74bf558322e0ec';
|
||||
|
||||
/// See also [miniplayerController].
|
||||
@ProviderFor(miniplayerController)
|
||||
final miniplayerControllerProvider =
|
||||
Provider<Raw<MiniplayerController>>.internal(
|
||||
miniplayerController,
|
||||
name: r'miniplayerControllerProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$miniplayerControllerHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef MiniplayerControllerRef = ProviderRef<Raw<MiniplayerController>>;
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class AudiobookPlayer extends HookConsumerWidget {
|
|||
minHeight: playerMinHeight,
|
||||
// subtract the height of notches and other system UI
|
||||
maxHeight: playerMaxHeight,
|
||||
controller: ref.watch(miniplayerControllerProvider),
|
||||
controller: audioBookMiniplayerController,
|
||||
elevation: 4,
|
||||
onDismissed: () {
|
||||
// add a delay before closing the player
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue