Compare commits

...

8 Commits

Author SHA1 Message Date
NaiJi ✨ ffdb9d92fb Merge pull request 'fix(backups): Implement filtering for enabled services for backups' (#499) from filter-enabled-backup-services into master
continuous-integration/drone/push Build is passing Details
Reviewed-on: #499
Reviewed-by: Inex Code <inex.code@selfprivacy.org>
2024-04-17 18:48:56 +03:00
NaiJi ✨ 1c42598787 fix(backups): Implement filtering for enabled services for backups
- Resolve: #433
2024-04-16 23:03:11 +04:00
dettlaff c179a109fd fix: add subtitle for flash button (#462)
continuous-integration/drone/push Build is passing Details
closes #453

![image](/attachments/398ae5b1-df90-43cf-8389-0be4bafde9fd)

idk how to change hover

Co-authored-by: Inex Code <inex.code@selfprivacy.org>
Reviewed-on: #462
Co-authored-by: dettlaff <dettlaff@riseup.net>
Co-committed-by: dettlaff <dettlaff@riseup.net>
2024-04-11 13:53:31 +03:00
def add2366e6b feat: add copy link to service page (#461)
continuous-integration/drone/push Build is passing Details
closes #452

Co-authored-by: Inex Code <inex.code@selfprivacy.org>
Reviewed-on: #461
Co-authored-by: def <dettlaff@riseup.net>
Co-committed-by: def <dettlaff@riseup.net>
2024-04-11 13:14:20 +03:00
dettlaff 0dc281a4f6 feat: add route to service cards in storage page (#446)
continuous-integration/drone/push Build is passing Details
Co-authored-by: Inex Code <inex.code@selfprivacy.org>
Reviewed-on: #446
Co-authored-by: dettlaff <dettlaff@riseup.net>
Co-committed-by: dettlaff <dettlaff@riseup.net>
2024-04-11 13:04:22 +03:00
dettlaff a4737e9f05 feat: cubit.state.progress check for connect_to_existing
continuous-integration/drone/push Build is passing Details
2024-04-03 13:00:27 +03:00
Inex Code bf66717854 fix(docs): Digital Ocean DNS used wrong manual
continuous-integration/drone/push Build is failing Details
2024-04-03 12:54:33 +03:00
Inex Code d3b7f31c65 chore: Upgrade flutter and dependencies 2024-04-02 18:11:29 +03:00
17 changed files with 279 additions and 336 deletions

View File

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

View File

@ -24,8 +24,10 @@ abstract class AppThemeFactory {
final ColorScheme? dynamicColorsScheme =
await _getDynamicColors(brightness);
final Color? accentColor = await _getAccentColor();
final ColorScheme fallbackColorScheme = ColorScheme.fromSeed(
seedColor: fallbackColor,
seedColor: accentColor ?? fallbackColor,
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 {
try {
return await DynamicColorPlugin.getCorePalette();

View File

@ -1,4 +1,5 @@
import 'package:auto_route/auto_route.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:ionicons/ionicons.dart';
import 'package:selfprivacy/logic/cubit/client_jobs/client_jobs_cubit.dart';
@ -164,6 +165,7 @@ class _HeroSliverAppBarState extends State<HeroSliverAppBar> {
color: isJobsListEmpty
? Theme.of(context).colorScheme.onBackground
: Theme.of(context).colorScheme.primary,
tooltip: 'jobs.title'.tr(),
),
),
const SizedBox.shrink(),

View File

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

View File

@ -38,8 +38,14 @@ class BackupDetailsPage extends StatelessWidget {
: StateType.uninitialized;
final bool preventActions = backupsState.preventActions;
final List<Backup> backups = backupsState.backups;
final List<Service> services =
context.watch<ServicesBloc>().state.servicesThatCanBeBackedUp;
final List<Service> services = context
.watch<ServicesBloc>()
.state
.servicesThatCanBeBackedUp
.where(
(final service) => service.isEnabled,
)
.toList();
final Duration? autobackupPeriod = backupsState.autobackupPeriod;
final List<ServerJob> backupJobs = context
.watch<ServerJobsBloc>()

View File

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

View File

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

View File

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

@ -2,6 +2,7 @@ import 'package:auto_route/auto_route.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:selfprivacy/config/get_it_config.dart';
import 'package:selfprivacy/logic/bloc/services/services_bloc.dart';
import 'package:selfprivacy/logic/bloc/volumes/volumes_bloc.dart';
import 'package:selfprivacy/logic/cubit/client_jobs/client_jobs_cubit.dart';
@ -11,6 +12,7 @@ import 'package:selfprivacy/ui/components/cards/filled_card.dart';
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
import 'package:selfprivacy/ui/router/router.dart';
import 'package:selfprivacy/utils/launch_url.dart';
import 'package:selfprivacy/utils/platform_adapter.dart';
@RoutePage()
class ServicePage extends StatefulWidget {
@ -65,6 +67,11 @@ class _ServicePageState extends State<ServicePage> {
ListTile(
iconColor: Theme.of(context).colorScheme.onBackground,
onTap: () => launchURL(service.url),
onLongPress: () {
PlatformAdapter.setClipboard(service.url!);
getIt<NavigationService>()
.showSnackBar('basis.copied_to_clipboard'.tr());
},
leading: const Icon(Icons.open_in_browser),
title: Text(
'service_page.open_in_browser'.tr(),

View File

@ -57,7 +57,7 @@ class _DnsProviderPickerState extends State<DnsProviderPicker> {
providerCubit: widget.formCubit,
providerInfo: const ProviderPageInfo(
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,
children: [
if (cubit.state is ServerInstallationEmpty ||
cubit.state is ServerInstallationNotFinished)
cubit.state is ServerInstallationNotFinished &&
cubit.state.progress ==
ServerSetupProgress.nothingYet)
Container(
alignment: Alignment.center,
child: BrandButton.filled(

View File

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

View File

@ -103,7 +103,7 @@ class _DeleteUserTile extends StatelessWidget {
TextButton(
child: Text('basis.cancel'.tr()),
onPressed: () {
context.router.pop();
context.router.maybePop();
},
),
TextButton(
@ -115,8 +115,8 @@ class _DeleteUserTile extends StatelessWidget {
),
onPressed: () {
context.read<JobsCubit>().addJob(DeleteUserJob(user: user));
context.router.childControllers.first.pop();
context.router.pop();
context.router.childControllers.first.maybePop();
context.router.maybePop();
},
),
],
@ -244,7 +244,7 @@ class _SshKeysCard extends StatelessWidget {
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:
sdk: '>=3.2.1 <4.0.0'
flutter: ">=3.16.1"
flutter: ">=3.19.5"
dependencies:
animations: ^2.0.8
auto_route: ^7.8.4
animations: ^2.0.11
auto_route: ^8.0.3
auto_size_text: ^3.0.0
bloc_concurrency: ^0.2.3
bloc_concurrency: ^0.2.5
crypt: ^4.3.1
collection: ^1.18.0
cubit_form: ^2.0.1
device_info_plus: ^9.1.1
dio: ^5.4.0
device_info_plus: ^10.0.1
dio: ^5.4.2+1
duration: ^3.0.13
dynamic_color: ^1.6.8
easy_localization: ^3.0.3
either_option: ^2.0.1-dev.1
dynamic_color: ^1.7.0
easy_localization: ^3.0.5
equatable: ^2.0.5
fl_chart: ^0.65.0
fl_chart: ^0.67.0
flutter:
sdk: flutter
flutter_bloc: ^8.1.3
flutter_markdown: ^0.6.18+2
flutter_bloc: ^8.1.5
flutter_markdown: ^0.6.22
flutter_secure_storage: ^9.0.0
flutter_svg: ^2.0.9
flutter_svg: ^2.0.10+1
gap: ^3.0.1
get_it: ^7.6.4
gql: ^1.0.0
@ -38,12 +37,11 @@ dependencies:
hive: ^2.2.3
hive_flutter: ^1.1.0
http: ^1.1.2
intl: ^0.18.0
intl: ^0.18.1
ionicons: ^0.2.2
json_annotation: ^4.8.1
local_auth: ^2.1.7
material_color_utilities: ^0.5.0
modal_bottom_sheet: ^3.0.0-pre
material_color_utilities: ^0.8.0
modal_bottom_sheet: ^3.0.0
nanoid: ^1.0.0
package_info: ^2.0.2
pretty_dio_logger: ^1.3.1
@ -55,14 +53,14 @@ dependencies:
# wakelock: ^0.6.2
dev_dependencies:
auto_route_generator: ^7.3.2
auto_route_generator: ^8.0.0
flutter_test:
sdk: flutter
build_runner: ^2.4.7
build_runner: ^2.4.9
flutter_launcher_icons: ^0.13.1
hive_generator: ^2.0.1
json_serializable: ^6.7.1
flutter_lints: ^3.0.1
flutter_lints: ^3.0.2
flutter_icons:
android: "launcher_icon"

View File

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

View File

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