mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-06-29 20:39:51 +00:00
Compare commits
No commits in common. "master" and "2.20.3_(150)" have entirely different histories.
master
...
2.20.3_(15
7 changed files with 160 additions and 133 deletions
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
|
@ -17,4 +17,5 @@
|
||||||
"/pubspec.yaml",
|
"/pubspec.yaml",
|
||||||
"/.github/workflows"
|
"/.github/workflows"
|
||||||
],
|
],
|
||||||
|
"dart.flutterRunAdditionalArgs": [ "--no-enable-impeller" ]
|
||||||
}
|
}
|
|
@ -113,6 +113,7 @@ If you like the project and you want to contribute with the development, you can
|
||||||
- [expandable](https://pub.dev/packages/expandable)
|
- [expandable](https://pub.dev/packages/expandable)
|
||||||
- [package info plus](https://pub.dev/packages/package_info_plus)
|
- [package info plus](https://pub.dev/packages/package_info_plus)
|
||||||
- [flutter phoenix](https://pub.dev/packages/flutter_phoenix)
|
- [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 launcher icons](https://pub.dev/packages/flutter_launcher_icons)
|
||||||
- [flutter native splash](https://pub.dev/packages/flutter_native_splash)
|
- [flutter native splash](https://pub.dev/packages/flutter_native_splash)
|
||||||
- [intl](https://pub.dev/packages/intl)
|
- [intl](https://pub.dev/packages/intl)
|
||||||
|
|
|
@ -27,12 +27,11 @@ ThemeData lightTheme(ColorScheme? dynamicColorScheme) => ThemeData(
|
||||||
dialogTheme: DialogTheme(
|
dialogTheme: DialogTheme(
|
||||||
surfaceTintColor: dynamicColorScheme?.surfaceTint
|
surfaceTintColor: dynamicColorScheme?.surfaceTint
|
||||||
),
|
),
|
||||||
// DISABLE PREDICTIVE BACK GESTURE
|
pageTransitionsTheme: const PageTransitionsTheme(
|
||||||
// pageTransitionsTheme: const PageTransitionsTheme(
|
builders: {
|
||||||
// builders: {
|
TargetPlatform.android: PredictiveBackPageTransitionsBuilder()
|
||||||
// TargetPlatform.android: PredictiveBackPageTransitionsBuilder()
|
}
|
||||||
// }
|
)
|
||||||
// )
|
|
||||||
);
|
);
|
||||||
|
|
||||||
ThemeData darkTheme(ColorScheme? dynamicColorScheme) => ThemeData(
|
ThemeData darkTheme(ColorScheme? dynamicColorScheme) => ThemeData(
|
||||||
|
@ -63,12 +62,11 @@ ThemeData darkTheme(ColorScheme? dynamicColorScheme) => ThemeData(
|
||||||
dialogTheme: DialogTheme(
|
dialogTheme: DialogTheme(
|
||||||
surfaceTintColor: dynamicColorScheme?.surfaceTint
|
surfaceTintColor: dynamicColorScheme?.surfaceTint
|
||||||
),
|
),
|
||||||
// DISABLE PREDICTIVE BACK GESTURE
|
pageTransitionsTheme: const PageTransitionsTheme(
|
||||||
// pageTransitionsTheme: const PageTransitionsTheme(
|
builders: {
|
||||||
// builders: {
|
TargetPlatform.android: PredictiveBackPageTransitionsBuilder()
|
||||||
// TargetPlatform.android: PredictiveBackPageTransitionsBuilder()
|
}
|
||||||
// }
|
)
|
||||||
// )
|
|
||||||
);
|
);
|
||||||
|
|
||||||
ThemeData lightThemeOldVersions(MaterialColor primaryColor) => ThemeData(
|
ThemeData lightThemeOldVersions(MaterialColor primaryColor) => ThemeData(
|
||||||
|
@ -87,12 +85,11 @@ ThemeData lightThemeOldVersions(MaterialColor primaryColor) => ThemeData(
|
||||||
iconColor: Color.fromRGBO(117, 117, 117, 1),
|
iconColor: Color.fromRGBO(117, 117, 117, 1),
|
||||||
),
|
),
|
||||||
brightness: Brightness.light,
|
brightness: Brightness.light,
|
||||||
// DISABLE PREDICTIVE BACK GESTURE
|
pageTransitionsTheme: const PageTransitionsTheme(
|
||||||
// pageTransitionsTheme: const PageTransitionsTheme(
|
builders: {
|
||||||
// builders: {
|
TargetPlatform.android: PredictiveBackPageTransitionsBuilder()
|
||||||
// TargetPlatform.android: PredictiveBackPageTransitionsBuilder()
|
}
|
||||||
// }
|
)
|
||||||
// )
|
|
||||||
);
|
);
|
||||||
|
|
||||||
ThemeData darkThemeOldVersions(MaterialColor primaryColor) => ThemeData(
|
ThemeData darkThemeOldVersions(MaterialColor primaryColor) => ThemeData(
|
||||||
|
@ -114,10 +111,9 @@ ThemeData darkThemeOldVersions(MaterialColor primaryColor) => ThemeData(
|
||||||
iconColor: Color.fromRGBO(187, 187, 187, 1),
|
iconColor: Color.fromRGBO(187, 187, 187, 1),
|
||||||
),
|
),
|
||||||
brightness: Brightness.dark,
|
brightness: Brightness.dark,
|
||||||
// DISABLE PREDICTIVE BACK GESTURE
|
pageTransitionsTheme: const PageTransitionsTheme(
|
||||||
// pageTransitionsTheme: const PageTransitionsTheme(
|
builders: {
|
||||||
// builders: {
|
TargetPlatform.android: PredictiveBackPageTransitionsBuilder()
|
||||||
// TargetPlatform.android: PredictiveBackPageTransitionsBuilder()
|
}
|
||||||
// }
|
)
|
||||||
// )
|
|
||||||
);
|
);
|
|
@ -5,6 +5,7 @@ import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:flutter_displaymode/flutter_displaymode.dart';
|
||||||
import 'package:dynamic_color/dynamic_color.dart';
|
import 'package:dynamic_color/dynamic_color.dart';
|
||||||
import 'package:device_info_plus/device_info_plus.dart';
|
import 'package:device_info_plus/device_info_plus.dart';
|
||||||
import 'package:package_info_plus/package_info_plus.dart';
|
import 'package:package_info_plus/package_info_plus.dart';
|
||||||
|
@ -196,9 +197,37 @@ void main() async {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Main extends StatelessWidget {
|
class Main extends StatefulWidget {
|
||||||
const Main({super.key});
|
const Main({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<Main> createState() => _MainState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MainState extends State<Main> {
|
||||||
|
List<DisplayMode> modes = <DisplayMode>[];
|
||||||
|
DisplayMode? active;
|
||||||
|
DisplayMode? preferred;
|
||||||
|
|
||||||
|
Future<void> 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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final appConfigProvider = Provider.of<AppConfigProvider>(context);
|
final appConfigProvider = Provider.of<AppConfigProvider>(context);
|
||||||
|
|
|
@ -218,110 +218,101 @@ class _Header extends SliverPersistentHeaderDelegate {
|
||||||
final iconBottom = _iconMinBottomPositionExent + (iconMaxBottomPositionExent-iconMinBottomPositionExent)*(1-iconPercentage);
|
final iconBottom = _iconMinBottomPositionExent + (iconMaxBottomPositionExent-iconMinBottomPositionExent)*(1-iconPercentage);
|
||||||
|
|
||||||
return LayoutBuilder(
|
return LayoutBuilder(
|
||||||
builder: (context, constraints) => Stack(
|
builder: (context, constraints) => Container(
|
||||||
children: [
|
decoration: BoxDecoration(
|
||||||
Container(
|
color: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||||
decoration: BoxDecoration(
|
),
|
||||||
color: Theme.of(context).colorScheme.surface,
|
child: Align(
|
||||||
),
|
alignment: Alignment.topLeft,
|
||||||
),
|
child: SafeArea(
|
||||||
Container(
|
bottom: false,
|
||||||
decoration: BoxDecoration(
|
child: Stack(
|
||||||
color: Theme.of(context).colorScheme.surfaceTint.withOpacity(0.075),
|
fit: StackFit.expand,
|
||||||
),
|
alignment: Alignment.center,
|
||||||
child: Align(
|
children: [
|
||||||
alignment: Alignment.topLeft,
|
if (Navigator.of(context).canPop()) Positioned(
|
||||||
child: SafeArea(
|
top: 8,
|
||||||
bottom: false,
|
left: 0,
|
||||||
child: Stack(
|
child: BackButton(
|
||||||
fit: StackFit.expand,
|
onPressed: () => Navigator.pop(context),
|
||||||
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
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
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
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
20
pubspec.lock
20
pubspec.lock
|
@ -29,10 +29,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: archive
|
name: archive
|
||||||
sha256: "7dcbd0f87fe5f61cb28da39a1a8b70dbc106e2fe0516f7836eb7bb2948481a12"
|
sha256: "0c64e928dcbefddecd234205422bcfc2b5e6d31be0b86fef0d0dd48d7b4c9742"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.5"
|
version: "4.0.4"
|
||||||
args:
|
args:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -254,6 +254,14 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
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:
|
flutter_dotenv:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -361,10 +369,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: image
|
name: image
|
||||||
sha256: "4e973fcf4caae1a4be2fa0a13157aa38a8f9cb049db6529aa00b4d71abc4d928"
|
sha256: "13d3349ace88f12f4a0d175eb5c12dcdd39d35c4c109a8a13dfeb6d0bd9e31c3"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.5.4"
|
version: "4.5.3"
|
||||||
intl:
|
intl:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -774,10 +782,10 @@ packages:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: sqlite3_flutter_libs
|
name: sqlite3_flutter_libs
|
||||||
sha256: "1a96b59227828d9eb1463191d684b37a27d66ee5ed7597fcf42eee6452c88a14"
|
sha256: "7adb4cc96dc08648a5eb1d80a7619070796ca6db03901ff2b6dcb15ee30468f3"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.5.32"
|
version: "0.5.31"
|
||||||
stack_trace:
|
stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -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
|
# 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
|
# 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.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 2.20.4+151
|
version: 2.20.3+150
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.18.1 <3.0.0'
|
sdk: '>=2.18.1 <3.0.0'
|
||||||
|
@ -42,6 +42,7 @@ dependencies:
|
||||||
provider: ^6.1.1
|
provider: ^6.1.1
|
||||||
sqflite: ^2.3.0
|
sqflite: ^2.3.0
|
||||||
package_info_plus: ^8.0.0
|
package_info_plus: ^8.0.0
|
||||||
|
flutter_displaymode: ^0.6.0
|
||||||
dynamic_color: ^1.7.0
|
dynamic_color: ^1.7.0
|
||||||
animations: ^2.0.10
|
animations: ^2.0.10
|
||||||
device_info_plus: ^11.2.1
|
device_info_plus: ^11.2.1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue