From 25f9b02e533945f7eda7d76368a11be217767fba Mon Sep 17 00:00:00 2001 From: ashilkn Date: Thu, 5 Oct 2023 13:13:59 +0530 Subject: [PATCH 1/2] chore: run dart fix --apply to add trailing commas --- lib/core/configuration.dart | 2 +- lib/core/logging/tunneled_transport.dart | 2 +- lib/locale.dart | 2 +- .../view/setup_enter_secret_key_page.dart | 2 +- lib/onboarding/view/view_qr_page.dart | 2 +- lib/ui/account/email_entry_page.dart | 71 ++++++++++--------- lib/ui/account/login_page.dart | 4 +- .../account/login_pwd_verification_page.dart | 2 +- lib/ui/account/ott_verification_page.dart | 4 +- lib/ui/account/password_reentry_page.dart | 2 +- lib/ui/account/recovery_key_page.dart | 2 +- lib/ui/account/verify_recovery_page.dart | 2 +- lib/ui/common/dynamic_fab.dart | 2 +- lib/ui/common/progress_dialog.dart | 2 +- lib/ui/components/buttons/button_widget.dart | 2 +- lib/ui/components/captioned_text_widget.dart | 2 +- lib/ui/components/dialog_widget.dart | 2 +- lib/ui/components/title_bar_widget.dart | 4 +- lib/ui/home/coach_mark_widget.dart | 2 +- lib/ui/scanner_gauth_page.dart | 2 +- lib/ui/scanner_page.dart | 2 +- lib/ui/settings/faq.dart | 2 +- lib/ui/settings/support_dev_widget.dart | 2 - lib/utils/device_info.dart | 2 +- lib/utils/email_util.dart | 2 +- pubspec.lock | 42 ++++++----- 26 files changed, 90 insertions(+), 77 deletions(-) diff --git a/lib/core/configuration.dart b/lib/core/configuration.dart index a39052e655..0717e4b46a 100644 --- a/lib/core/configuration.dart +++ b/lib/core/configuration.dart @@ -45,7 +45,7 @@ class Configuration { final List onlineSecureKeys = [ keyKey, secretKeyKey, - authSecretKeyKey + authSecretKeyKey, ]; final kTempFolderDeletionTimeBuffer = const Duration(days: 1).inMicroseconds; diff --git a/lib/core/logging/tunneled_transport.dart b/lib/core/logging/tunneled_transport.dart index 9706f72fd8..daf8a7941f 100644 --- a/lib/core/logging/tunneled_transport.dart +++ b/lib/core/logging/tunneled_transport.dart @@ -122,7 +122,7 @@ class _CredentialBuilder { return headers ..addAll( { - 'X-Sentry-Auth': '$_authHeader, sentry_timestamp=$timestamp' + 'X-Sentry-Auth': '$_authHeader, sentry_timestamp=$timestamp', }, ); } diff --git a/lib/locale.dart b/lib/locale.dart index c45f38d75a..ebca9528af 100644 --- a/lib/locale.dart +++ b/lib/locale.dart @@ -24,7 +24,7 @@ Locale localResolutionCallBack(locales, supportedLocales) { Locale? languageCodeMatch; final Map languageCodeToLocale = { for (Locale supportedLocale in appSupportedLocales) - supportedLocale.languageCode: supportedLocale + supportedLocale.languageCode: supportedLocale, }; for (Locale locale in locales) { diff --git a/lib/onboarding/view/setup_enter_secret_key_page.dart b/lib/onboarding/view/setup_enter_secret_key_page.dart index 5276a11551..b055c3c088 100644 --- a/lib/onboarding/view/setup_enter_secret_key_page.dart +++ b/lib/onboarding/view/setup_enter_secret_key_page.dart @@ -153,7 +153,7 @@ class _SetupEnterSecretKeyPageState extends State { child: Text(l10n.saveAction), ), ), - ) + ), ], ), ), diff --git a/lib/onboarding/view/view_qr_page.dart b/lib/onboarding/view/view_qr_page.dart index 9b29b457e4..71f4756a7c 100644 --- a/lib/onboarding/view/view_qr_page.dart +++ b/lib/onboarding/view/view_qr_page.dart @@ -89,7 +89,7 @@ class ViewQrPage extends StatelessWidget { child: Text(l10n.back), ), ), - ) + ), ], ), ), diff --git a/lib/ui/account/email_entry_page.dart b/lib/ui/account/email_entry_page.dart index f84b68cfeb..e6c3f41fb6 100644 --- a/lib/ui/account/email_entry_page.dart +++ b/lib/ui/account/email_entry_page.dart @@ -371,39 +371,43 @@ class _EmailEntryPageState extends State { Expanded( child: StyledText( text: context.l10n.signUpTerms, - style: - Theme.of(context).textTheme.titleMedium!.copyWith(fontSize: 12), + style: Theme.of(context) + .textTheme + .titleMedium! + .copyWith(fontSize: 12), tags: { 'u-terms': StyledTextActionTag( - (String? text, Map attrs) => Navigator.of(context).push( - MaterialPageRoute( - builder: (BuildContext context) { - return WebPage( - context.l10n.termsOfServicesTitle, - "https://ente.io/terms", - ); - }, - ), + (String? text, Map attrs) => + Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) { + return WebPage( + context.l10n.termsOfServicesTitle, + "https://ente.io/terms", + ); + }, ), + ), style: const TextStyle( decoration: TextDecoration.underline, ), ), 'u-policy': StyledTextActionTag( - (String? text, Map attrs) => Navigator.of(context).push( - MaterialPageRoute( - builder: (BuildContext context) { - return WebPage( - context.l10n.privacyPolicyTitle, - "https://ente.io/privacy", - ); - }, - ), + (String? text, Map attrs) => + Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) { + return WebPage( + context.l10n.privacyPolicyTitle, + "https://ente.io/privacy", + ); + }, ), + ), style: const TextStyle( decoration: TextDecoration.underline, ), - ) + ), }, ), ), @@ -434,20 +438,23 @@ class _EmailEntryPageState extends State { Expanded( child: StyledText( text: context.l10n.ackPasswordLostWarning, - style: - Theme.of(context).textTheme.titleMedium!.copyWith(fontSize: 12), + style: Theme.of(context) + .textTheme + .titleMedium! + .copyWith(fontSize: 12), tags: { 'underline': StyledTextActionTag( - (String? text, Map attrs) => Navigator.of(context).push( - MaterialPageRoute( - builder: (BuildContext context) { - return WebPage( - context.l10n.encryption, - "https://ente.io/architecture", - ); - }, - ), + (String? text, Map attrs) => + Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) { + return WebPage( + context.l10n.encryption, + "https://ente.io/architecture", + ); + }, ), + ), style: const TextStyle( decoration: TextDecoration.underline, ), diff --git a/lib/ui/account/login_page.dart b/lib/ui/account/login_page.dart index a2f9414a29..b2cfce7458 100644 --- a/lib/ui/account/login_page.dart +++ b/lib/ui/account/login_page.dart @@ -204,14 +204,14 @@ class _LoginPageState extends State { style: const TextStyle( decoration: TextDecoration.underline, ), - ) + ), }, ), ), Expanded( flex: 2, child: Container(), - ) + ), ], ), ), diff --git a/lib/ui/account/login_pwd_verification_page.dart b/lib/ui/account/login_pwd_verification_page.dart index 0755be1b19..a443cf2498 100644 --- a/lib/ui/account/login_pwd_verification_page.dart +++ b/lib/ui/account/login_pwd_verification_page.dart @@ -221,7 +221,7 @@ State { ), ], ), - ) + ), ], ), ), diff --git a/lib/ui/account/ott_verification_page.dart b/lib/ui/account/ott_verification_page.dart index ce7b8ea354..8bcaf3e349 100644 --- a/lib/ui/account/ott_verification_page.dart +++ b/lib/ui/account/ott_verification_page.dart @@ -152,7 +152,7 @@ class _OTTVerificationPageState extends State { SizedBox( width: MediaQuery.of(context).size.width * 0.2, height: 1, - ) + ), ], ), ), @@ -203,7 +203,7 @@ class _OTTVerificationPageState extends State { decoration: TextDecoration.underline, ), ), - ) + ), ], ), ), diff --git a/lib/ui/account/password_reentry_page.dart b/lib/ui/account/password_reentry_page.dart index c8fc23a671..aab2553ebc 100644 --- a/lib/ui/account/password_reentry_page.dart +++ b/lib/ui/account/password_reentry_page.dart @@ -310,7 +310,7 @@ class _PasswordReentryPageState extends State { ), ], ), - ) + ), ], ), ), diff --git a/lib/ui/account/recovery_key_page.dart b/lib/ui/account/recovery_key_page.dart index bbe08b7e51..c5ca66fdc9 100644 --- a/lib/ui/account/recovery_key_page.dart +++ b/lib/ui/account/recovery_key_page.dart @@ -191,7 +191,7 @@ class _RecoveryKeyPageState extends State { children: _saveOptions(context, recoveryKey), ), ), - ) + ), ], ), // columnEnds ), diff --git a/lib/ui/account/verify_recovery_page.dart b/lib/ui/account/verify_recovery_page.dart index 3c9796d106..dad67590b4 100644 --- a/lib/ui/account/verify_recovery_page.dart +++ b/lib/ui/account/verify_recovery_page.dart @@ -196,7 +196,7 @@ class _VerifyRecoveryPageState extends State { ), ), ), - const SizedBox(height: 20) + const SizedBox(height: 20), ], ), ), diff --git a/lib/ui/common/dynamic_fab.dart b/lib/ui/common/dynamic_fab.dart index 0fedcff94f..db612882a1 100644 --- a/lib/ui/common/dynamic_fab.dart +++ b/lib/ui/common/dynamic_fab.dart @@ -30,7 +30,7 @@ class DynamicFAB extends StatelessWidget { spreadRadius: 200, blurRadius: 100, offset: const Offset(0, 230), - ) + ), ], ), width: double.infinity, diff --git a/lib/ui/common/progress_dialog.dart b/lib/ui/common/progress_dialog.dart index a05f031e62..8c9a4e1f16 100644 --- a/lib/ui/common/progress_dialog.dart +++ b/lib/ui/common/progress_dialog.dart @@ -277,7 +277,7 @@ class _BodyState extends State<_Body> { _direction == TextDirection.ltr ? loader : text, const SizedBox(width: 8.0), _direction == TextDirection.rtl ? loader : text, - const SizedBox(width: 8.0) + const SizedBox(width: 8.0), ], ), ], diff --git a/lib/ui/components/buttons/button_widget.dart b/lib/ui/components/buttons/button_widget.dart index 36f79a364c..28d62f4a66 100644 --- a/lib/ui/components/buttons/button_widget.dart +++ b/lib/ui/components/buttons/button_widget.dart @@ -308,7 +308,7 @@ class _ButtonChildWidgetState extends State { overflow: TextOverflow.ellipsis, ), ), - ) + ), ], ); }, diff --git a/lib/ui/components/captioned_text_widget.dart b/lib/ui/components/captioned_text_widget.dart index 77a161bde2..f03c8551fd 100644 --- a/lib/ui/components/captioned_text_widget.dart +++ b/lib/ui/components/captioned_text_widget.dart @@ -48,7 +48,7 @@ class CaptionedTextWidget extends StatelessWidget { ], ), ), - ) + ), ], ), ), diff --git a/lib/ui/components/dialog_widget.dart b/lib/ui/components/dialog_widget.dart index 02311fc53f..ab96a0dbe8 100644 --- a/lib/ui/components/dialog_widget.dart +++ b/lib/ui/components/dialog_widget.dart @@ -280,7 +280,7 @@ class _TextInputDialogState extends State { ), ), ], - ) + ), ], ), ), diff --git a/lib/ui/components/title_bar_widget.dart b/lib/ui/components/title_bar_widget.dart index 6ee76e1a08..8e22d4f65f 100644 --- a/lib/ui/components/title_bar_widget.dart +++ b/lib/ui/components/title_bar_widget.dart @@ -61,7 +61,7 @@ class TitleBarWidget extends StatelessWidget { : Text( caption!, style: textTheme.mini.copyWith(color: colorTheme.textMuted), - ) + ), ], ), ), @@ -112,7 +112,7 @@ class TitleBarWidget extends StatelessWidget { ), overflow: TextOverflow.ellipsis, maxLines: 1, - ) + ), ], ), ), diff --git a/lib/ui/home/coach_mark_widget.dart b/lib/ui/home/coach_mark_widget.dart index 9b4b8b48cd..b0e15d7d2b 100644 --- a/lib/ui/home/coach_mark_widget.dart +++ b/lib/ui/home/coach_mark_widget.dart @@ -56,7 +56,7 @@ class CoachMarkWidget extends StatelessWidget { }, child: Text(l10n.ok), ), - ) + ), ], ), ], diff --git a/lib/ui/scanner_gauth_page.dart b/lib/ui/scanner_gauth_page.dart index 41909ed325..9c94a26a6c 100644 --- a/lib/ui/scanner_gauth_page.dart +++ b/lib/ui/scanner_gauth_page.dart @@ -56,7 +56,7 @@ class ScannerGoogleAuthPageState extends State { child: Center( child: (totp != null) ? Text(totp!) : Text(l10n.scanACode), ), - ) + ), ], ), ); diff --git a/lib/ui/scanner_page.dart b/lib/ui/scanner_page.dart index 97ff1278a1..0159f0cfab 100644 --- a/lib/ui/scanner_page.dart +++ b/lib/ui/scanner_page.dart @@ -51,7 +51,7 @@ class ScannerPageState extends State { child: Center( child: (totp != null) ? Text(totp!) : Text(l10n.scanACode), ), - ) + ), ], ), ); diff --git a/lib/ui/settings/faq.dart b/lib/ui/settings/faq.dart index 3d5c78ab82..d9aa88f1b0 100644 --- a/lib/ui/settings/faq.dart +++ b/lib/ui/settings/faq.dart @@ -95,7 +95,7 @@ class FaqWidget extends StatelessWidget { ), ), ), - ) + ), ], ), ); diff --git a/lib/ui/settings/support_dev_widget.dart b/lib/ui/settings/support_dev_widget.dart index 0a28352b12..0025a6e2b9 100644 --- a/lib/ui/settings/support_dev_widget.dart +++ b/lib/ui/settings/support_dev_widget.dart @@ -1,5 +1,3 @@ -import 'dart:io'; - import 'package:ente_auth/core/configuration.dart'; import 'package:ente_auth/l10n/l10n.dart'; import 'package:ente_auth/models/subscription.dart'; diff --git a/lib/utils/device_info.dart b/lib/utils/device_info.dart index 10ca82c2a0..5832ec6de7 100644 --- a/lib/utils/device_info.dart +++ b/lib/utils/device_info.dart @@ -27,7 +27,7 @@ late Set iOSLowEndMachineCodes = { "iPhone10,2", // iPhone 8 Plus "iPhone10,3", // iPhone X Global "iPhone10,4", // iPhone 8 - "iPhone10,5" // iPhone 8 + "iPhone10,5", // iPhone 8 }; Future isLowSpecDevice() async { diff --git a/lib/utils/email_util.dart b/lib/utils/email_util.dart index cdbbfda123..d1ae183958 100644 --- a/lib/utils/email_util.dart +++ b/lib/utils/email_util.dart @@ -277,7 +277,7 @@ void _showNoMailAppsDialog(BuildContext context, String toEmail) { onPressed: () { Navigator.pop(context); }, - ) + ), ], ); }, diff --git a/pubspec.lock b/pubspec.lock index 79b0ae47fa..531462fbb7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -197,10 +197,10 @@ packages: dependency: "direct main" description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.17.2" computer: dependency: "direct main" description: @@ -699,10 +699,10 @@ packages: dependency: "direct main" description: name: intl - sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6 + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" url: "https://pub.dev" source: hosted - version: "0.18.0" + version: "0.18.1" io: dependency: transitive description: @@ -795,18 +795,18 @@ packages: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" meta: dependency: transitive description: @@ -1288,10 +1288,10 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" sqflite: dependency: "direct main" description: @@ -1376,26 +1376,26 @@ packages: dependency: transitive description: name: test - sha256: "3dac9aecf2c3991d09b9cdde4f98ded7b30804a88a0d7e4e7e1678e78d6b97f4" + sha256: "13b41f318e2a5751c3169137103b60c584297353d4b1761b66029bae6411fe46" url: "https://pub.dev" source: hosted - version: "1.24.1" + version: "1.24.3" test_api: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.0" test_core: dependency: transitive description: name: test_core - sha256: "5138dbffb77b2289ecb12b81c11ba46036590b72a64a7a90d6ffb880f1a29e93" + sha256: "99806e9e6d95c7b059b7a0fc08f07fc53fabe54a829497f0d9676299f1e8637e" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.5.3" timezone: dependency: transitive description: @@ -1580,6 +1580,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.2" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" + source: hosted + version: "0.1.4-beta" web_socket_channel: dependency: transitive description: @@ -1637,5 +1645,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.0.0 <4.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=3.7.0" From 02750dd8da591e4298a68c64874e519e8d5f1e5e Mon Sep 17 00:00:00 2001 From: ashilkn Date: Thu, 5 Oct 2023 13:29:15 +0530 Subject: [PATCH 2/2] feat(screen-refresh-rate): use flutter_displaymode to enable high refresh rates in devices with refresh rate locked at 60FPS --- lib/main.dart | 2 ++ pubspec.lock | 8 ++++++++ pubspec.yaml | 1 + 3 files changed, 11 insertions(+) diff --git a/lib/main.dart b/lib/main.dart index 20d6dd9b0a..4f82fffe34 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -21,6 +21,7 @@ import 'package:ente_auth/ui/utils/icon_utils.dart'; import 'package:ente_auth/utils/crypto_util.dart'; import 'package:flutter/foundation.dart'; import "package:flutter/material.dart"; +import 'package:flutter_displaymode/flutter_displaymode.dart'; import 'package:logging/logging.dart'; import 'package:path_provider/path_provider.dart'; @@ -30,6 +31,7 @@ void main() async { WidgetsFlutterBinding.ensureInitialized(); final savedThemeMode = await AdaptiveTheme.getThemeMode(); await _runInForeground(savedThemeMode); + FlutterDisplayMode.setHighRefreshRate(); } Future _runInForeground(AdaptiveThemeMode? savedThemeMode) async { diff --git a/pubspec.lock b/pubspec.lock index 531462fbb7..f290a3e0cf 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -447,6 +447,14 @@ packages: url: "https://pub.dev" source: hosted version: "8.1.3" + flutter_displaymode: + dependency: "direct main" + description: + name: flutter_displaymode + sha256: "42c5e9abd13d28ed74f701b60529d7f8416947e58256e6659c5550db719c57ef" + url: "https://pub.dev" + source: hosted + version: "0.6.0" flutter_email_sender: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index bf70f5e16d..f39afe0eea 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -31,6 +31,7 @@ dependencies: flutter: sdk: flutter flutter_bloc: ^8.0.1 + flutter_displaymode: ^0.6.0 flutter_email_sender: ^5.1.0 flutter_inappwebview: ^5.7.1 flutter_launcher_icons: ^0.9.3