chewie
chewie copied to clipboard
How can I hide options on tap ?
Hi I have created download option in chewie and I want to close option's window after tap on download . Anyone can help me ? thanks
void _createChewieController() {
_chewieController = ChewieController(
videoPlayerController: _videoPlayerController,
autoPlay: true,
additionalOptions: (context) {
return <OptionItem>[
OptionItem(
onTap: () async {},
iconData: Icons.download,
title: 'Download',
),
];
},
);
}
Hi @mmshahshahani,
I also faced this issue and when I used Navigator.pop(context) it always popped my entire route from the navigator and not just the modal. (using go_router).
I could change the behavior by setting the option useRootNavigator: false on the ChewieController.
e.g.:
ChewieController(
videoPlayerController: videoPlayerController,
useRootNavigator: false,
additionalOptions: (context) {
return [
OptionItem(
onTap: () {
Navigator.pop(context);
},
),
];
},
);