]> git.proxmox.com Git - flutter/pve_flutter_frontend.git/blob - lib/widgets/pve_action_card_widget.dart
tree-wide: prefer sized box for whitespace
[flutter/pve_flutter_frontend.git] / lib / widgets / pve_action_card_widget.dart
1 import 'package:flutter/material.dart';
2
3 class ActionCard extends StatelessWidget {
4 final Function? onTap;
5 final String? title;
6 final Widget? icon;
7 final Color? color;
8
9 const ActionCard({
10 super.key,
11 this.onTap,
12 this.title,
13 this.icon,
14 this.color,
15 });
16
17 @override
18 Widget build(BuildContext context) {
19 return Card(
20 color: color ?? Theme.of(context).colorScheme.primary,
21 shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0)),
22 child: InkWell(
23 onTap: onTap as void Function()?,
24 child: Padding(
25 padding: const EdgeInsets.all(8.0),
26 child: SizedBox(
27 width: 80,
28 child: Stack(children: [
29 Center(
30 child: icon,
31 ),
32 Column(
33 mainAxisAlignment: MainAxisAlignment.end,
34 children: [
35 Center(
36 child: Text(
37 title!,
38 style: TextStyle(
39 color: Theme.of(context).colorScheme.onPrimary,
40 fontWeight: FontWeight.bold),
41 ),
42 ),
43 ],
44 )
45 ]),
46 ),
47 ),
48 ),
49 );
50 }
51 }