diff --git a/lib/main.dart b/lib/main.dart index 7fb4ba6..be5cf8e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -3,6 +3,7 @@ import 'package:device_info_plus/device_info_plus.dart'; import 'package:flex_color_scheme/flex_color_scheme.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; +import 'package:flutter_displaymode/flutter_displaymode.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:photo_manager/photo_manager.dart'; @@ -65,7 +66,12 @@ class _MainState extends State { checkPermission(); } + Future initialize() async { + await FlutterDisplayMode.setHighRefreshRate(); + } + Future checkPermission() async { + await initialize(); bool permitted = false; var androidInfo = await DeviceInfoPlugin().androidInfo; final PermissionState ps = await PhotoManager.requestPermissionExtend(); diff --git a/pubspec.lock b/pubspec.lock index a5360b5..39d8025 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -142,6 +142,14 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_displaymode: + dependency: "direct main" + description: + name: flutter_displaymode + sha256: "42c5e9abd13d28ed74f701b60529d7f8416947e58256e6659c5550db719c57ef" + url: "https://pub.dev" + source: hosted + version: "0.6.0" flutter_lints: dependency: "direct dev" description: diff --git a/pubspec.yaml b/pubspec.yaml index 9a09bc7..1366a63 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 0.5.2+1 +version: 0.5.3+1 environment: sdk: '>=2.19.3 <3.0.0' @@ -52,6 +52,7 @@ dependencies: url_launcher: ^6.1.14 flutter_spinkit: ^5.2.0 reorderable_grid: ^1.0.8 + flutter_displaymode: ^0.6.0 dev_dependencies: flutter_test: