Skip to content

Commit c80092e

Browse files
committed
Absorb pointer when controls are hidden
1 parent f574ee2 commit c80092e

File tree

4 files changed

+44
-24
lines changed

4 files changed

+44
-24
lines changed

CHANGELOG.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 0.9.3
4+
5+
* Absorb pointer when controls are hidden
6+
37
## 0.9.2
48

59
* Add options to define system overlays after exiting full screen
@@ -16,7 +20,7 @@
1620

1721
## 0.8.0
1822

19-
* Update to work with `video_player: ">=0.7.0 <0.8.0` - Thanks @Sub6Resources
23+
* Update to work with `video_player: ">=0.7.0 <0.8.0` - Thanks @Sub6Resources
2024
* Preserves AspectRatio on FullScreen - Thanks @patrickb
2125
* Ability to start video in FullScreen - Thanks @miguelpruivo
2226

@@ -49,7 +53,7 @@
4953
* Update to work with `video_player: ">=0.2.0 <0.3.0`
5054
* Add `showControls` option. You can use this to show / hide the controls
5155
* Move from `VideoProgressColors` to `ChewieProgressColors` for customization of the Chewie progress controls
52-
* Remove `progressColors` in favor of platform-specific customizations: `cupertinoProgressColors` and `materialProgressColors` to control
56+
* Remove `progressColors` in favor of platform-specific customizations: `cupertinoProgressColors` and `materialProgressColors` to control
5357
* Add analysis options
5458

5559
## 0.2.0
@@ -58,7 +62,7 @@
5862

5963
## 0.1.1
6064

61-
* Fix images in docs for pub
65+
* Fix images in docs for pub
6266

6367
## 0.1.0
6468

lib/src/cupertino_controls.dart

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,20 @@ class _CupertinoControlsState extends State<CupertinoControls> {
4848
final barHeight = orientation == Orientation.portrait ? 30.0 : 47.0;
4949
final buttonPadding = orientation == Orientation.portrait ? 16.0 : 24.0;
5050

51-
return Column(
52-
children: <Widget>[
53-
_buildTopBar(backgroundColor, iconColor, barHeight, buttonPadding),
54-
_buildHitArea(),
55-
_buildBottomBar(backgroundColor, iconColor, barHeight),
56-
],
51+
return GestureDetector(
52+
onTap: () {
53+
_cancelAndRestartTimer();
54+
},
55+
child: AbsorbPointer(
56+
absorbing: _hideStuff,
57+
child: Column(
58+
children: <Widget>[
59+
_buildTopBar(backgroundColor, iconColor, barHeight, buttonPadding),
60+
_buildHitArea(),
61+
_buildBottomBar(backgroundColor, iconColor, barHeight),
62+
],
63+
),
64+
),
5765
);
5866
}
5967

lib/src/material_controls.dart

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,28 @@ class _MaterialControlsState extends State<MaterialControls> {
3333

3434
@override
3535
Widget build(BuildContext context) {
36-
return Column(
37-
children: <Widget>[
38-
_latestValue != null &&
39-
!_latestValue.isPlaying &&
40-
_latestValue.duration == null ||
41-
_latestValue.isBuffering
42-
? Expanded(
43-
child: Center(
44-
child: CircularProgressIndicator(),
45-
),
46-
)
47-
: _buildHitArea(),
48-
_buildBottomBar(context),
49-
],
36+
return GestureDetector(
37+
onTap: () {
38+
_cancelAndRestartTimer();
39+
},
40+
child: AbsorbPointer(
41+
absorbing: _hideStuff,
42+
child: Column(
43+
children: <Widget>[
44+
_latestValue != null &&
45+
!_latestValue.isPlaying &&
46+
_latestValue.duration == null ||
47+
_latestValue.isBuffering
48+
? Expanded(
49+
child: Center(
50+
child: CircularProgressIndicator(),
51+
),
52+
)
53+
: _buildHitArea(),
54+
_buildBottomBar(context),
55+
],
56+
),
57+
),
5058
);
5159
}
5260

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: chewie
22
description: A video player for Flutter with Cupertino and Material play controls
3-
version: 0.9.2
3+
version: 0.9.3
44
homepage: https://github.com/brianegan/chewie
55
authors:
66
- Brian Egan <[email protected]>

0 commit comments

Comments
 (0)