Renamed variable

This commit is contained in:
PartyDonut 2025-07-28 22:00:21 +02:00
parent 2f83f03442
commit 0bdf123d15
5 changed files with 10 additions and 10 deletions

View file

@ -64,7 +64,7 @@ class LibMDK extends BasePlayer {
null; null;
@override @override
Widget? subtitles(bool showOverlay, {GlobalKey? menuKey}) => null; Widget? subtitles(bool showOverlay, {GlobalKey? controlsKey}) => null;
@override @override
Future<void> setVolume(double volume) async {} Future<void> setVolume(double volume) async {}

View file

@ -40,7 +40,7 @@ class MediaControlsWrapper extends BaseAudioHandler {
PlayerState? get lastState => _player?.lastState; PlayerState? get lastState => _player?.lastState;
Widget? subtitleWidget(bool showOverlay, {GlobalKey? controlsKey}) => Widget? subtitleWidget(bool showOverlay, {GlobalKey? controlsKey}) =>
_player?.subtitles(showOverlay, menuKey: controlsKey); _player?.subtitles(showOverlay, controlsKey: controlsKey);
Widget? videoWidget(Key key, BoxFit fit) => _player?.videoWidget(key, fit); Widget? videoWidget(Key key, BoxFit fit) => _player?.videoWidget(key, fit);
final Ref ref; final Ref ref;

View file

@ -20,7 +20,7 @@ abstract class BasePlayer {
); );
Widget? subtitles( Widget? subtitles(
bool showOverlay, { bool showOverlay, {
GlobalKey? menuKey, GlobalKey? controlsKey,
}); });
Future<void> dispose(); Future<void> dispose();
Future<void> open(String url, bool play); Future<void> open(String url, bool play);

View file

@ -191,7 +191,7 @@ class LibMDK extends BasePlayer {
); );
@override @override
Widget? subtitles(bool showOverlay, {GlobalKey? menuKey}) => null; Widget? subtitles(bool showOverlay, {GlobalKey? controlsKey}) => null;
@override @override
Future<void> setVolume(double volume) async => _controller?.setVolume(volume / 100); Future<void> setVolume(double volume) async => _controller?.setVolume(volume / 100);

View file

@ -168,13 +168,13 @@ class LibMPV extends BasePlayer {
@override @override
Widget? subtitles( Widget? subtitles(
bool showOverlay, { bool showOverlay, {
GlobalKey? menuKey, GlobalKey? controlsKey,
}) => }) =>
_controller != null _controller != null
? _VideoSubtitles( ? _VideoSubtitles(
controller: _controller!, controller: _controller!,
showOverlay: showOverlay, showOverlay: showOverlay,
menuKey: menuKey, controlsKey: controlsKey,
) )
: null; : null;
@ -198,12 +198,12 @@ class LibMPV extends BasePlayer {
class _VideoSubtitles extends ConsumerStatefulWidget { class _VideoSubtitles extends ConsumerStatefulWidget {
final VideoController controller; final VideoController controller;
final bool showOverlay; final bool showOverlay;
final GlobalKey? menuKey; final GlobalKey? controlsKey;
const _VideoSubtitles({ const _VideoSubtitles({
required this.controller, required this.controller,
this.showOverlay = false, this.showOverlay = false,
this.menuKey, this.controlsKey,
}); });
@override @override
@ -275,9 +275,9 @@ class _VideoSubtitlesState extends ConsumerState<_VideoSubtitles> {
void _measureMenuHeight() { void _measureMenuHeight() {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (!mounted || widget.menuKey == null) return; if (!mounted || widget.controlsKey == null) return;
final RenderBox? renderBox = widget.menuKey?.currentContext?.findRenderObject() as RenderBox?; final RenderBox? renderBox = widget.controlsKey?.currentContext?.findRenderObject() as RenderBox?;
final newHeight = renderBox?.size.height; final newHeight = renderBox?.size.height;
if (newHeight != _cachedMenuHeight && newHeight != null) { if (newHeight != _cachedMenuHeight && newHeight != null) {