Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add reset brightness #17

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

karansingla007
Copy link

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

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

@karansingla007
Copy link
Author

@benoitskipr yes i know. i dont have mac

@karansingla007
Copy link
Author

@benoitskipr please use this pakage

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