Skip to content

Commit 6260481

Browse files
committed
added constant defaultTimer
1 parent 0f44ca9 commit 6260481

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

lib/src/chewie_player.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ class ChewieController extends ChangeNotifier {
280280
this.systemOverlaysAfterFullScreen = SystemUiOverlay.values,
281281
this.deviceOrientationsAfterFullScreen = DeviceOrientation.values,
282282
this.routePageBuilder,
283-
this.hideControlsTimer = const Duration(seconds: 3),
283+
this.hideControlsTimer = defaultTimer,
284284
}) : assert(
285285
playbackSpeeds.every((speed) => speed > 0),
286286
'The playbackSpeeds values must all be greater than 0',
@@ -380,6 +380,8 @@ class ChewieController extends ChangeNotifier {
380380
);
381381
}
382382

383+
static const defaultTimer = Duration(seconds: 3);
384+
383385
/// If false, the options button in MaterialUI and MaterialDesktopUI
384386
/// won't be shown.
385387
final bool showOptions;

lib/src/cupertino/cupertino_controls.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ class _CupertinoControlsState extends State<CupertinoControls>
760760

761761
void _startHideTimer() {
762762
final hideControlsTimer = chewieController.hideControlsTimer.isNegative
763-
? const Duration(seconds: 3)
763+
? ChewieController.defaultTimer
764764
: chewieController.hideControlsTimer;
765765
_hideTimer = Timer(hideControlsTimer, () {
766766
setState(() {

lib/src/material/material_controls.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ class _MaterialControlsState extends State<MaterialControls>
541541

542542
void _startHideTimer() {
543543
final hideControlsTimer = chewieController.hideControlsTimer.isNegative
544-
? const Duration(seconds: 3)
544+
? ChewieController.defaultTimer
545545
: chewieController.hideControlsTimer;
546546
_hideTimer = Timer(hideControlsTimer, () {
547547
setState(() {

lib/src/material/material_desktop_controls.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls>
521521

522522
void _startHideTimer() {
523523
final hideControlsTimer = chewieController.hideControlsTimer.isNegative
524-
? const Duration(seconds: 3)
524+
? ChewieController.defaultTimer
525525
: chewieController.hideControlsTimer;
526526
_hideTimer = Timer(hideControlsTimer, () {
527527
setState(() {

0 commit comments

Comments
 (0)