Skip to content

Commit

Permalink
End playback
Browse files Browse the repository at this point in the history
  • Loading branch information
arianneorpilla committed Apr 23, 2021
1 parent f3ec92f commit 19aa64b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,11 @@ class _VideoPlayerState extends State<VideoPlayer> {
}

Future<bool> _onWillPop() async {
if (getVideoPlayerController().value.isEnded) {
Navigator.pop(context);
return false;
}

Widget alertDialog = AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.zero,
Expand Down Expand Up @@ -938,8 +943,10 @@ class _VideoPlayerState extends State<VideoPlayer> {
Text(results[selectedIndex.value].reading),
Flexible(
child: SingleChildScrollView(
child:
Text("\n${results[selectedIndex.value].meaning}\n"),
child: gCustomDictionary.isNotEmpty
? SelectableText(
"\n${results[selectedIndex.value].meaning}\n")
: Text("\n${results[selectedIndex.value].meaning}\n"),
),
),
Row(
Expand Down

0 comments on commit 19aa64b

Please sign in to comment.