Fakultas Ilmu Komputer UI

insideFilter.dart 13.4 KB
Newer Older
1
import 'package:flutter/material.dart';
2
import 'package:ppl_disabilitas/config/styles.dart';
3

4
class InsideFilter extends StatefulWidget {
5
6
7
8
  @override
  _InsideFilterState createState() => _InsideFilterState();
}

9
10
class _InsideFilterState extends State<InsideFilter>
    with SingleTickerProviderStateMixin {
11
12
  bool kursiRodaVal = false;
  bool liftVal = false;
13
  bool toiletDisabilitasVal = false;
14
15
16
17
  bool tempatIbadahVal = false;
  bool bidangMiringVal = false;
  bool parkirUmumVal = false;
  bool parkirDisabilitasVal = false;
18
19
20
  bool komentarTerbaru = false;
  bool komentarRatingTertinggi = false;
  bool komentarTerpopuler = false;
21

22
23
24
  @override
  Widget build(BuildContext context) {
    return Container(
25
      height: MediaQuery.of(context).size.height / 2,
26
      decoration: BoxDecoration(border: Border.all(color: Colors.green)),
27
28
29
30
      child: new Row(
        children: <Widget>[
          Expanded(
            flex: 1,
31
            child: ListView(
32
              children: <Widget>[
33
                Divider(color: Colors.green),
34
35
                new InkWell(
                    child: new Text('Urutan'),
36
                    splashColor: Colors.green,
37
38
                    highlightColor: Colors.green,
                    onTap: () => setState(() {
fazasabira's avatar
fazasabira committed
39
                      print('no');
40
41
                          showUrutan = true;
                        })),
42
43
                Divider(color: Colors.green),
                VerticalDivider(color: Colors.green),
44
45
46
                Container(
                  height: 80.0,
                ),
47
                Divider(color: Colors.green),
48
49
                InkWell(
                    child: new Text('Jenis Fasilitas'),
50
                    splashColor: Colors.green,
51
52
53
54
55
                    highlightColor: Colors.green,
                    onTap: () => setState(() {
                          print("yes");
                          showUrutan = false;
                        })),
56
                Divider(color: Colors.green),
fazasabira's avatar
fazasabira committed
57
                VerticalDivider(color: Colors.green, width: 10),
58
                Container(
59
                  height: 150.0,
60
                ),
61
62
63
64
65
66
67
68
69
                Container(
                  margin: EdgeInsets.only(
                      top: doubleSpace, bottom: doubleSpace, left: smallSpace),
                  decoration: BoxDecoration(boxShadow: regularShadow),
                  child: SizedBox(
                    width: double.infinity,
                    child: FlatButton(
                      color: Colors.red[700],
                      textColor: Colors.white,
70
71
                      //disabledColor: Colors.grey,
                      //disabledTextColor: Colors.black,
72
73
74
75
76
77
78
79
80
81
                      padding: EdgeInsets.all(8),
                      shape: RoundedRectangleBorder(
                          borderRadius: regularBorderRadius,
                          side: BorderSide(color: Colors.transparent)),
                      splashColor: Colors.redAccent,
                      onPressed: () {
                        /*...*/
                      },
                      child: Text(
                        "Hapus Semua",
82
                        style: TextStyle(fontSize: 10),
83
84
85
                      ),
                    ),
                  ),
86
                ),
87
88
89
90
91
92
93
              ],
            ),
          ),
          Expanded(
            flex: 3,
            child: Stack(
              children: <Widget>[
fazasabira's avatar
fazasabira committed
94
                VerticalDivider(color: Colors.green),
95
96
                Opacity(
                  opacity: showUrutan ? 1 : 0,
97
                  child: ListView(
98
                    children: <Widget>[
99
100
                      Row(
                        crossAxisAlignment: CrossAxisAlignment.center,
101
102
103
104
105
106
107
108
109
                        children: <Widget>[
                          Checkbox(
                            value: kursiRodaVal,
                            onChanged: (bool value) {
                              setState(() {
                                kursiRodaVal = value;
                              });
                            },
                          ),
110
                          new Text("Kursi roda"),
111
112
                        ],
                      ),
113
114
                      Row(
                        crossAxisAlignment: CrossAxisAlignment.center,
115
116
117
118
119
120
121
122
123
                        children: <Widget>[
                          Checkbox(
                            value: liftVal,
                            onChanged: (bool value) {
                              setState(() {
                                liftVal = value;
                              });
                            },
                          ),
124
                           new Text("Lift"),
125
126
127
                        ],
                      ),

128
129
                      Row(
                        crossAxisAlignment: CrossAxisAlignment.center,
130
131
132
133
134
135
136
137
138
                        children: <Widget>[
                          Checkbox(
                            value: toiletDisabilitasVal,
                            onChanged: (bool value) {
                              setState(() {
                                toiletDisabilitasVal = value;
                              });
                            },
                          ),
139
                          new Text("Toilet Disabilitas"),
140
141
142
                        ],
                      ),

143
144
                      Row(
                        crossAxisAlignment: CrossAxisAlignment.center,
145
146
147
148
149
150
151
152
153
                        children: <Widget>[
                          Checkbox(
                            value: tempatIbadahVal,
                            onChanged: (bool value) {
                              setState(() {
                                tempatIbadahVal = value;
                              });
                            },
                          ),
154
                          new Text("Tempat Ibadah"),
155
156
157
                        ],
                      ),

158
159
                      Row(
                        crossAxisAlignment: CrossAxisAlignment.center,
160
161
162
163
164
165
166
167
168
                        children: <Widget>[
                          Checkbox(
                            value: bidangMiringVal,
                            onChanged: (bool value) {
                              setState(() {
                                bidangMiringVal = value;
                              });
                            },
                          ),
169
                          new Text("Bidang Miring"),
170
171
172
                        ],
                      ),

173
174
                      Row(
                        crossAxisAlignment: CrossAxisAlignment.center,
175
176
177
178
179
180
181
182
183
                        children: <Widget>[
                          Checkbox(
                            value: parkirUmumVal,
                            onChanged: (bool value) {
                              setState(() {
                                parkirUmumVal = value;
                              });
                            },
                          ),
184
                          new Text("Parkir Umum"),
185
186
187
                        ],
                      ),

188
189
                      Row(
                        crossAxisAlignment: CrossAxisAlignment.center,
190
191
192
193
194
195
196
197
198
                        children: <Widget>[
                          Checkbox(
                            value: parkirDisabilitasVal,
                            onChanged: (bool value) {
                              setState(() {
                                parkirDisabilitasVal = value;
                              });
                            },
                          ),
199
                          new Text("Parkir Disabilitas"),
200
                          Container(height: 1.0,),
201
202
                        ],
                      ),
203
                      Container(
204
                        height: 13.0,
205
206
207
208
209
210
                      ),
                      Container(
                        margin: EdgeInsets.only(
                            top: doubleSpace, bottom: doubleSpace, left: smallSpace),
                        decoration: BoxDecoration(boxShadow: regularShadow),
                        child: SizedBox(
fazasabira's avatar
fazasabira committed
211
212
                          width: 6.0,
                          height: 40.0,
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
                          child: FlatButton(
                            color: Colors.green[700],
                            textColor: Colors.white,
                            //disabledColor: Colors.grey,
                            //disabledTextColor: Colors.black,
                            padding: EdgeInsets.all(8),
                            shape: RoundedRectangleBorder(
                                borderRadius: regularBorderRadius,
                                side: BorderSide(color: Colors.transparent)),
                            splashColor: Colors.green,
                            onPressed: () {
                              /*...*/
                            },
                            child: Text(
                              "Terapkan",
                              style: TextStyle(fontSize: 14),
                            ),
                          ),
                        ),
                      ),
233
234
235
236
237
238
239
240

//                      new ListTile(title: new Text('Kursi roda'), onTap: () {}),
//                      new ListTile(title: new Text('Lift'), onTap: () {}),
//                      new ListTile(title: new Text('Toilet Disabilitas'), onTap: () {}),
//                      new ListTile(title: new Text('Tempat Ibadah'), onTap: () {}),
//                      new ListTile(title: new Text('Bidang Miring (Ramp)'), onTap: () {}),
//                      new ListTile(title: new Text('Parkir Umum'), onTap: () {}),
//                      new ListTile(title: new Text('Parkir Disabilitas'), onTap: () {}),
241
242
243
244
245
                    ],
                  ),
                ),
                Opacity(
                  opacity: showUrutan ? 0 : 1,
246
                  child: ListView(
247
                    children: <Widget>[
248
249
                      Row(
                        crossAxisAlignment: CrossAxisAlignment.center,
250
251
252
253
254
255
256
                        children: <Widget>[
                          Radio(
                            value: komentarTerbaru,
                            onChanged: (bool value) {
                              setState(() {
                                komentarTerbaru = value;
                              });
257
258
                            },
                            groupValue: komentarTerbaru,
259
                          ),
260
                          new Text("Komentar Terbaru"),
261
262
                        ],
                      ),
263
264
                      Row(
                        crossAxisAlignment: CrossAxisAlignment.center,
265
266
267
268
269
270
271
                        children: <Widget>[
                          Radio(
                            value: komentarTerpopuler,
                            onChanged: (bool value) {
                              setState(() {
                                komentarTerpopuler = value;
                              });
272
273
                            },
                            groupValue: komentarTerpopuler,
274
                          ),
275
                          new Text("Komentar Terpopuler"),
276
277
                        ],
                      ),
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
                      FittedBox(
                        fit: BoxFit.fitWidth,
                        child: Row(
                          crossAxisAlignment: CrossAxisAlignment.center,
                          children: <Widget>[
                            Radio(
                              value: komentarRatingTertinggi,
                              onChanged: (bool value) {
                                setState(() {
                                  komentarRatingTertinggi = value;
                                });
                              },
                              groupValue: komentarRatingTertinggi,
                            ),

                            new Text("Komentar dengan Rating Tertinggi")
                            ,
                          ],
                        )
297
                      ),
298
                      Container(
299
                        height: 208.0,
300
                      ),
301
302
303
304
305
                      Container(
                        margin: EdgeInsets.only(
                            top: doubleSpace, bottom: doubleSpace, left: smallSpace),
                        decoration: BoxDecoration(boxShadow: regularShadow),
                        child: SizedBox(
fazasabira's avatar
fazasabira committed
306
                          width: smallSpace,
307
308
309
                          child: FlatButton(
                            color: Colors.green[700],
                            textColor: Colors.white,
310
311
                            //disabledColor: Colors.grey,
                            //disabledTextColor: Colors.black,
312
313
314
315
                            padding: EdgeInsets.all(8),
                            shape: RoundedRectangleBorder(
                                borderRadius: regularBorderRadius,
                                side: BorderSide(color: Colors.transparent)),
316
                            splashColor: Colors.green,
317
318
319
320
321
                            onPressed: () {
                              /*...*/
                            },
                            child: Text(
                              "Terapkan",
322
                              style: TextStyle(fontSize: 14),
323
324
325
326
                            ),
                          ),
                        ),
                      ),
327
328
329
330
331
                    ],
                  ),
                ),
              ],
            ),
332
          ),
333
334
335
        ],
      ),
    );
336
    //);
337
338
339
340
341
342
343
344
  }

  bool showUrutan = true;
  @override
  void initState() {
    super.initState();
  }
}