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