aboutsummaryrefslogtreecommitdiff
path: root/lib/components/Option.dart
blob: 3460c8a1676342200c936e27979ca948c1d3e7a3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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),
      ],
    );
  }
}