We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8b11166 commit a4d847bCopy full SHA for a4d847b
lib/src/chewie_player.dart
@@ -104,10 +104,19 @@ class ChewieState extends State<Chewie> {
104
) {
105
return Scaffold(
106
resizeToAvoidBottomInset: false,
107
- body: Container(
108
- alignment: Alignment.center,
109
- color: Colors.black,
110
- child: controllerProvider,
+ body: GestureDetector(
+ onVerticalDragEnd: (DragEndDetails details) {
+ // A positive dy indicates a downward swipe. Use a threshold to avoid accidental triggers.
+ final double dy = details.primaryVelocity ?? 0;
111
+ if (dy > 300) {
112
+ widget.controller.exitFullScreen();
113
+ }
114
+ },
115
+ child: Container(
116
+ alignment: Alignment.center,
117
+ color: Colors.black,
118
+ child: controllerProvider,
119
+ ),
120
),
121
);
122
}
0 commit comments