File tree 2 files changed +38
-22
lines changed
2 files changed +38
-22
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ const USER_EMAILS = [
60
60
61
61
62
62
];
63
+ const GRID_VIEW = "Grid View" ;
63
64
64
65
class ListScreen extends StatefulWidget {
65
66
ListScreen ({Key key, this .group, this .onClick}) : super (key: key);
@@ -131,13 +132,27 @@ class _ListState extends State<ListScreen> {
131
132
);
132
133
}
133
134
135
+ Widget _topRight () {
136
+ return InkWell (
137
+ child: Container (
138
+ child: Center (
139
+ child: Text (
140
+ GRID_VIEW ,
141
+ style: TextStyle (color: Colors .white),
142
+ ),
143
+ ),
144
+ ),
145
+ );
146
+ }
147
+
134
148
@override
135
149
Widget build (BuildContext context) {
136
150
return Scaffold (
137
151
appBar: TopAppBar (
138
152
group: widget.group,
139
153
itemType: ItemType .list,
140
154
onClick: widget.onClick,
155
+ right: _topRight (),
141
156
bottomView: PreferredSize (
142
157
child: ListSelector (
143
158
mainColor: Colors .white,
Original file line number Diff line number Diff line change @@ -11,30 +11,31 @@ const BAR_FONT_SIZE = 21.0;
11
11
const BAR_TITLE_COLOR = Colors .white;
12
12
13
13
class TopAppBar extends AppBar {
14
- TopAppBar ({
15
- GroupType group,
16
- ItemType itemType,
17
- PreferredSize bottomView,
18
- VoidCallback onClick,
19
- }) : super (
20
- leading: IconButton (
21
- icon: Icon (
22
- BAR_ICONS [group.index],
23
- color: BAR_TITLE_COLOR ,
14
+ TopAppBar (
15
+ {GroupType group,
16
+ ItemType itemType,
17
+ PreferredSize bottomView,
18
+ VoidCallback onClick,
19
+ Widget right})
20
+ : super (
21
+ leading: IconButton (
22
+ icon: Icon (
23
+ BAR_ICONS [group.index],
24
+ color: BAR_TITLE_COLOR ,
25
+ ),
26
+ onPressed: onClick,
24
27
),
25
- onPressed: onClick,
26
- ),
27
- title: Text (
28
- BOTTOM_TITLES [itemType.index],
29
- style: TextStyle (
30
- color: BAR_TITLE_COLOR ,
31
- fontSize: BAR_FONT_SIZE ,
28
+ title: Text (
29
+ BOTTOM_TITLES [itemType.index],
30
+ style: TextStyle (
31
+ color: BAR_TITLE_COLOR ,
32
+ fontSize: BAR_FONT_SIZE ,
33
+ ),
32
34
),
33
- ),
34
- bottom: bottomView,
35
- backgroundColor: BAR_BACK_COLORS [group.index],
36
- elevation: 0.0 ,
37
- );
35
+ bottom: bottomView,
36
+ backgroundColor: BAR_BACK_COLORS [group.index],
37
+ elevation: 0.0 ,
38
+ actions: right == null ? null : [right]);
38
39
}
39
40
40
41
class SliverBar extends SliverAppBar {
You can’t perform that action at this time.
0 commit comments