From 6f64a2e97b2107f630b33093ed6efda95f864f1e Mon Sep 17 00:00:00 2001 From: wheremyfiji Date: Sat, 14 Sep 2024 13:47:18 +0300 Subject: [PATCH] force highest refresh rate --- lib/main.dart | 7 +++++++ pubspec.lock | 8 ++++++++ pubspec.yaml | 1 + 3 files changed, 16 insertions(+) diff --git a/lib/main.dart b/lib/main.dart index c693094..109d1ee 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -7,6 +7,7 @@ import 'package:flutter/services.dart'; import 'package:google_api_availability/google_api_availability.dart'; import 'package:path_provider/path_provider.dart' as path_prov; +import 'package:flutter_displaymode/flutter_displaymode.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:device_info_plus/device_info_plus.dart'; import 'package:dart_discord_rpc/dart_discord_rpc.dart'; @@ -148,6 +149,12 @@ void initApp() async { if (Platform.isAndroid) { androidInfo = await DeviceInfoPlugin().androidInfo; + try { + await FlutterDisplayMode.setHighRefreshRate(); + } catch (e) { + debugPrint('FlutterDisplayMode: $e'); + } + if (androidInfo.version.sdkInt > 28) { await SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge); } diff --git a/pubspec.lock b/pubspec.lock index cd425bd..49f070c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -447,6 +447,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.3.1" + flutter_displaymode: + dependency: "direct main" + description: + name: flutter_displaymode + sha256: "42c5e9abd13d28ed74f701b60529d7f8416947e58256e6659c5550db719c57ef" + url: "https://pub.dev" + source: hosted + version: "0.6.0" flutter_hooks: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index caf8f53..4a73ed1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,6 +12,7 @@ isar_version: &isar_version 3.1.0+1 dependencies: audio_session: ^0.1.19 + flutter_displaymode: ^0.6.0 audio_video_progress_bar: ^2.0.3 #git_info: ^1.1.2 #bottom_sheet: ^3.1.2