fluttercommunity / wakelock_plus

Flutter plugin that allows you to keep the device screen awake on Android, iOS, macOS, Windows, Linux, and web.
BSD 3-Clause "New" or "Revised" License
67 stars 49 forks source link

Package ships with no_sleep.js file on all platforms #5

Open ened opened 1 year ago

ened commented 1 year ago

This no_sleep.js file should only be used for web projects (and perhaps be compressed as well).

Screenshot 2023-08-17 at 10 31 32
diegotori commented 1 year ago

@ened thank you for your question. The web version is a consolidation of the original wakelock plugin that federated each platform into its own package. As a result, it adds this script, but rest assured, its only ever used in web.

Not to mention that the size of the script is negligible in terms of footprint due to it being part of the implementation.

Lastly, there is currently an open issue for the Flutter team to add support for platform-specific assets. However, no movement has been made on that issue thus far. Feel free to give it a thumbs up so that it gets their attention.

In terms of compressing that script in question, I dunno how to specifically do that for JavaScript files. However, I do accept PRs to that effect and will review them once submitted.