screen_brightness icon indicating copy to clipboard operation
screen_brightness copied to clipboard

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

Open MarcinusX opened this issue 1 year ago • 4 comments

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! 💙

MarcinusX avatar Feb 20 '24 14:02 MarcinusX

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

aaassseee avatar Feb 20 '24 15:02 aaassseee

@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.

aaassseee avatar Mar 23 '24 05:03 aaassseee

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

MarcinusX avatar Mar 23 '24 05:03 MarcinusX

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

aaassseee avatar Jun 17 '24 10:06 aaassseee