Showing
5 changed files
with
19 additions
and
13 deletions
| 1 | +## 0.1.2+6 | ||
| 2 | + | ||
| 3 | +* Cleaned up Android manifest. | ||
| 4 | +* Changed a test name in `test_driver`. | ||
| 5 | +* Updated description. | ||
| 6 | +* Updated `README.md`. | ||
| 7 | + | ||
| 1 | ## 0.1.2+5 | 8 | ## 0.1.2+5 |
| 2 | 9 | ||
| 3 | * Expanded continuous integration to include format checking and code analysis. | 10 | * Expanded continuous integration to include format checking and code analysis. |
| 1 | # Wakelock [](https://travis-ci.com/creativecreatorormaybenot/wakelock) [](https://github.com/creativecreatorormaybenot/wakelock) [](https://pub.dev/packages/wakelock) | 1 | # Wakelock [](https://travis-ci.com/creativecreatorormaybenot/wakelock) [](https://github.com/creativecreatorormaybenot/wakelock) [](https://pub.dev/packages/wakelock) |
| 2 | 2 | ||
| 3 | -This Flutter plugin allows you to enable and toggle the Android and iOS screen wakelock, which prevents the screen from turning off automatically. | ||
| 4 | -Essentially, this allows you to keep the device awake, i.e. prevent the phone or tablet from sleeping. | 3 | +This Flutter plugin allows you to enable and toggle the screen wakelock on Android and iOS, which prevents the screen from turning off automatically. |
| 4 | +Essentially, this allows you to keep the device awake, i.e. prevent the device from sleeping. | ||
| 5 | 5 | ||
| 6 | ## Usage | 6 | ## Usage |
| 7 | 7 | ||
| @@ -10,7 +10,8 @@ To use this plugin, follow the [installing guide](https://pub.dev/packages/wakel | @@ -10,7 +10,8 @@ To use this plugin, follow the [installing guide](https://pub.dev/packages/wakel | ||
| 10 | ### Implementation | 10 | ### Implementation |
| 11 | 11 | ||
| 12 | Everything in this plugin is controlled via the [`Wakelock` class](https://pub.dev/documentation/wakelock/latest/wakelock/Wakelock-class.html). | 12 | Everything in this plugin is controlled via the [`Wakelock` class](https://pub.dev/documentation/wakelock/latest/wakelock/Wakelock-class.html). |
| 13 | -If you want to enable the wakelock, you can simply call [`Wakelock.enable`](https://pub.dev/documentation/wakelock/latest/wakelock/Wakelock/enable.html) and to disable it, you can use [`Wakelock.disable`](https://pub.dev/documentation/wakelock/latest/wakelock/Wakelock/disable.html): | 13 | +If you want to enable the wakelock, i.e. keep the device awake, you can simply call [`Wakelock.enable`](https://pub.dev/documentation/wakelock/latest/wakelock/Wakelock/enable.html) |
| 14 | +and to disable it again, you can use [`Wakelock.disable`](https://pub.dev/documentation/wakelock/latest/wakelock/Wakelock/disable.html): | ||
| 14 | 15 | ||
| 15 | ```dart | 16 | ```dart |
| 16 | import 'package:wakelock/wakelock.dart'; | 17 | import 'package:wakelock/wakelock.dart'; |
| @@ -23,7 +24,8 @@ Wakelock.enable(); | @@ -23,7 +24,8 @@ Wakelock.enable(); | ||
| 23 | Wakelock.disable(); | 24 | Wakelock.disable(); |
| 24 | ``` | 25 | ``` |
| 25 | 26 | ||
| 26 | -For more advanced usage, you can pass a `bool` to [`Wakelock.toggle`](https://pub.dev/documentation/wakelock/latest/wakelock/Wakelock/toggle.html) to enable or disable the wakelock and also retrieve the current wakelock status using [`Wakelock.isEnabled`](https://pub.dev/documentation/wakelock/latest/wakelock/Wakelock/isEnabled.html): | 27 | +For more advanced usage, you can pass a `bool` to [`Wakelock.toggle`](https://pub.dev/documentation/wakelock/latest/wakelock/Wakelock/toggle.html) to enable or disable the wakelock |
| 28 | +and also retrieve the current wakelock status using [`Wakelock.isEnabled`](https://pub.dev/documentation/wakelock/latest/wakelock/Wakelock/isEnabled.html): | ||
| 27 | 29 | ||
| 28 | ```dart | 30 | ```dart |
| 29 | import 'package:wakelock/wakelock.dart'; | 31 | import 'package:wakelock/wakelock.dart'; |
| @@ -44,7 +46,8 @@ Wakelock.toggle(on: on); | @@ -44,7 +46,8 @@ Wakelock.toggle(on: on); | ||
| 44 | bool isEnabled = await Wakelock.isEnabled; | 46 | bool isEnabled = await Wakelock.isEnabled; |
| 45 | ``` | 47 | ``` |
| 46 | 48 | ||
| 47 | -If you want to wait for the wakelock toggle on Android or iOS to complete (which takes an insignificant amount of time), you can also await any of `Wakelock.enable`, `Wakelock.disable`, and `Wakelock.toggle`. | 49 | +If you want to wait for the wakelock toggle on Android or iOS to complete (which takes an insignificant amount of time), |
| 50 | +you can also `await` any of `Wakelock.enable`, `Wakelock.disable`, and `Wakelock.toggle`. | ||
| 48 | 51 | ||
| 49 | ## Notes | 52 | ## Notes |
| 50 | 53 |
| @@ -10,7 +10,7 @@ void main() { | @@ -10,7 +10,7 @@ void main() { | ||
| 10 | tearDownAll(() => completer.complete(null)); | 10 | tearDownAll(() => completer.complete(null)); |
| 11 | 11 | ||
| 12 | group('wakelock', () { | 12 | group('wakelock', () { |
| 13 | - test('is disabled on start', () async { | 13 | + test('is disabled at start', () async { |
| 14 | expect(await Wakelock.isEnabled, false); | 14 | expect(await Wakelock.isEnabled, false); |
| 15 | }); | 15 | }); |
| 16 | 16 |
| 1 | name: wakelock | 1 | name: wakelock |
| 2 | -description: This plugin allows you to keep Android and iOS devices awake, i.e. prevent the screen from sleeping by toggling the wakelock of the phone or tablet on or off. | ||
| 3 | -version: 0.1.2+5 | 2 | +description: This plugin allows you to keep Android and iOS devices awake, i.e. prevent the screen from sleeping by toggling the wakelock of the device on or off. |
| 3 | +version: 0.1.2+6 | ||
| 4 | author: creativecreatorormaybenot <19204050+creativecreatorormaybenot@users.noreply.github.com> | 4 | author: creativecreatorormaybenot <19204050+creativecreatorormaybenot@users.noreply.github.com> |
| 5 | homepage: https://github.com/creativecreatorormaybenot/wakelock | 5 | homepage: https://github.com/creativecreatorormaybenot/wakelock |
| 6 | 6 |
-
Please register or login to post a comment