mirror of
https://github.com/stonega/tsacdop
synced 2025-02-10 00:20:49 +01:00
Fixed get player height issue.
This commit is contained in:
parent
4241af7ec8
commit
6bc0d3620c
@ -219,11 +219,12 @@ class PlayerWidget extends StatelessWidget {
|
||||
return Selector<AudioPlayerNotifier, Tuple2<bool, PlayerHeight>>(
|
||||
selector: (_, audio) => Tuple2(audio.playerRunning, audio?.playerHeight),
|
||||
builder: (_, data, __) {
|
||||
if (!data.item1) {
|
||||
return Center();
|
||||
} else {
|
||||
var minHeight = kMinPlayerHeight[data.item2.index];
|
||||
var maxHeight = kMaxPlayerHeight[data.item2.index];
|
||||
return !data.item1
|
||||
? Center()
|
||||
: AudioPanel(
|
||||
return AudioPanel(
|
||||
minHeight: minHeight,
|
||||
maxHeight: maxHeight,
|
||||
key: playerKey,
|
||||
@ -237,6 +238,7 @@ class PlayerWidget extends StatelessWidget {
|
||||
playerKey.currentState.backToMini();
|
||||
},
|
||||
));
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -208,12 +208,12 @@ class AudioPlayerNotifier extends ChangeNotifier {
|
||||
}
|
||||
|
||||
@override
|
||||
void addListener(VoidCallback listener) async {
|
||||
await _getPlayerHeight();
|
||||
void addListener(VoidCallback listener) {
|
||||
super.addListener(listener);
|
||||
_getPlayerHeight();
|
||||
_queueUpdate = false;
|
||||
await _getAutoSleepTimer();
|
||||
await AudioService.connect();
|
||||
_getAutoSleepTimer();
|
||||
AudioService.connect();
|
||||
var running = AudioService.running;
|
||||
if (running) {}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user