aaassseee / screen_brightness

A Plugin for controlling screen brightness with application life cycle set and reset brightness implemented
https://pub.dev/packages/screen_brightness
MIT License
25 stars 22 forks source link

[bug] Importing `screen_brightness` package messes up auto brightness for the app. #26

Open MarcinusX opened 9 months ago

MarcinusX commented 9 months ago

Description (bug summary)

Recently I've added screen_brightness to our app to change the brightness of one screen.
Since then, people started mentioning that the app gets very dark. At first, I thought it was just them not understanding the auto-brightness of the phone but lately, I've started to notice it myself. The app sets the brightness of the screen to a much lower setting than it normally is. (and also lower in comparison to other apps)

Step to reproduce (how to reproduce the bug)

  1. Add screen_brightness in pubspec.yaml
  2. Open the app
  3. Set brightness to max
  4. Lock the screen
  5. Wait for the brightness to auto adjust
  6. Unlock the screen
  7. Notice much lower brightness than before

Here's the recording of what it looks like:

https://github.com/aaassseee/screen_brightness/assets/16286046/dc73a4a3-038d-4baa-88d0-67e17007730f

And here's without the package.

https://github.com/aaassseee/screen_brightness/assets/16286046/b7e64ab9-e94d-4254-872c-d115e21b6820

There is no package code running, it's just importing the package in pubspec.

Platform (Android/iOS/macOS/Windows)

iOS, haven't seen it on Android yet.

Thank you for this package! You're doing a great job! 💙

aaassseee commented 9 months ago

@MarcinusX Thanks for opening this issue. I will take this issue a deep look later.

aaassseee commented 8 months ago

@MarcinusX I found where's the problem, however it is hard to solve the problem in simple way.

The issue is, when the user pausing the application. The plugin willl auto reset brightness to initial value. Which is saved when user is not using the app.

I might take longer to figure out when the users are using auto brightness.

MarcinusX commented 8 months ago

Thanks for investigating it! 🙏 I look forward to any updates. :)

aaassseee commented 5 months ago

Hi guys, you can turn off is auto reset on iOS to prevent auto adjust screen brightness for now