Skip to content

Commit

Permalink
Merge pull request #345 from lamarios/feature/set_high_refresh_mode
Browse files Browse the repository at this point in the history
force high refresh rate because sometimes flutter is stuck at 60hz
  • Loading branch information
lamarios authored Oct 15, 2023
2 parents 7253bb3 + 634100a commit f404c7d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import 'dart:async';
import 'dart:io';

import 'package:awesome_notifications/awesome_notifications.dart';
import 'package:dynamic_color/dynamic_color.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_displaymode/flutter_displaymode.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:invidious/app/states/app.dart';
import 'package:invidious/downloads/states/download_manager.dart';
import 'package:invidious/workmanager.dart';
import 'package:invidious/globals.dart';
import 'package:invidious/httpOverrides.dart';
import 'package:invidious/mediaHander.dart';
Expand All @@ -18,6 +17,7 @@ import 'package:invidious/player/states/player.dart';
import 'package:invidious/router.dart';
import 'package:invidious/settings/states/settings.dart';
import 'package:invidious/utils.dart';
import 'package:invidious/workmanager.dart';
import 'package:logging/logging.dart';

import 'database.dart';
Expand Down Expand Up @@ -55,6 +55,13 @@ Future<void> main() async {

initializeNotifications();

try {
log.fine("Forcing refresh rate");
await FlutterDisplayMode.setHighRefreshRate();
}catch(err){
log.severe("failed to set high refresh mode", err);
}

isTv = await isDeviceTv();
runApp(MultiBlocProvider(providers: [
BlocProvider(
Expand Down
8 changes: 8 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,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_driver:
dependency: "direct dev"
description: flutter
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ dependencies:
awesome_notifications: ^0.7.6
auto_route: ^7.8.3
workmanager: 0.5.2
flutter_displaymode: ^0.6.0
dependency_overrides:
# wakelock_windows:
# git: # see https://github.com/creativecreatorormaybenot/wakelock/pull/203 for updates
Expand Down

0 comments on commit f404c7d

Please sign in to comment.