Comments (5)
What issues are you running into? What code are you calling and if it crashes or so what does it say?
Can you confirm that you ensure the WidgetsBinding is initialized?
WidgetsFlutterBinding.ensureInitialized();
EDIT: I did notice after adding this to my code it started working except for the isEnabled method which throws:
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: type '_Map<Object?, Object?>' is not a subtype of type 'IsEnabledMessage?' in type cast
from wakelock.
Yes, I do call WidgetsFlutterBinding.ensureInitialized();
There are no error messages or crash reports.
This appears to be a function of iOS. If you enable wake lock and let the app run on battery with the screen on, iOS terminates the app after almost exactly 90 minutes. If you turn the screen off or run while plugged in, the app will run for many hours.
I solved the problem by disabling wake lock before the 90-minute limit, so that iOS can turn off the screen. Not ideal.
from wakelock.
Ah, I see, yeah that would solve your problem. I don't think it happens that often, though, but maybe the library could be updated to include a future that toggles it at like 89 minutes.
from wakelock.
Consider switching to https://pub.dev/packages/wakelock_plus
Published by fluttercommunity.dev
It is a continuation of this project as the owner is not able to work on it at the moment afaik.
from wakelock.
I will soon discontinue this repository. Please use wakelock_plus: ^1.1.6 instead.
from wakelock.
Related Issues (20)
- Feature request: Dim screen (but keep it on) HOT 1
- Wakelock doesn't work at the latest version of flutter HOT 19
- Still alive? HOT 2
- Wakelock is incompatible with device_info_plus: ^9.0.2 HOT 3
- Package incompatibility! win32 ^3.0.0 HOT 2
- 'Flutter/Flutter.h' file not found in IOS HOT 2
- increase android target API to 33 HOT 1
- duplicate: may be deleted
- An ios NSRangeException error may be caused by wakelock HOT 1
- The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher. HOT 1
- Address privacy manifest requirement HOT 1
- Incompatible with package_info_plus 6.0.0 HOT 2
- Partial wakelock android support HOT 1
- Need add Privacy manifest files HOT 1
- PlatformException HOT 1
- PlatformException HOT 1
- Discontinuation
- Discontinuation addition HOT 2
- Wakelock.enable seem not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wakelock.