From 49051fde0ca63ecdd4269cfc63f9b6f79c4ce72c Mon Sep 17 00:00:00 2001 From: creativecreatorormaybenot <19204050+creativecreatorormaybenot@users.noreply.github.com> Date: Fri, 4 Oct 2019 18:06:58 +0000 Subject: [PATCH 1/2] Initial --- CHANGELOG.md | 4 ++++ lib/src/chewie_player.dart | 11 +++++------ lib/src/cupertino_controls.dart | 3 ++- pubspec.yaml | 5 +++-- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e74a52430..0871fc0f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.10.0 + +* Changed wakelock plugin from `flutter_screen` to `wakelock` due to lack of maintenance of `flutter_screen`. + ## 0.9.8+1 * Require latest flutter stable version diff --git a/lib/src/chewie_player.dart b/lib/src/chewie_player.dart index 7492b2d5d..ecd550cfb 100644 --- a/lib/src/chewie_player.dart +++ b/lib/src/chewie_player.dart @@ -5,8 +5,8 @@ import 'package:chewie/src/player_with_controls.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; -import 'package:screen/screen.dart'; import 'package:video_player/video_player.dart'; +import 'package:wakelock/wakelock.dart'; typedef Widget ChewieRoutePageBuilder( BuildContext context, @@ -136,17 +136,16 @@ class ChewieState extends State { } if (!widget.controller.allowedScreenSleep) { - Screen.keepOn(true); + Wakelock.enable(); } await Navigator.of(context).push(route); _isFullScreen = false; widget.controller.exitFullScreen(); - bool isKeptOn = await Screen.isKeptOn; - if (isKeptOn) { - Screen.keepOn(false); - } + // The wakelock plugins checks whether it needs to perform an action internally, + // so we do not need to check Wakelock.isEnabled. + Wakelock.disable(); SystemChrome.setEnabledSystemUIOverlays( widget.controller.systemOverlaysAfterFullScreen); diff --git a/lib/src/cupertino_controls.dart b/lib/src/cupertino_controls.dart index 4d4d38cd6..522dfd626 100644 --- a/lib/src/cupertino_controls.dart +++ b/lib/src/cupertino_controls.dart @@ -77,7 +77,8 @@ class _CupertinoControlsState extends State { absorbing: _hideStuff, child: Column( children: [ - _buildTopBar(backgroundColor, iconColor, barHeight, buttonPadding), + _buildTopBar( + backgroundColor, iconColor, barHeight, buttonPadding), _buildHitArea(), _buildBottomBar(backgroundColor, iconColor, barHeight), ], diff --git a/pubspec.yaml b/pubspec.yaml index 4ae616fa5..c0df79dc9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: chewie description: A video player for Flutter with Cupertino and Material play controls -version: 0.9.8+1 +version: 0.9.8+2 homepage: https://github.com/brianegan/chewie authors: - Brian Egan @@ -13,7 +13,8 @@ environment: dependencies: open_iconic_flutter: ">=0.3.0 <0.4.0" video_player: ">=0.7.0 <0.11.0" - screen: ">=0.0.4 <0.1.0" + wakelock: ">0.1.2 <0.2.0" + flutter: sdk: flutter From cd9dd9b23da360bbf62812ff3aeaee1c4c980e30 Mon Sep 17 00:00:00 2001 From: creativecreatorormaybenot <19204050+creativecreatorormaybenot@users.noreply.github.com> Date: Fri, 4 Oct 2019 18:15:29 +0000 Subject: [PATCH 2/2] Constraints --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index c0df79dc9..fccef4046 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -13,7 +13,7 @@ environment: dependencies: open_iconic_flutter: ">=0.3.0 <0.4.0" video_player: ">=0.7.0 <0.11.0" - wakelock: ">0.1.2 <0.2.0" + wakelock: ">=0.1.2 <0.2.0" flutter: sdk: flutter