From 1667ee6a62956f30ee31746750c75579c0691e7d Mon Sep 17 00:00:00 2001 From: afrah-tezda Date: Thu, 12 Sep 2024 20:06:51 +0530 Subject: [PATCH] wakelock fixed --- lib/src/core/better_player.dart | 9 +- pubspec.lock | 208 +++++++++++++++++--------------- pubspec.yaml | 2 +- 3 files changed, 114 insertions(+), 105 deletions(-) diff --git a/lib/src/core/better_player.dart b/lib/src/core/better_player.dart index 5396a95..8603784 100644 --- a/lib/src/core/better_player.dart +++ b/lib/src/core/better_player.dart @@ -6,7 +6,8 @@ import 'package:better_player/src/core/better_player_with_controls.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:visibility_detector/visibility_detector.dart'; -import 'package:wakelock/wakelock.dart'; +import 'package:wakelock_plus/wakelock_plus.dart'; + ///Widget which uses provided controller to render video player. class BetterPlayer extends StatefulWidget { @@ -102,7 +103,7 @@ class _BetterPlayerState extends State ///full screen is on, then full screen route must be pop and return to normal ///state. if (_isFullScreen) { - Wakelock.disable(); + WakelockPlus.disable(); _navigatorState.maybePop(); SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: _betterPlayerConfiguration.systemOverlaysAfterFullScreen); @@ -244,7 +245,7 @@ class _BetterPlayerState extends State } if (!_betterPlayerConfiguration.allowedScreenSleep) { - Wakelock.enable(); + WakelockPlus.enable(); } await Navigator.of(context, rootNavigator: true).push(route); @@ -253,7 +254,7 @@ class _BetterPlayerState extends State // The wakelock plugins checks whether it needs to perform an action internally, // so we do not need to check Wakelock.isEnabled. - Wakelock.disable(); + WakelockPlus.disable(); await SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: _betterPlayerConfiguration.systemOverlaysAfterFullScreen); diff --git a/pubspec.lock b/pubspec.lock index da8c753..08c4d2d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,14 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + args: + dependency: transitive + description: + name: args + sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" + url: "https://pub.dev" + source: hosted + version: "2.5.0" async: dependency: transitive description: @@ -45,18 +53,26 @@ packages: dependency: transitive description: name: csslib - sha256: f857285c8dc0b4f2f77b49a1c083ff8c75223a7549de20f3e607df58cf497a43 + sha256: "831883fb353c8bdc1d71979e5b342c7d88acfbc643113c14ae51e2442ea0f20f" url: "https://pub.dev" source: hosted - version: "0.17.0" + version: "0.17.3" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.dev" + source: hosted + version: "1.0.8" + dbus: + dependency: transitive + description: + name: dbus + sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac" url: "https://pub.dev" source: hosted - version: "1.0.5" + version: "0.7.10" fake_async: dependency: transitive description: @@ -69,18 +85,10 @@ packages: dependency: transitive description: name: ffi - sha256: d97fffd9d86f3dccc7a9059128b468a99320c69007cc9d41a3a1bda07d4e86dc + sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" url: "https://pub.dev" source: hosted - version: "1.0.0" - file: - dependency: transitive - description: - name: file - sha256: "9fd2163d866769f60f4df8ac1dc59f52498d810c356fe78022e383dd3c57c0e1" - url: "https://pub.dev" - source: hosted - version: "6.1.0" + version: "2.1.3" flutter: dependency: "direct main" description: flutter @@ -113,34 +121,42 @@ packages: dependency: transitive description: name: fwfh_text_style - sha256: "1ab7f3539c095265bd9a1226555d76d0882936462c1d018efcdc4057ec782f6a" + sha256: "5f8b587fd223a6bf14aad3d3da5e7ced0628becbd0768f8e7ae25ff6b9f3d2ec" url: "https://pub.dev" source: hosted - version: "2.7.2" + version: "2.23.8" html: dependency: transitive description: name: html - sha256: bfef906cbd4e78ef49ae511d9074aebd1d2251482ef601a280973e8b58b51bbf + sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" url: "https://pub.dev" source: hosted - version: "0.15.0" - intl: + version: "0.15.4" + http: dependency: transitive description: - name: intl - sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf + name: http + sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010 url: "https://pub.dev" source: hosted - version: "0.19.0" - js: + version: "1.2.2" + http_parser: dependency: transitive description: - name: js - sha256: a5e201311cb08bf3912ebbe9a2be096e182d703f881136ec1e81a2338a9e120d + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" url: "https://pub.dev" source: hosted - version: "0.6.4" + version: "4.0.2" + intl: + dependency: transitive + description: + name: intl + sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf + url: "https://pub.dev" + source: hosted + version: "0.19.0" leak_tracker: dependency: transitive description: @@ -169,10 +185,10 @@ packages: dependency: "direct dev" description: name: lint - sha256: "5715d702a2c3b493e09ed9e223625f0fc1f75e04167e338133a4cef28b868c1f" + sha256: "4a539aa34ec5721a2c7574ae2ca0336738ea4adc2a34887d54b7596310b33c85" url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.10.0" matcher: dependency: transitive description: @@ -197,6 +213,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.15.0" + package_info_plus: + dependency: transitive + description: + name: package_info_plus + sha256: a75164ade98cb7d24cfd0a13c6408927c6b217fa60dee5a7ff5c116a58f28918 + url: "https://pub.dev" + source: hosted + version: "8.0.2" + package_info_plus_platform_interface: + dependency: transitive + description: + name: package_info_plus_platform_interface + sha256: ac1f4a4847f1ade8e6a87d1f39f5d7c67490738642e2542f559ec38c37489a66 + url: "https://pub.dev" + source: hosted + version: "3.0.1" path: dependency: transitive description: @@ -209,90 +241,74 @@ packages: dependency: "direct main" description: name: path_provider - sha256: "3f6e0d697dc557ed6589107c8c13eda5ad488285917788379bbf392e3e30ea37" + sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378 url: "https://pub.dev" source: hosted - version: "2.0.10" + version: "2.1.4" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: c69109bae02c6116bd8ac81319b13eb73dfae02ef74690d2a1a98c1ddd3aaefc + sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7" url: "https://pub.dev" source: hosted - version: "2.0.11" - path_provider_ios: + version: "2.2.10" + path_provider_foundation: dependency: transitive description: - name: path_provider_ios - sha256: "038d0141ff5d08c60ed071eee2758b68c50c42a1c10066a1fb6c28ab32fac84c" + name: path_provider_foundation + sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16 url: "https://pub.dev" source: hosted - version: "2.0.7" + version: "2.4.0" path_provider_linux: dependency: transitive description: name: path_provider_linux - sha256: "368c48aec7d1eee5412145ebda483e0ae646f7bcfc11366e13898e359ec0593f" + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 url: "https://pub.dev" source: hosted - version: "2.1.2" - path_provider_macos: - dependency: transitive - description: - name: path_provider_macos - sha256: eb58b896ea3a504f0b0fa7870646bda6935a6f752b2a54df33f97070dacca8d4 - url: "https://pub.dev" - source: hosted - version: "2.0.0" + version: "2.2.1" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - sha256: c2af5a8a6369992d915f8933dfc23172071001359d17896e83db8be57db8a397 + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.1.2" path_provider_windows: dependency: transitive description: name: path_provider_windows - sha256: "74056f334c58bd6db429ba93164e872a1996c8196b3132a100c40924b2672abf" + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 url: "https://pub.dev" source: hosted - version: "2.0.4" + version: "2.3.0" petitparser: dependency: transitive description: name: petitparser - sha256: "2ebb289dc4764ec397f5cd3ca9881c6d17196130a7d646ed022a0dd9c2e25a71" + sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "6.0.2" platform: dependency: transitive description: name: platform - sha256: ebc79f16b5f6b609aad4a5e63447d4795d16f7adee46e93ed03200848c006735 + sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.1.5" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - sha256: c2c49e16d42fd6983eb55e44b7f197fdf16b4da7aab7f8e1d21da307cad3fb02 - url: "https://pub.dev" - source: hosted - version: "2.0.0" - process: - dependency: transitive - description: - name: process - sha256: c7b9f7d8a6ee4407ab4f8a7d4a951f8f5659c40df14c0924e2e97c32372e9b14 + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "2.1.8" sky_engine: dependency: transitive description: flutter @@ -346,6 +362,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.7.2" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" vector_math: dependency: transitive description: @@ -370,70 +394,54 @@ packages: url: "https://pub.dev" source: hosted version: "14.2.5" - wakelock: + wakelock_plus: dependency: "direct main" description: - name: wakelock - sha256: b18a1a7b1ec71b1a9105766e06a73a2411e3eb5564bc569d99df92b57530bb4b + name: wakelock_plus + sha256: bf4ee6f17a2fa373ed3753ad0e602b7603f8c75af006d5b9bdade263928c0484 url: "https://pub.dev" source: hosted - version: "0.6.1+2" - wakelock_macos: + version: "1.2.8" + wakelock_plus_platform_interface: dependency: transitive description: - name: wakelock_macos - sha256: "047c6be2f88cb6b76d02553bca5a3a3b95323b15d30867eca53a19a0a319d4cd" + name: wakelock_plus_platform_interface + sha256: "422d1cdbb448079a8a62a5a770b69baa489f8f7ca21aef47800c726d404f9d16" url: "https://pub.dev" source: hosted - version: "0.4.0" - wakelock_platform_interface: - dependency: transitive - description: - name: wakelock_platform_interface - sha256: "1f4aeb81fb592b863da83d2d0f7b8196067451e4df91046c26b54a403f9de621" - url: "https://pub.dev" - source: hosted - version: "0.3.0" - wakelock_web: - dependency: transitive - description: - name: wakelock_web - sha256: "1b256b811ee3f0834888efddfe03da8d18d0819317f20f6193e2922b41a501b5" - url: "https://pub.dev" - source: hosted - version: "0.4.0" - wakelock_windows: + version: "1.2.1" + web: dependency: transitive description: - name: wakelock_windows - sha256: "108b1b73711f1664ee462e73af34a9286ff496e27d4d8371e2fb4da8fde4cdac" + name: web + sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062 url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "1.0.0" win32: dependency: transitive description: name: win32 - sha256: c6a3f4e4058b70b46e27b2935de2d1562c50680e7fb44833911d981db73826c2 + sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a" url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "5.5.4" xdg_directories: dependency: transitive description: name: xdg_directories - sha256: "0186b3f2d66be9a12b0295bddcf8b6f8c0b0cc2f85c6287344e2a6366bc28457" + sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "1.0.4" xml: dependency: "direct main" description: name: xml - sha256: ac0e3f4bf00ba2708c33fbabbbe766300e509f8c82dbd4ab6525039813f7e2fb + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 url: "https://pub.dev" source: hosted - version: "6.1.0" + version: "6.5.0" sdks: - dart: ">=3.3.0 <4.0.0" - flutter: ">=3.18.0-18.0.pre.54" + dart: ">=3.4.0 <4.0.0" + flutter: ">=3.22.0" diff --git a/pubspec.yaml b/pubspec.yaml index ebfe244..80dc5e8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ dependencies: flutter: sdk: flutter cupertino_icons: ^1.0.5 - wakelock: ^0.6.1+2 + wakelock_plus: ^1.2.8 meta: ^1.7.0 flutter_widget_from_html_core: ^0.8.5+3 visibility_detector: ^0.3.3