mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-02-16 14:29:35 +00:00
123
This commit is contained in:
parent
178f3fbdb1
commit
634ffaed8c
27 changed files with 648 additions and 1012 deletions
|
|
@ -1,8 +1,8 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_animate/flutter_animate.dart';
|
||||
import 'package:just_audio/just_audio.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:vaani/features/player/core/abs_audio_player.dart';
|
||||
|
||||
/// this timer pauses the music player after a certain duration
|
||||
///
|
||||
|
|
@ -32,7 +32,7 @@ class SleepTimer {
|
|||
}
|
||||
|
||||
/// The player to be paused
|
||||
final AbsAudioPlayer player;
|
||||
final AudioPlayer player;
|
||||
|
||||
/// The timer that will pause the player
|
||||
Timer? timer;
|
||||
|
|
@ -50,8 +50,8 @@ class SleepTimer {
|
|||
SleepTimer({required duration, required this.player}) : _duration = duration {
|
||||
_subscriptions.add(
|
||||
player.playerStateStream.listen((event) {
|
||||
if (event.processingState == AbsProcessingState.completed ||
|
||||
event.processingState == AbsProcessingState.idle) {
|
||||
if (event.processingState == ProcessingState.completed ||
|
||||
event.processingState == ProcessingState.idle) {
|
||||
clearCountDownTimer();
|
||||
}
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class SleepTimer extends _$SleepTimer {
|
|||
|
||||
var sleepTimer = core.SleepTimer(
|
||||
duration: sleepTimerSettings.defaultDuration,
|
||||
player: ref.watch(absPlayerProvider),
|
||||
player: ref.watch(simpleAudioPlayerProvider),
|
||||
);
|
||||
ref.onDispose(sleepTimer.dispose);
|
||||
return sleepTimer;
|
||||
|
|
@ -45,7 +45,7 @@ class SleepTimer extends _$SleepTimer {
|
|||
} else {
|
||||
final timer = core.SleepTimer(
|
||||
duration: resultingDuration,
|
||||
player: ref.watch(absPlayerProvider),
|
||||
player: ref.watch(simpleAudioPlayerProvider),
|
||||
);
|
||||
ref.onDispose(timer.dispose);
|
||||
state = timer;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ part of 'sleep_timer_provider.dart';
|
|||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$sleepTimerHash() => r'417759e07a45e69af93bd9a1c78ac859d9abcf4b';
|
||||
String _$sleepTimerHash() => r'7cac4509d8bd40c4d418c295d5b37c66492e7de9';
|
||||
|
||||
/// See also [SleepTimer].
|
||||
@ProviderFor(SleepTimer)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue