creativecreatorormaybenot
Committed by GitHub

0.1.4+1 (#24)

... ... @@ -57,7 +57,7 @@ jobs:
- 'stable'
- 'beta'
- 'dev'
fail-fast: true
fail-fast: false
steps:
- name: Start iOS simulator
... ... @@ -87,12 +87,12 @@ jobs:
- name: Run unit tests
run: flutter test
- name: Run integration tests on iOS
if: contains(matrix.device, 'iPhone')
if: contains(matrix.device, 'iPhone') && false # Need to run locally for now.
run: |
cd example
flutter drive --target=test_driver/app.dart
- name: Run integration tests on Android
if: contains(matrix.device, 'Android') && false # Run these locally for now.
if: contains(matrix.device, 'Android')
uses: reactivecircus/android-emulator-runner@v2.5.0
with:
api-level: 29
... ...
... ... @@ -29,7 +29,7 @@ jobs:
- name: Run unit tests
run: flutter test
- name: Run integration tests on Android
if: false # Run these locally for now.
if: false # Need to run locally for now.
uses: reactivecircus/android-emulator-runner@v2.5.0
with:
api-level: 29
... ...
## 0.1.4+1
* Finished migration to new Flutter plugin embedding.
* Fixed missing activity on Android for apps using the old plugin embedding.
* Lowered Flutter SDK version constraint to `1.12.0`.
## 0.1.4
* Added assertion for `on` in `Wakelock.toggle` to be non-null and `@required` annotation.
... ...
... ... @@ -16,9 +16,11 @@ public class WakelockPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
channel = MethodChannel(flutterPluginBinding.binaryMessenger, "wakelock")
channel.setMethodCallHandler(this)
setup()
wakelock = Wakelock()
}
private var registrar: Registrar? = null
// This static function is optional and equivalent to onAttachedToEngine. It supports the old
// pre-Flutter-1.12 Android projects. You are encouraged to continue supporting
// plugin registration via this function while apps migrate to use the new Android APIs
... ... @@ -33,34 +35,34 @@ public class WakelockPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
fun registerWith(registrar: Registrar) {
val channel = MethodChannel(registrar.messenger(), "wakelock")
val plugin = WakelockPlugin()
plugin.registrar = registrar
plugin.wakelock = Wakelock()
channel.setMethodCallHandler(plugin)
plugin.setup()
}
}
private var wakelock: Wakelock? = null
private fun setup() {
wakelock = Wakelock()
}
override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {
if (registrar != null) wakelock!!.activity = registrar!!.activity()
when (call.method) {
"toggle" -> {
wakelock?.toggle(call.argument<Boolean>("enable")!!, result)
wakelock!!.toggle(call.argument<Boolean>("enable")!!, result)
}
"isEnabled" -> {
wakelock?.isEnabled(result)
wakelock!!.isEnabled(result)
}
else -> {
result.notImplemented()
}
}
if (registrar != null) wakelock!!.activity = null
}
override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) {
channel.setMethodCallHandler(null)
wakelock = null
registrar = null
}
override fun onAttachedToActivity(binding: ActivityPluginBinding) {
... ...
name: wakelock
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.
version: 0.1.4
version: 0.1.4+1
homepage: https://github.com/creativecreatorormaybenot/wakelock
environment:
sdk: ">=2.7.0 <3.0.0"
flutter: ">=1.12.13+hotfix.8 <2.0.0"
flutter: ">=1.12.0 <2.0.0"
dependencies:
flutter:
... ...