]> git.proxmox.com Git - flutter/pve_flutter_frontend.git/commitdiff
add ActionCard widget
authorTim Marx <t.marx@proxmox.com>
Tue, 14 Apr 2020 23:16:40 +0000 (01:16 +0200)
committerTim Marx <t.marx@proxmox.com>
Tue, 14 Apr 2020 23:53:02 +0000 (01:53 +0200)
Signed-off-by: Tim Marx <t.marx@proxmox.com>
lib/widgets/pve_action_card_widget.dart [new file with mode: 0644]

diff --git a/lib/widgets/pve_action_card_widget.dart b/lib/widgets/pve_action_card_widget.dart
new file mode 100644 (file)
index 0000000..472a651
--- /dev/null
@@ -0,0 +1,48 @@
+import 'package:flutter/material.dart';
+
+class ActionCard extends StatelessWidget {
+  final Function onTap;
+  final String title;
+  final Widget icon;
+
+  const ActionCard({
+    Key key,
+    this.onTap,
+    this.title,
+    this.icon,
+  }) : super(key: key);
+
+  @override
+  Widget build(BuildContext context) {
+    return Card(
+      color: Color(0xFF00617F),
+      shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0)),
+      child: InkWell(
+        onTap: onTap,
+        child: Padding(
+          padding: const EdgeInsets.all(8.0),
+          child: Container(
+            width: 80,
+            child: Stack(children: [
+              Center(
+                child: icon,
+              ),
+              Column(
+                mainAxisAlignment: MainAxisAlignment.end,
+                children: [
+                  Center(
+                    child: Text(
+                      title,
+                      style: TextStyle(
+                          color: Colors.white, fontWeight: FontWeight.bold),
+                    ),
+                  ),
+                ],
+              )
+            ]),
+          ),
+        ),
+      ),
+    );
+  }
+}