feat: add route to services in storage page

This commit is contained in:
dettlaff 2024-02-04 03:36:10 +04:00 committed by Inex Code
parent a4737e9f05
commit 456574002b
1 changed files with 28 additions and 18 deletions

View File

@ -95,6 +95,11 @@ class ServerStorageSection extends StatelessWidget {
(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) ...[
@ -117,14 +122,18 @@ 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(BuildContext context) => GestureDetector(
onTap: onTap,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8), padding: const EdgeInsets.symmetric(vertical: 8),
child: ConsumptionListItem( child: ConsumptionListItem(
title: service.displayName, title: service.displayName,
@ -145,5 +154,6 @@ class ServerConsumptionListTile extends StatelessWidget {
backgroundColor: Theme.of(context).colorScheme.surfaceVariant, backgroundColor: Theme.of(context).colorScheme.surfaceVariant,
dense: true, dense: true,
), ),
),
); );
} }