Skip to content

Commit

Permalink
[wakelock_plus] Replace frontend package to wakelock_plus (#736)
Browse files Browse the repository at this point in the history
  • Loading branch information
JSUYA authored Sep 13, 2024
1 parent d3ff2da commit 756a3f4
Show file tree
Hide file tree
Showing 33 changed files with 317 additions and 247 deletions.
4 changes: 2 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
- packages/video_player_avplay/**/*
"p: video_player_videohole":
- packages/video_player_videohole/**/*
"p: wakelock":
- packages/wakelock/**/*
"p: wakelock_plus":
- packages/wakelock_plus/**/*
"p: wearable_rotary":
- packages/wearable_rotary/**/*
"p: webview_flutter":
Expand Down
2 changes: 1 addition & 1 deletion .github/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ plugins:
tizen_package_manager: ["tv-8.0"]
tizen_rpc_port: ["tv-8.0"]
url_launcher: ["tv-8.0"]
wakelock_plus: ["tv-8.0"]

# Only testable with wearable profile.
battery_plus: []
flutter_app_badger: []
permission_handler: []
sensors_plus: []
wakelock: []

# No tests.
google_sign_in: []
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The _"non-endorsed"_ status means that the plugin is not endorsed by the origina
| [**video_player_avplay**](packages/video_player_avplay) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/video_player_avplay.svg)](https://pub.dev/packages/video_player_avplay) | N/A |
| [**video_player_tizen**](packages/video_player) | [video_player](https://pub.dev/packages/video_player) (1st-party) | [![pub package](https://img.shields.io/pub/v/video_player_tizen.svg)](https://pub.dev/packages/video_player_tizen) | No |
| [**video_player_videohole**](packages/video_player_videohole) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/video_player_videohole.svg)](https://pub.dev/packages/video_player_videohole) | N/A |
| [**wakelock_tizen**](packages/wakelock) | [wakelock](https://pub.dev/packages/wakelock) (3rd-party) | [![pub package](https://img.shields.io/pub/v/wakelock_tizen.svg)](https://pub.dev/packages/wakelock_tizen) | No |
| [**wakelock_plus_tizen**](packages/wakelock_plus) | [wakelock_plus](https://pub.dev/packages/wakelock_plus) (1st-party) | [![pub package](https://img.shields.io/pub/v/wakelock_plus_tizen.svg)](https://pub.dev/packages/wakelock_plus_tizen) | No |
| [**wearable_rotary**](packages/wearable_rotary) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/wearable_rotary.svg)](https://pub.dev/packages/wearable_rotary) | N/A |
| [**webview_flutter_lwe**](packages/webview_flutter_lwe) | [webview_flutter](https://pub.dev/packages/webview_flutter) (1st-party) | [![pub package](https://img.shields.io/pub/v/webview_flutter_lwe.svg)](https://pub.dev/packages/webview_flutter_lwe) | No |
| [**webview_flutter_tizen**](packages/webview_flutter) | [webview_flutter](https://pub.dev/packages/webview_flutter) (1st-party) | [![pub package](https://img.shields.io/pub/v/webview_flutter_tizen.svg)](https://pub.dev/packages/webview_flutter_tizen) | No |
Expand Down Expand Up @@ -95,7 +95,7 @@ The _"non-endorsed"_ status means that the plugin is not endorsed by the origina
| [**video_player_avplay**](packages/video_player_avplay) ||| ✔️ || See README for details |
| [**video_player_tizen**](packages/video_player) | ✔️ | ✔️ | ✔️ || TV emulator issue |
| [**video_player_videohole**](packages/video_player_videohole) ||| ✔️ | ⚠️ | See README for details |
| [**wakelock_tizen**](packages/wakelock) | ✔️ | ✔️ | | | Cannot override system settings |
| [**wakelock_plus_tizen**](packages/wakelock_plus) | | | ✔️ | ✔️ | Only applicable for TV |
| [**wearable_rotary**](packages/wearable_rotary) | ✔️ | ✔️ ||| Not applicable for TV |
| [**webview_flutter_lwe**](packages/webview_flutter_lwe) | ✔️ | ✔️ | ✔️ | ✔️ | Not for production use |
| [**webview_flutter_tizen**](packages/webview_flutter) ||| ✔️ | ✔️ | API not supported |
26 changes: 0 additions & 26 deletions packages/wakelock/LICENSE

This file was deleted.

37 changes: 0 additions & 37 deletions packages/wakelock/README.md

This file was deleted.

7 changes: 0 additions & 7 deletions packages/wakelock/analysis_options.yaml

This file was deleted.

21 changes: 0 additions & 21 deletions packages/wakelock/example/integration_test/wakelock_test.dart

This file was deleted.

13 changes: 0 additions & 13 deletions packages/wakelock/example/tizen/tizen-manifest.xml

This file was deleted.

25 changes: 0 additions & 25 deletions packages/wakelock/pubspec.yaml

This file was deleted.

83 changes: 0 additions & 83 deletions packages/wakelock/tizen/src/wakelock_tizen_plugin.cc

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## NEXT
## 2.0.0

* Update minimum Flutter and Dart version to 3.13 and 3.1.
* Replace frontend package to wakelock_plus.
* Supports TV devices.
* Update minimum Flutter and Dart version to 3.19 and 3.4.

## 1.0.2

Expand Down
31 changes: 31 additions & 0 deletions packages/wakelock_plus/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Copyright (c) 2024 Samsung Electronics Co., Ltd. All rights reserved.

BSD 3-Clause License

Copyright (c) 2020-2023, creativecreatorormaybenot
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 changes: 23 additions & 0 deletions packages/wakelock_plus/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# wakelock_plus_tizen

[![pub package](https://img.shields.io/pub/v/wakelock_plus_tizen.svg)](https://pub.dev/packages/wakelock_plus_tizen)

The Tizen implementation of [`wakelock_plus`](https://pub.dev/packages/wakelock_plus).

## Usage

This package is not an _endorsed_ implementation of `wakelock_plus`. Therefore, you have to include `wakelock_plus_tizen` alongside `wakelock_plus` as dependencies in your `pubspec.yaml` file.

```yaml
dependencies:
wakelock_plus: ^1.2.8
wakelock_plus_tizen: ^2.0.0
```
Then you can import `wakelock_plus` in your Dart code:

```dart
import 'package:wakelock_plus/wakelock_plus.dart';
```

For detailed usage, see https://pub.dev/packages/wakelock_plus#usage.
5 changes: 5 additions & 0 deletions packages/wakelock_plus/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include: package:flutter_lints/flutter.yaml

linter:
rules:
public_member_api_docs: true
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# wakelock_tizen_example
# wakelock_plus_tizen_example

Demonstrates how to use the wakelock_tizen plugin.
Demonstrates how to use the wakelock_plus_tizen plugin.

## Getting Started

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import 'package:flutter_test/flutter_test.dart';

import 'package:integration_test/integration_test.dart';
import 'package:wakelock_plus/wakelock_plus.dart';

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

testWidgets('enabling and disabling wakelock', (WidgetTester tester) async {
final wakelockEnabled = await WakelockPlus.enabled;

// The wakelock should initially be disabled.
expect(wakelockEnabled, isFalse);

await WakelockPlus.enable();
expect(await WakelockPlus.enabled, isTrue);
await WakelockPlus.disable();
expect(await WakelockPlus.enabled, isFalse);
});

testWidgets('toggling wakelock', (WidgetTester tester) async {
await WakelockPlus.toggle(enable: true);
expect(await WakelockPlus.enabled, isTrue);
await WakelockPlus.toggle(enable: false);
expect(await WakelockPlus.enabled, isFalse);
});
}
Loading

0 comments on commit 756a3f4

Please sign in to comment.