From e6a01ac546638527f88bc1099903d531e71aa6fa Mon Sep 17 00:00:00 2001 From: Juan Gilsanz Polo Date: Sun, 23 Mar 2025 19:18:43 +0100 Subject: [PATCH 1/4] Disabled predictive back gesture --- lib/config/theme.dart | 44 +++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/lib/config/theme.dart b/lib/config/theme.dart index 93b5365..eba0b9c 100644 --- a/lib/config/theme.dart +++ b/lib/config/theme.dart @@ -27,11 +27,12 @@ ThemeData lightTheme(ColorScheme? dynamicColorScheme) => ThemeData( dialogTheme: DialogTheme( surfaceTintColor: dynamicColorScheme?.surfaceTint ), - pageTransitionsTheme: const PageTransitionsTheme( - builders: { - TargetPlatform.android: PredictiveBackPageTransitionsBuilder() - } - ) + // DISABLE PREDICTIVE BACK GESTURE + // pageTransitionsTheme: const PageTransitionsTheme( + // builders: { + // TargetPlatform.android: PredictiveBackPageTransitionsBuilder() + // } + // ) ); ThemeData darkTheme(ColorScheme? dynamicColorScheme) => ThemeData( @@ -62,11 +63,12 @@ ThemeData darkTheme(ColorScheme? dynamicColorScheme) => ThemeData( dialogTheme: DialogTheme( surfaceTintColor: dynamicColorScheme?.surfaceTint ), - pageTransitionsTheme: const PageTransitionsTheme( - builders: { - TargetPlatform.android: PredictiveBackPageTransitionsBuilder() - } - ) + // DISABLE PREDICTIVE BACK GESTURE + // pageTransitionsTheme: const PageTransitionsTheme( + // builders: { + // TargetPlatform.android: PredictiveBackPageTransitionsBuilder() + // } + // ) ); ThemeData lightThemeOldVersions(MaterialColor primaryColor) => ThemeData( @@ -85,11 +87,12 @@ ThemeData lightThemeOldVersions(MaterialColor primaryColor) => ThemeData( iconColor: Color.fromRGBO(117, 117, 117, 1), ), brightness: Brightness.light, - pageTransitionsTheme: const PageTransitionsTheme( - builders: { - TargetPlatform.android: PredictiveBackPageTransitionsBuilder() - } - ) + // DISABLE PREDICTIVE BACK GESTURE + // pageTransitionsTheme: const PageTransitionsTheme( + // builders: { + // TargetPlatform.android: PredictiveBackPageTransitionsBuilder() + // } + // ) ); ThemeData darkThemeOldVersions(MaterialColor primaryColor) => ThemeData( @@ -111,9 +114,10 @@ ThemeData darkThemeOldVersions(MaterialColor primaryColor) => ThemeData( iconColor: Color.fromRGBO(187, 187, 187, 1), ), brightness: Brightness.dark, - pageTransitionsTheme: const PageTransitionsTheme( - builders: { - TargetPlatform.android: PredictiveBackPageTransitionsBuilder() - } - ) + // DISABLE PREDICTIVE BACK GESTURE + // pageTransitionsTheme: const PageTransitionsTheme( + // builders: { + // TargetPlatform.android: PredictiveBackPageTransitionsBuilder() + // } + // ) ); \ No newline at end of file From 8e5bbdbd4b0e0ec5968184a5abf6c890b14a90b0 Mon Sep 17 00:00:00 2001 From: Juan Gilsanz Polo Date: Sun, 23 Mar 2025 19:18:51 +0100 Subject: [PATCH 2/4] Fixed update screen header color --- .../settings/update_server/update_screen.dart | 195 +++++++++--------- 1 file changed, 102 insertions(+), 93 deletions(-) diff --git a/lib/screens/settings/update_server/update_screen.dart b/lib/screens/settings/update_server/update_screen.dart index 4ddc959..ae894f8 100644 --- a/lib/screens/settings/update_server/update_screen.dart +++ b/lib/screens/settings/update_server/update_screen.dart @@ -218,101 +218,110 @@ class _Header extends SliverPersistentHeaderDelegate { final iconBottom = _iconMinBottomPositionExent + (iconMaxBottomPositionExent-iconMinBottomPositionExent)*(1-iconPercentage); return LayoutBuilder( - builder: (context, constraints) => Container( - decoration: BoxDecoration( - color: Theme.of(context).colorScheme.surfaceContainerHighest, - ), - child: Align( - alignment: Alignment.topLeft, - child: SafeArea( - bottom: false, - child: Stack( - fit: StackFit.expand, - alignment: Alignment.center, - children: [ - if (Navigator.of(context).canPop()) Positioned( - top: 8, - left: 0, - child: BackButton( - onPressed: () => Navigator.pop(context), - ), - ), - Positioned( - top: 8, - right: 0, - child: IconButton( - onPressed: onRefresh, - icon: const Icon(Icons.refresh_rounded), - tooltip: AppLocalizations.of(context)!.refresh, - ) - ), - Positioned( - bottom: iconBottom, - left: (constraints.maxWidth/2)-(_iconSize/2), - child: Opacity( - opacity: 1-iconPercentage, - child: serversProvider.updateAvailable.loadStatus == LoadStatus.loading - ? const Column( - children: [ - CircularProgressIndicator(), - SizedBox(height: 4) - ], - ) - : Icon( - serversProvider.updateAvailable.data!.canAutoupdate == true - ? Icons.system_update_rounded - : Icons.system_security_update_good_rounded, - size: _iconSize, - color: Theme.of(context).colorScheme.primary, - ), - ), - ), - Positioned( - bottom: mainText, - child: ConstrainedBox( - constraints: BoxConstraints( - maxWidth: constraints.maxWidth-100 - ), - child: Text( - serversProvider.updateAvailable.loadStatus == LoadStatus.loading - ? AppLocalizations.of(context)!.checkingUpdates - : serversProvider.updateAvailable.data!.canAutoupdate == true - ? AppLocalizations.of(context)!.updateAvailable - : AppLocalizations.of(context)!.serverUpdated, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: textFontSize, - fontWeight: FontWeight.w400 - ), - ), - ) - ), - Positioned( - bottom: versionText, - child: ConstrainedBox( - constraints: BoxConstraints( - maxWidth: constraints.maxWidth-100 - ), - child: Opacity( - opacity: 1-iconPercentage, - child: Text( - serversProvider.updateAvailable.data!.canAutoupdate == true - ? "${AppLocalizations.of(context)!.newVersion}: ${serversProvider.updateAvailable.data!.newVersion ?? 'N/A'}" - : "${AppLocalizations.of(context)!.installedVersion}: ${serversProvider.updateAvailable.data!.currentVersion}", - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w700, - color: Theme.of(context).colorScheme.onSurfaceVariant - ), - ), - ), - ) - ) - ], + builder: (context, constraints) => Stack( + children: [ + Container( + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.surface, ), ), - ), + Container( + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.surfaceTint.withOpacity(0.075), + ), + child: Align( + alignment: Alignment.topLeft, + child: SafeArea( + bottom: false, + child: Stack( + fit: StackFit.expand, + alignment: Alignment.center, + children: [ + if (Navigator.of(context).canPop()) Positioned( + top: 8, + left: 0, + child: BackButton( + onPressed: () => Navigator.pop(context), + ), + ), + Positioned( + top: 8, + right: 0, + child: IconButton( + onPressed: onRefresh, + icon: const Icon(Icons.refresh_rounded), + tooltip: AppLocalizations.of(context)!.refresh, + ) + ), + Positioned( + bottom: iconBottom, + left: (constraints.maxWidth/2)-(_iconSize/2), + child: Opacity( + opacity: 1-iconPercentage, + child: serversProvider.updateAvailable.loadStatus == LoadStatus.loading + ? const Column( + children: [ + CircularProgressIndicator(), + SizedBox(height: 4) + ], + ) + : Icon( + serversProvider.updateAvailable.data!.canAutoupdate == true + ? Icons.system_update_rounded + : Icons.system_security_update_good_rounded, + size: _iconSize, + color: Theme.of(context).colorScheme.primary, + ), + ), + ), + Positioned( + bottom: mainText, + child: ConstrainedBox( + constraints: BoxConstraints( + maxWidth: constraints.maxWidth-100 + ), + child: Text( + serversProvider.updateAvailable.loadStatus == LoadStatus.loading + ? AppLocalizations.of(context)!.checkingUpdates + : serversProvider.updateAvailable.data!.canAutoupdate == true + ? AppLocalizations.of(context)!.updateAvailable + : AppLocalizations.of(context)!.serverUpdated, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: textFontSize, + fontWeight: FontWeight.w400 + ), + ), + ) + ), + Positioned( + bottom: versionText, + child: ConstrainedBox( + constraints: BoxConstraints( + maxWidth: constraints.maxWidth-100 + ), + child: Opacity( + opacity: 1-iconPercentage, + child: Text( + serversProvider.updateAvailable.data!.canAutoupdate == true + ? "${AppLocalizations.of(context)!.newVersion}: ${serversProvider.updateAvailable.data!.newVersion ?? 'N/A'}" + : "${AppLocalizations.of(context)!.installedVersion}: ${serversProvider.updateAvailable.data!.currentVersion}", + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w700, + color: Theme.of(context).colorScheme.onSurfaceVariant + ), + ), + ), + ) + ) + ], + ), + ), + ), + ), + ], ), ); } From 52945b04ffe27b447b5eb8def1ecb34bae9ac946 Mon Sep 17 00:00:00 2001 From: Juan Gilsanz Polo Date: Sun, 23 Mar 2025 19:46:52 +0100 Subject: [PATCH 3/4] Removed flutter displaymode --- .vscode/settings.json | 1 - README.md | 1 - lib/main.dart | 31 +------------------------------ pubspec.lock | 20 ++++++-------------- pubspec.yaml | 1 - 5 files changed, 7 insertions(+), 47 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 553928e..fab9821 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -17,5 +17,4 @@ "/pubspec.yaml", "/.github/workflows" ], - "dart.flutterRunAdditionalArgs": [ "--no-enable-impeller" ] } \ No newline at end of file diff --git a/README.md b/README.md index 843bff8..1dcbc67 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,6 @@ If you like the project and you want to contribute with the development, you can - [expandable](https://pub.dev/packages/expandable) - [package info plus](https://pub.dev/packages/package_info_plus) - [flutter phoenix](https://pub.dev/packages/flutter_phoenix) -- [flutter displaymode](https://pub.dev/packages/flutter_displaymode) - [flutter launcher icons](https://pub.dev/packages/flutter_launcher_icons) - [flutter native splash](https://pub.dev/packages/flutter_native_splash) - [intl](https://pub.dev/packages/intl) diff --git a/lib/main.dart b/lib/main.dart index 61126da..6402b70 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -5,7 +5,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:provider/provider.dart'; -import 'package:flutter_displaymode/flutter_displaymode.dart'; import 'package:dynamic_color/dynamic_color.dart'; import 'package:device_info_plus/device_info_plus.dart'; import 'package:package_info_plus/package_info_plus.dart'; @@ -197,37 +196,9 @@ void main() async { } } -class Main extends StatefulWidget { +class Main extends StatelessWidget { const Main({super.key}); - @override - State
createState() => _MainState(); -} - -class _MainState extends State
{ - List modes = []; - DisplayMode? active; - DisplayMode? preferred; - - Future displayMode() async { - try { - modes = await FlutterDisplayMode.supported; - preferred = await FlutterDisplayMode.preferred; - active = await FlutterDisplayMode.active; - await FlutterDisplayMode.setHighRefreshRate(); - setState(() {}); - } catch (_) { - // ---- // - } - } - - @override - void initState() { - displayMode(); - - super.initState(); - } - @override Widget build(BuildContext context) { final appConfigProvider = Provider.of(context); diff --git a/pubspec.lock b/pubspec.lock index d407566..207783c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -29,10 +29,10 @@ packages: dependency: transitive description: name: archive - sha256: "0c64e928dcbefddecd234205422bcfc2b5e6d31be0b86fef0d0dd48d7b4c9742" + sha256: "7dcbd0f87fe5f61cb28da39a1a8b70dbc106e2fe0516f7836eb7bb2948481a12" url: "https://pub.dev" source: hosted - version: "4.0.4" + version: "4.0.5" args: dependency: transitive description: @@ -254,14 +254,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.0" - flutter_displaymode: - dependency: "direct main" - description: - name: flutter_displaymode - sha256: "42c5e9abd13d28ed74f701b60529d7f8416947e58256e6659c5550db719c57ef" - url: "https://pub.dev" - source: hosted - version: "0.6.0" flutter_dotenv: dependency: "direct main" description: @@ -369,10 +361,10 @@ packages: dependency: transitive description: name: image - sha256: "13d3349ace88f12f4a0d175eb5c12dcdd39d35c4c109a8a13dfeb6d0bd9e31c3" + sha256: "4e973fcf4caae1a4be2fa0a13157aa38a8f9cb049db6529aa00b4d71abc4d928" url: "https://pub.dev" source: hosted - version: "4.5.3" + version: "4.5.4" intl: dependency: "direct main" description: @@ -782,10 +774,10 @@ packages: dependency: "direct main" description: name: sqlite3_flutter_libs - sha256: "7adb4cc96dc08648a5eb1d80a7619070796ca6db03901ff2b6dcb15ee30468f3" + sha256: "1a96b59227828d9eb1463191d684b37a27d66ee5ed7597fcf42eee6452c88a14" url: "https://pub.dev" source: hosted - version: "0.5.31" + version: "0.5.32" stack_trace: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 306048b..a4e32b5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -42,7 +42,6 @@ dependencies: provider: ^6.1.1 sqflite: ^2.3.0 package_info_plus: ^8.0.0 - flutter_displaymode: ^0.6.0 dynamic_color: ^1.7.0 animations: ^2.0.10 device_info_plus: ^11.2.1 From 61b0f724bac65e9ede1b36b6fa9fb55b4e6dec13 Mon Sep 17 00:00:00 2001 From: Juan Gilsanz Polo Date: Sun, 23 Mar 2025 19:51:58 +0100 Subject: [PATCH 4/4] Updated app version --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index a4e32b5..2fffd97 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,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: 2.20.3+150 +version: 2.20.4+151 environment: sdk: '>=2.18.1 <3.0.0'