Skip to content

Conversation

karansingla-dev
Copy link

@karansingla-dev karansingla-dev commented Sep 9, 2019

reset brightness
@ened @clovisnicolas @matejm @IKStreamIvo please review and merge

case "isKeptOn":
int flags = _registrar.activity().getWindow().getAttributes().flags;
result.success((flags & WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) != 0) ;
break;
case "keepOn":
Boolean on = call.argument("on");
Boolean on = call.argument("on");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That space probably shouldn't be there.

@@ -9,4 +9,5 @@ class Screen {
static Future setBrightness(double brightness) =>_channel.invokeMethod('setBrightness',{"brightness" : brightness});
static Future<bool> get isKeptOn async => (await _channel.invokeMethod('isKeptOn')) as bool;
static Future keepOn(bool on) => _channel.invokeMethod('keepOn', {"on" : on});
static Future resetBrightness() => _channel.invokeMethod('resetBrightness');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if a different name would be appropriate. The brightness isn't really "reset", it's more like, the brightness override is removed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you suggest me an appropriate name? @pikaju

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disableBrightnessOverride?

Copy link
Author

@karansingla-dev karansingla-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clovisnicolas please review my PR and merge

@@ -9,4 +9,5 @@ class Screen {
static Future setBrightness(double brightness) =>_channel.invokeMethod('setBrightness',{"brightness" : brightness});
static Future<bool> get isKeptOn async => (await _channel.invokeMethod('isKeptOn')) as bool;
static Future keepOn(bool on) => _channel.invokeMethod('keepOn', {"on" : on});
static Future resetBrightness() => _channel.invokeMethod('resetBrightness');
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you suggest me an appropriate name? @pikaju

@benoitskipr
Copy link

@singlakaran isn't it missing the iOS implementation for resetBrightness ? I've got MissingPluginException(No implementation found for method resetBrightness on channel github.com/clovisnicolas/flutter_screen) with this branch

@karansingla-dev
Copy link
Author

@benoitskipr yes i know. i dont have mac

@karansingla-dev
Copy link
Author

@benoitskipr please use this pakage

@karansingla-dev karansingla-dev closed this by deleting the head repository Sep 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants