aboutsummaryrefslogtreecommitdiff
path: root/lib/components/Option.dart
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/components/Option.dart30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/components/Option.dart b/lib/components/Option.dart
new file mode 100644
index 0000000..3460c8a
--- /dev/null
+++ b/lib/components/Option.dart
@@ -0,0 +1,30 @@
+import 'package:flutter/material.dart';
+
+class Option extends StatelessWidget {
+ void Function() onTap;
+ Widget icon;
+ Widget child;
+
+ Option({ this.child, this.icon, this.onTap }): super();
+
+ @override
+ build(BuildContext ctx) {
+ return Column(
+ children: [
+ ListTile(
+ contentPadding: const EdgeInsets.symmetric(vertical: 0.0, horizontal: 16.0),
+ title: Row(children: [
+ Container(width: 36.0, padding: EdgeInsets.only(right: 16.0), child: icon),
+ child,
+ ]),
+ onTap: () {
+ onTap();
+ Navigator.pop(ctx);
+ },
+ ),
+ Divider(height: 1.0),
+ ],
+ );
+ }
+}
+