mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-09 09:31:13 +00:00
feat: add route to service cards in storage page (#446)
Co-authored-by: Inex Code <inex.code@selfprivacy.org> Reviewed-on: https://git.selfprivacy.org/SelfPrivacy/selfprivacy.org.app/pulls/446 Co-authored-by: dettlaff <dettlaff@riseup.net> Co-committed-by: dettlaff <dettlaff@riseup.net>
This commit is contained in:
parent
a4737e9f05
commit
0dc281a4f6
|
@ -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,19 +87,29 @@ 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(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||||
|
child: ServerStorageListItem(
|
||||||
volume: volume,
|
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(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||||
|
child: BrandOutlinedButton(
|
||||||
title: 'storage.extend_volume_button.title'.tr(),
|
title: 'storage.extend_volume_button.title'.tr(),
|
||||||
onPressed: () => context.pushRoute(
|
onPressed: () => context.pushRoute(
|
||||||
ExtendingVolumeRoute(
|
ExtendingVolumeRoute(
|
||||||
|
@ -108,6 +118,7 @@ class ServerStorageSection extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
@ -117,20 +128,24 @@ 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: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0),
|
||||||
child: ConsumptionListItem(
|
child: ConsumptionListItem(
|
||||||
title: service.displayName,
|
title: service.displayName,
|
||||||
icon: SvgPicture.string(
|
icon: SvgPicture.string(
|
||||||
service.svgIcon,
|
service.svgIcon,
|
||||||
width: 24.0,
|
width: 22.0,
|
||||||
height: 24.0,
|
height: 24.0,
|
||||||
colorFilter: ColorFilter.mode(
|
colorFilter: ColorFilter.mode(
|
||||||
Theme.of(context).colorScheme.onBackground,
|
Theme.of(context).colorScheme.onBackground,
|
||||||
|
@ -145,5 +160,6 @@ class ServerConsumptionListTile extends StatelessWidget {
|
||||||
backgroundColor: Theme.of(context).colorScheme.surfaceVariant,
|
backgroundColor: Theme.of(context).colorScheme.surfaceVariant,
|
||||||
dense: true,
|
dense: true,
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue