I wanted to make an app to regulate the phone brightness (android) but cannot find anything.
The only thing that I found is the screen plugin but visual studio code doesn’t accept it.
Do you guy maybe have a practical example that I can use?
I wanted to make an app to regulate the phone brightness (android) but cannot find anything.
The only thing that I found is the screen plugin but visual studio code doesn’t accept it.
Do you guy maybe have a practical example that I can use?
2
Answers
There is no plugin which IDE doesn’t accept. It seems your flutter sdk or some of the packages you are using is not compatible with that plugin’s latest version. Or maybe plugin is too old.
Try this one: https://pub.dev/packages/screen_brightness Instead of adding pubspec.yaml by hand, it is preferred adding dependencies with
flutter pub add [dependency_name]
. Because it automatically adds compatible version with your flutter sdk and dependencies you are already using.Try use screen_brightness, like this:
Remember that this package won’t work on emulator.