i'm implementing custom controls widget, it worked fine but the problem is that the custom controls are stuck on screen (always visible), unlike the default material or cupertino controls which visibility can be toggled.
this is my player:
`
BetterPlayerController? _betterPlayerController;
i'm implementing custom controls widget, it worked fine but the problem is that the custom controls are stuck on screen (always visible), unlike the default material or cupertino controls which visibility can be toggled.
this is my player: ` BetterPlayerController? _betterPlayerController;
@override void initState() { _betterPlayerController = BetterPlayerController( BetterPlayerConfiguration( controlsConfiguration: BetterPlayerControlsConfiguration( playerTheme: BetterPlayerTheme.custom, customControlsBuilder: (controller, onControlsVisibilityChanged) => // I believe onControlsVisibilityChanged is responsible for visibility toggle CustomControlsWidget( controller: controller, onControlsVisibilityChanged: onControlsVisibilityChanged), ), ), //dataSource etc... );
}
@override Widget build(BuildContext context) { final provider = Provider.of(context);
final seriesVideo = provider.seriesVideo;
final mediaQuery = MediaQuery.sizeOf(context);
print(mediaQuery.width);
}
`
this is my custom controls widget:
`class CustomControlsWidget extends StatefulWidget { final BetterPlayerController? controller; final Function(bool visbility)? onControlsVisibilityChanged;
const CustomControlsWidget( {super.key, this.controller, this.onControlsVisibilityChanged});
@override State createState() => _CustomControlsWidgetState();
}
class _CustomControlsWidgetState extends State {
@override Widget build(BuildContext context) { widget.onControlsVisibilityChanged;
} } ` this is player screen: