mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-04-22 06:49:11 +00:00
Compare commits
5 commits
2.20.3_(15
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
a4bf4cd3c5 | ||
|
61b0f724ba | ||
|
52945b04ff | ||
|
8e5bbdbd4b | ||
|
e6a01ac546 |
7 changed files with 134 additions and 161 deletions
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
|
@ -17,5 +17,4 @@
|
||||||
"/pubspec.yaml",
|
"/pubspec.yaml",
|
||||||
"/.github/workflows"
|
"/.github/workflows"
|
||||||
],
|
],
|
||||||
"dart.flutterRunAdditionalArgs": [ "--no-enable-impeller" ]
|
|
||||||
}
|
}
|
|
@ -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)
|
- [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,11 +27,12 @@ ThemeData lightTheme(ColorScheme? dynamicColorScheme) => ThemeData(
|
||||||
dialogTheme: DialogTheme(
|
dialogTheme: DialogTheme(
|
||||||
surfaceTintColor: dynamicColorScheme?.surfaceTint
|
surfaceTintColor: dynamicColorScheme?.surfaceTint
|
||||||
),
|
),
|
||||||
pageTransitionsTheme: const PageTransitionsTheme(
|
// DISABLE PREDICTIVE BACK GESTURE
|
||||||
builders: {
|
// pageTransitionsTheme: const PageTransitionsTheme(
|
||||||
TargetPlatform.android: PredictiveBackPageTransitionsBuilder()
|
// builders: {
|
||||||
}
|
// TargetPlatform.android: PredictiveBackPageTransitionsBuilder()
|
||||||
)
|
// }
|
||||||
|
// )
|
||||||
);
|
);
|
||||||
|
|
||||||
ThemeData darkTheme(ColorScheme? dynamicColorScheme) => ThemeData(
|
ThemeData darkTheme(ColorScheme? dynamicColorScheme) => ThemeData(
|
||||||
|
@ -62,11 +63,12 @@ ThemeData darkTheme(ColorScheme? dynamicColorScheme) => ThemeData(
|
||||||
dialogTheme: DialogTheme(
|
dialogTheme: DialogTheme(
|
||||||
surfaceTintColor: dynamicColorScheme?.surfaceTint
|
surfaceTintColor: dynamicColorScheme?.surfaceTint
|
||||||
),
|
),
|
||||||
pageTransitionsTheme: const PageTransitionsTheme(
|
// DISABLE PREDICTIVE BACK GESTURE
|
||||||
builders: {
|
// pageTransitionsTheme: const PageTransitionsTheme(
|
||||||
TargetPlatform.android: PredictiveBackPageTransitionsBuilder()
|
// builders: {
|
||||||
}
|
// TargetPlatform.android: PredictiveBackPageTransitionsBuilder()
|
||||||
)
|
// }
|
||||||
|
// )
|
||||||
);
|
);
|
||||||
|
|
||||||
ThemeData lightThemeOldVersions(MaterialColor primaryColor) => ThemeData(
|
ThemeData lightThemeOldVersions(MaterialColor primaryColor) => ThemeData(
|
||||||
|
@ -85,11 +87,12 @@ 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,
|
||||||
pageTransitionsTheme: const PageTransitionsTheme(
|
// DISABLE PREDICTIVE BACK GESTURE
|
||||||
builders: {
|
// pageTransitionsTheme: const PageTransitionsTheme(
|
||||||
TargetPlatform.android: PredictiveBackPageTransitionsBuilder()
|
// builders: {
|
||||||
}
|
// TargetPlatform.android: PredictiveBackPageTransitionsBuilder()
|
||||||
)
|
// }
|
||||||
|
// )
|
||||||
);
|
);
|
||||||
|
|
||||||
ThemeData darkThemeOldVersions(MaterialColor primaryColor) => ThemeData(
|
ThemeData darkThemeOldVersions(MaterialColor primaryColor) => ThemeData(
|
||||||
|
@ -111,9 +114,10 @@ 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,
|
||||||
pageTransitionsTheme: const PageTransitionsTheme(
|
// DISABLE PREDICTIVE BACK GESTURE
|
||||||
builders: {
|
// pageTransitionsTheme: const PageTransitionsTheme(
|
||||||
TargetPlatform.android: PredictiveBackPageTransitionsBuilder()
|
// builders: {
|
||||||
}
|
// TargetPlatform.android: PredictiveBackPageTransitionsBuilder()
|
||||||
)
|
// }
|
||||||
|
// )
|
||||||
);
|
);
|
|
@ -5,7 +5,6 @@ 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';
|
||||||
|
@ -197,37 +196,9 @@ void main() async {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Main extends StatefulWidget {
|
class Main extends StatelessWidget {
|
||||||
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,101 +218,110 @@ 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) => Container(
|
builder: (context, constraints) => Stack(
|
||||||
decoration: BoxDecoration(
|
children: [
|
||||||
color: Theme.of(context).colorScheme.surfaceContainerHighest,
|
Container(
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
child: Align(
|
color: Theme.of(context).colorScheme.surface,
|
||||||
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
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
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
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
20
pubspec.lock
20
pubspec.lock
|
@ -29,10 +29,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: archive
|
name: archive
|
||||||
sha256: "0c64e928dcbefddecd234205422bcfc2b5e6d31be0b86fef0d0dd48d7b4c9742"
|
sha256: "7dcbd0f87fe5f61cb28da39a1a8b70dbc106e2fe0516f7836eb7bb2948481a12"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.4"
|
version: "4.0.5"
|
||||||
args:
|
args:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -254,14 +254,6 @@ 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:
|
||||||
|
@ -369,10 +361,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: image
|
name: image
|
||||||
sha256: "13d3349ace88f12f4a0d175eb5c12dcdd39d35c4c109a8a13dfeb6d0bd9e31c3"
|
sha256: "4e973fcf4caae1a4be2fa0a13157aa38a8f9cb049db6529aa00b4d71abc4d928"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.5.3"
|
version: "4.5.4"
|
||||||
intl:
|
intl:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -782,10 +774,10 @@ packages:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: sqlite3_flutter_libs
|
name: sqlite3_flutter_libs
|
||||||
sha256: "7adb4cc96dc08648a5eb1d80a7619070796ca6db03901ff2b6dcb15ee30468f3"
|
sha256: "1a96b59227828d9eb1463191d684b37a27d66ee5ed7597fcf42eee6452c88a14"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.5.31"
|
version: "0.5.32"
|
||||||
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.3+150
|
version: 2.20.4+151
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.18.1 <3.0.0'
|
sdk: '>=2.18.1 <3.0.0'
|
||||||
|
@ -42,7 +42,6 @@ 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
Reference in a new issue