Code Monkey home page Code Monkey logo

Comments (5)

vleeuwenmenno avatar vleeuwenmenno commented on July 24, 2024

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.

ozzy1873 avatar ozzy1873 commented on July 24, 2024

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.

vleeuwenmenno avatar vleeuwenmenno commented on July 24, 2024

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.

jhonatan-3a avatar jhonatan-3a commented on July 24, 2024

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.

creativecreatorormaybenot avatar creativecreatorormaybenot commented on July 24, 2024

I will soon discontinue this repository. Please use wakelock_plus: ^1.1.6 instead.

from wakelock.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.