timeline_menu_bar.dart
1.91 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import 'package:flutter/material.dart';
class TimelineMenuHeader extends StatelessWidget {
const TimelineMenuHeader({
Key? key,
this.funcLeft,
this.funcCenter,
this.funcRight,
}) : super(key: key);
final Function? funcLeft;
final Function? funcCenter;
final Function? funcRight;
@override
Widget build(BuildContext context) {
return Container(
alignment: Alignment.center,
margin: const EdgeInsets.symmetric(horizontal: 5.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.min,
//交叉轴的布局方式,对于column来说就是水平方向的布局方式
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
SizedBox(
width: 60.0,
child: TextButton(
onPressed: () => funcLeft!(),
child: const Text(
"临境",
style: TextStyle(color: Colors.black54),
),
),
),
const VerticalDivider(
color: Colors.black54,
width: 1.0,
thickness: 1.0,
indent: 16.0,
endIndent: 16.0,
),
TextButton(
onPressed: () => funcCenter!(),
child: const Text(
"附近",
style: TextStyle(color: Colors.black54),
),
),
const VerticalDivider(
color: Colors.black54,
width: 1.0,
thickness: 1.0,
indent: 15.0,
endIndent: 15.0,
),
TextButton(
onPressed: () => funcRight!(),
child: const Text(
"新鲜",
style: TextStyle(color: Colors.black54),
),
),
],
));
}
}