Skip to content

Commit

Permalink
force highest refresh rate
Browse files Browse the repository at this point in the history
  • Loading branch information
wheremyfiji committed Sep 14, 2024
1 parent 975888b commit 6f64a2e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
}
Expand Down
8 changes: 8 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6f64a2e

Please sign in to comment.