diff --git a/lib/main.dart b/lib/main.dart index 3e9348ff9..eae240ada 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -36,6 +36,7 @@ import 'package:path_provider/path_provider.dart'; import 'package:spotube/hooks/use_init_sys_tray.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_native_splash/flutter_native_splash.dart'; +import 'package:flutter_displaymode/flutter_displaymode.dart'; Future main(List rawArgs) async { final parser = ArgParser(); @@ -85,6 +86,11 @@ Future main(List rawArgs) async { MediaKit.ensureInitialized(); + // force High Refresh Rate on some Android devices (like One Plus) +if (DesktopTools.platform.isAndroid) { + await FlutterDisplayMode.setHighRefreshRate(); +} + await DesktopTools.ensureInitialized( DesktopWindowOptions( hideTitleBar: true, diff --git a/pubspec.lock b/pubspec.lock index e830bebaa..18afa0fe1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -632,6 +632,14 @@ packages: url: "https://github.com/KRTirtho/flutter_desktop_tools.git" source: git version: "0.0.1" + flutter_displaymode: + dependency: "direct main" + description: + name: flutter_displaymode + sha256: "42c5e9abd13d28ed74f701b60529d7f8416947e58256e6659c5550db719c57ef" + url: "https://pub.dev" + source: hosted + version: "0.6.0" flutter_distributor: dependency: "direct dev" description: diff --git a/pubspec.yaml b/pubspec.yaml index 20df062ce..c03a58c79 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -97,6 +97,7 @@ dependencies: duration: ^3.0.12 disable_battery_optimization: ^1.1.0+1 youtube_explode_dart: ^1.12.4 + flutter_displaymode: ^0.6.0 dev_dependencies: build_runner: ^2.3.2