Merge branch 'master' into add_copy_link_to_service_page

pull/461/head
Inex Code 2024-04-11 13:10:31 +03:00
commit f81eb6ae32
14 changed files with 262 additions and 334 deletions

View File

@ -52,8 +52,8 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "org.selfprivacy.app" applicationId "org.selfprivacy.app"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 33 targetSdkVersion 34
compileSdkVersion 33 compileSdkVersion 34
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
} }

View File

@ -24,8 +24,10 @@ abstract class AppThemeFactory {
final ColorScheme? dynamicColorsScheme = final ColorScheme? dynamicColorsScheme =
await _getDynamicColors(brightness); await _getDynamicColors(brightness);
final Color? accentColor = await _getAccentColor();
final ColorScheme fallbackColorScheme = ColorScheme.fromSeed( final ColorScheme fallbackColorScheme = ColorScheme.fromSeed(
seedColor: fallbackColor, seedColor: accentColor ?? fallbackColor,
brightness: brightness, brightness: brightness,
); );
@ -55,6 +57,14 @@ abstract class AppThemeFactory {
} }
} }
static Future<Color?> _getAccentColor() {
try {
return DynamicColorPlugin.getAccentColor();
} on PlatformException {
return Future.value(null);
}
}
static Future<CorePalette?> getCorePalette() async { static Future<CorePalette?> getCorePalette() async {
try { try {
return await DynamicColorPlugin.getCorePalette(); return await DynamicColorPlugin.getCorePalette();

View File

@ -100,7 +100,7 @@ class _RootAppBar extends StatelessWidget {
leading: context.router.pageCount > 1 leading: context.router.pageCount > 1
? IconButton( ? IconButton(
icon: const Icon(Icons.arrow_back), icon: const Icon(Icons.arrow_back),
onPressed: () => context.router.pop(), onPressed: () => context.router.maybePop(),
) )
: null, : null,
actions: const [ actions: const [

View File

@ -35,7 +35,8 @@ class CpuChart extends StatelessWidget {
lineTouchData: LineTouchData( lineTouchData: LineTouchData(
enabled: true, enabled: true,
touchTooltipData: LineTouchTooltipData( touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Theme.of(context).colorScheme.surface, getTooltipColor: (final LineBarSpot _) =>
Theme.of(context).colorScheme.surface,
tooltipPadding: const EdgeInsets.all(8), tooltipPadding: const EdgeInsets.all(8),
getTooltipItems: (final List<LineBarSpot> touchedBarSpots) { getTooltipItems: (final List<LineBarSpot> touchedBarSpots) {
final List<LineTooltipItem> res = []; final List<LineTooltipItem> res = [];

View File

@ -38,7 +38,8 @@ class NetworkChart extends StatelessWidget {
lineTouchData: LineTouchData( lineTouchData: LineTouchData(
enabled: true, enabled: true,
touchTooltipData: LineTouchTooltipData( touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Theme.of(context).colorScheme.surface, getTooltipColor: (final LineBarSpot _) =>
Theme.of(context).colorScheme.surface,
tooltipPadding: const EdgeInsets.all(8), tooltipPadding: const EdgeInsets.all(8),
getTooltipItems: (final List<LineBarSpot> touchedBarSpots) { getTooltipItems: (final List<LineBarSpot> touchedBarSpots) {
final List<LineTooltipItem> res = []; final List<LineTooltipItem> res = [];

View File

@ -43,8 +43,8 @@ class _ServerStoragePageState extends State<ServerStoragePage> {
return BrandHeroScreen( return BrandHeroScreen(
hasBackButton: true, hasBackButton: true,
heroTitle: 'storage.card_title'.tr(), heroTitle: 'storage.card_title'.tr(),
bodyPadding: const EdgeInsets.symmetric(vertical: 16.0),
children: [ children: [
// ...sections,
...widget.diskStatus.diskVolumes.map( ...widget.diskStatus.diskVolumes.map(
(final volume) => Column( (final volume) => Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@ -87,24 +87,35 @@ class ServerStorageSection extends StatelessWidget {
Widget build(final BuildContext context) => Column( Widget build(final BuildContext context) => Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
ServerStorageListItem( Padding(
volume: volume, padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: ServerStorageListItem(
volume: volume,
),
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
...services.map( ...services.map(
(final service) => ServerConsumptionListTile( (final service) => ServerConsumptionListTile(
service: service, service: service,
volume: volume, volume: volume,
onTap: () {
context.pushRoute(
ServiceRoute(serviceId: service.id),
);
},
), ),
), ),
if (volume.isResizable) ...[ if (volume.isResizable) ...[
const SizedBox(height: 16), const SizedBox(height: 16),
BrandOutlinedButton( Padding(
title: 'storage.extend_volume_button.title'.tr(), padding: const EdgeInsets.symmetric(horizontal: 16.0),
onPressed: () => context.pushRoute( child: BrandOutlinedButton(
ExtendingVolumeRoute( title: 'storage.extend_volume_button.title'.tr(),
diskVolumeToResize: volume, onPressed: () => context.pushRoute(
diskStatus: diskStatus, ExtendingVolumeRoute(
diskVolumeToResize: volume,
diskStatus: diskStatus,
),
), ),
), ),
), ),
@ -117,33 +128,38 @@ class ServerConsumptionListTile extends StatelessWidget {
const ServerConsumptionListTile({ const ServerConsumptionListTile({
required this.service, required this.service,
required this.volume, required this.volume,
required this.onTap,
super.key, super.key,
}); });
final Service service; final Service service;
final DiskVolume volume; final DiskVolume volume;
final VoidCallback onTap;
@override @override
Widget build(final BuildContext context) => Padding( Widget build(final BuildContext context) => InkWell(
padding: const EdgeInsets.symmetric(vertical: 8), onTap: onTap,
child: ConsumptionListItem( child: Padding(
title: service.displayName, padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0),
icon: SvgPicture.string( child: ConsumptionListItem(
service.svgIcon, title: service.displayName,
width: 24.0, icon: SvgPicture.string(
height: 24.0, service.svgIcon,
colorFilter: ColorFilter.mode( width: 22.0,
Theme.of(context).colorScheme.onBackground, height: 24.0,
BlendMode.srcIn, colorFilter: ColorFilter.mode(
Theme.of(context).colorScheme.onBackground,
BlendMode.srcIn,
),
), ),
rightSideText: service.storageUsage.used.toString(),
percentage: service.storageUsage.used.byte / volume.sizeTotal.byte,
color: volume.root
? Theme.of(context).colorScheme.primary
: Theme.of(context).colorScheme.secondary,
backgroundColor: Theme.of(context).colorScheme.surfaceVariant,
dense: true,
), ),
rightSideText: service.storageUsage.used.toString(),
percentage: service.storageUsage.used.byte / volume.sizeTotal.byte,
color: volume.root
? Theme.of(context).colorScheme.primary
: Theme.of(context).colorScheme.secondary,
backgroundColor: Theme.of(context).colorScheme.surfaceVariant,
dense: true,
), ),
); );
} }

View File

@ -57,7 +57,7 @@ class _DnsProviderPickerState extends State<DnsProviderPicker> {
providerCubit: widget.formCubit, providerCubit: widget.formCubit,
providerInfo: const ProviderPageInfo( providerInfo: const ProviderPageInfo(
providerType: DnsProviderType.digitalOcean, providerType: DnsProviderType.digitalOcean,
pathToHow: 'how_digital_ocean_dns', pathToHow: 'how_digital_ocean',
), ),
); );

View File

@ -130,7 +130,9 @@ class InitializingPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
if (cubit.state is ServerInstallationEmpty || if (cubit.state is ServerInstallationEmpty ||
cubit.state is ServerInstallationNotFinished) cubit.state is ServerInstallationNotFinished &&
cubit.state.progress ==
ServerSetupProgress.nothingYet)
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
child: BrandButton.filled( child: BrandButton.filled(

View File

@ -38,7 +38,7 @@ class NewUserPage extends StatelessWidget {
return BlocListener<UserFormCubit, FormCubitState>( return BlocListener<UserFormCubit, FormCubitState>(
listener: (final BuildContext context, final FormCubitState state) { listener: (final BuildContext context, final FormCubitState state) {
if (state.isSubmitted) { if (state.isSubmitted) {
context.router.pop(); context.router.maybePop();
} }
}, },
child: BrandHeroScreen( child: BrandHeroScreen(

View File

@ -103,7 +103,7 @@ class _DeleteUserTile extends StatelessWidget {
TextButton( TextButton(
child: Text('basis.cancel'.tr()), child: Text('basis.cancel'.tr()),
onPressed: () { onPressed: () {
context.router.pop(); context.router.maybePop();
}, },
), ),
TextButton( TextButton(
@ -115,8 +115,8 @@ class _DeleteUserTile extends StatelessWidget {
), ),
onPressed: () { onPressed: () {
context.read<JobsCubit>().addJob(DeleteUserJob(user: user)); context.read<JobsCubit>().addJob(DeleteUserJob(user: user));
context.router.childControllers.first.pop(); context.router.childControllers.first.maybePop();
context.router.pop(); context.router.maybePop();
}, },
), ),
], ],
@ -244,7 +244,7 @@ class _SshKeysCard extends StatelessWidget {
publicKey: key, publicKey: key,
), ),
); );
context.popRoute(); context.maybePop();
}, },
), ),
], ],

File diff suppressed because it is too large Load Diff

View File

@ -5,30 +5,29 @@ version: 0.11.0+22
environment: environment:
sdk: '>=3.2.1 <4.0.0' sdk: '>=3.2.1 <4.0.0'
flutter: ">=3.16.1" flutter: ">=3.19.5"
dependencies: dependencies:
animations: ^2.0.8 animations: ^2.0.11
auto_route: ^7.8.4 auto_route: ^8.0.3
auto_size_text: ^3.0.0 auto_size_text: ^3.0.0
bloc_concurrency: ^0.2.3 bloc_concurrency: ^0.2.5
crypt: ^4.3.1 crypt: ^4.3.1
collection: ^1.18.0 collection: ^1.18.0
cubit_form: ^2.0.1 cubit_form: ^2.0.1
device_info_plus: ^9.1.1 device_info_plus: ^10.0.1
dio: ^5.4.0 dio: ^5.4.2+1
duration: ^3.0.13 duration: ^3.0.13
dynamic_color: ^1.6.8 dynamic_color: ^1.7.0
easy_localization: ^3.0.3 easy_localization: ^3.0.5
either_option: ^2.0.1-dev.1
equatable: ^2.0.5 equatable: ^2.0.5
fl_chart: ^0.65.0 fl_chart: ^0.67.0
flutter: flutter:
sdk: flutter sdk: flutter
flutter_bloc: ^8.1.3 flutter_bloc: ^8.1.5
flutter_markdown: ^0.6.18+2 flutter_markdown: ^0.6.22
flutter_secure_storage: ^9.0.0 flutter_secure_storage: ^9.0.0
flutter_svg: ^2.0.9 flutter_svg: ^2.0.10+1
gap: ^3.0.1 gap: ^3.0.1
get_it: ^7.6.4 get_it: ^7.6.4
gql: ^1.0.0 gql: ^1.0.0
@ -38,12 +37,11 @@ dependencies:
hive: ^2.2.3 hive: ^2.2.3
hive_flutter: ^1.1.0 hive_flutter: ^1.1.0
http: ^1.1.2 http: ^1.1.2
intl: ^0.18.0 intl: ^0.18.1
ionicons: ^0.2.2 ionicons: ^0.2.2
json_annotation: ^4.8.1 json_annotation: ^4.8.1
local_auth: ^2.1.7 material_color_utilities: ^0.8.0
material_color_utilities: ^0.5.0 modal_bottom_sheet: ^3.0.0
modal_bottom_sheet: ^3.0.0-pre
nanoid: ^1.0.0 nanoid: ^1.0.0
package_info: ^2.0.2 package_info: ^2.0.2
pretty_dio_logger: ^1.3.1 pretty_dio_logger: ^1.3.1
@ -55,14 +53,14 @@ dependencies:
# wakelock: ^0.6.2 # wakelock: ^0.6.2
dev_dependencies: dev_dependencies:
auto_route_generator: ^7.3.2 auto_route_generator: ^8.0.0
flutter_test: flutter_test:
sdk: flutter sdk: flutter
build_runner: ^2.4.7 build_runner: ^2.4.9
flutter_launcher_icons: ^0.13.1 flutter_launcher_icons: ^0.13.1
hive_generator: ^2.0.1 hive_generator: ^2.0.1
json_serializable: ^6.7.1 json_serializable: ^6.7.1
flutter_lints: ^3.0.1 flutter_lints: ^3.0.2
flutter_icons: flutter_icons:
android: "launcher_icon" android: "launcher_icon"

View File

@ -9,7 +9,6 @@
#include <connectivity_plus/connectivity_plus_windows_plugin.h> #include <connectivity_plus/connectivity_plus_windows_plugin.h>
#include <dynamic_color/dynamic_color_plugin_c_api.h> #include <dynamic_color/dynamic_color_plugin_c_api.h>
#include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h> #include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h>
#include <local_auth_windows/local_auth_plugin.h>
#include <url_launcher_windows/url_launcher_windows.h> #include <url_launcher_windows/url_launcher_windows.h>
void RegisterPlugins(flutter::PluginRegistry* registry) { void RegisterPlugins(flutter::PluginRegistry* registry) {
@ -19,8 +18,6 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("DynamicColorPluginCApi")); registry->GetRegistrarForPlugin("DynamicColorPluginCApi"));
FlutterSecureStorageWindowsPluginRegisterWithRegistrar( FlutterSecureStorageWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin"));
LocalAuthPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("LocalAuthPlugin"));
UrlLauncherWindowsRegisterWithRegistrar( UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows")); registry->GetRegistrarForPlugin("UrlLauncherWindows"));
} }

View File

@ -6,7 +6,6 @@ list(APPEND FLUTTER_PLUGIN_LIST
connectivity_plus connectivity_plus
dynamic_color dynamic_color
flutter_secure_storage_windows flutter_secure_storage_windows
local_auth_windows
url_launcher_windows url_launcher_windows
) )