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

Callback return from setHighRefreshRate and setLowRefreshRate #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/src/flutter_display_mode.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ class FlutterDisplayMode {
}

/// [setHighRefreshRate] changes preferred mode to highest refresh rate
/// return the new displaymode
/// available maintaining current resolution
static Future<void> setHighRefreshRate() async {
static Future<DisplayMode> setHighRefreshRate() async {
final List<DisplayMode> modes = await supported;
final DisplayMode activeMode = await active;

Expand All @@ -68,11 +69,13 @@ class FlutterDisplayMode {
}

await setPreferredMode(newMode);
return newMode;
}

/// [setLowRefreshRate] changes preferred mode to lowest refresh rate
/// return the new displaymode
/// available maintaining current resolution
static Future<void> setLowRefreshRate() async {
static Future<DisplayMode> setLowRefreshRate() async {
final List<DisplayMode> modes = await supported;
final DisplayMode activeMode = await active;

Expand All @@ -86,5 +89,6 @@ class FlutterDisplayMode {
}

await setPreferredMode(newMode);
return newMode;
}
}