feat: add route to services in storage page

pull/446/head
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(
service: service,
volume: volume,
onTap: () {
context.pushRoute(
ServiceRoute(serviceId: service.id),
);
},
),
),
if (volume.isResizable) ...[
@ -117,14 +122,18 @@ 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(
Widget build(BuildContext context) => GestureDetector(
onTap: onTap,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: ConsumptionListItem(
title: service.displayName,
@ -145,5 +154,6 @@ class ServerConsumptionListTile extends StatelessWidget {
backgroundColor: Theme.of(context).colorScheme.surfaceVariant,
dense: true,
),
),
);
}