Fakultas Ilmu Komputer UI

insideFilter.dart 9.59 KB
Newer Older
1
2
3
4
5
6
7
8
9

import 'package:flutter/material.dart';

class InsideFilter extends  StatefulWidget {
  @override
  _InsideFilterState createState() => _InsideFilterState();
}

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

21
22
23
24

  @override
  Widget build(BuildContext context) {
    return Container(
25
26
27
28
      height: MediaQuery.of(context).size.height / 2,
      decoration: BoxDecoration(
         border: Border.all(color: Colors.white)
      ),
29
30
31
32
33
34
35
36
37
      child: new Row(
        children: <Widget>[
          Expanded(
            flex: 1,
            child: Column(
              children: <Widget>[
                Expanded(
                  flex: 1,
                  child: new InkWell(
38
                      child: new Text('Urutan'), highlightColor: Colors.green,
39
40
41
42
43
44
45
46
                      onTap: () => setState(() {
                        print('no');
                        showUrutan = true;
                      })),
                ),
                Expanded(
                  flex: 1,
                  child: new InkWell(
47
                      child: new Text('Jenis Fasilitas'), highlightColor: Colors.green,
48
49
50
51
                      onTap: () => setState(() {
                        print("yes");
                        showUrutan = false;
                      })),
52
53
54
55
                ),
                Expanded(
                  flex: 0,
                  child: new InkWell(
56
57
58
                      child: new Text('Hapus Semua'),
                      highlightColor: Colors.red,
                      customBorder: Border.all(color: Colors.red),
59
60
61
62
63
                      onTap: () => setState(() {
                        print("yes");
                        showUrutan = false;
                      })),
                ),
64

65
66
67
68
69
70
71
72
73
74
75
              ],
            ),
          ),
          Expanded(
            flex: 3,
            child: Stack(
              children: <Widget>[
                Opacity(
                  opacity: showUrutan ? 1 : 0,
                  child: Column(
                    children: <Widget>[
76
                      Column(
77
                        //mainAxisAlignment: MainAxisAlignment.start,
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
                        children: <Widget>[
                          Checkbox(
                            value: kursiRodaVal,
                            onChanged: (bool value) {
                              setState(() {
                                kursiRodaVal = value;
                              });
                            },
                          ),
                          new ListTile(title: new Text ("Kursi roda")),
                        ],
                      ),

                      Column(
                        mainAxisAlignment: MainAxisAlignment.start,
                        children: <Widget>[
                          Checkbox(
                            value: liftVal,
                            onChanged: (bool value) {
                              setState(() {
                                liftVal = value;
                              });
                            },
                          ),
                          new ListTile(title: new Text ("Lift")),
                        ],
                      ),

                      Column(
                        mainAxisAlignment: MainAxisAlignment.start,
                        children: <Widget>[
                          Checkbox(
                            value: toiletDisabilitasVal,
                            onChanged: (bool value) {
                              setState(() {
                                toiletDisabilitasVal = value;
                              });
                            },
                          ),
                          new ListTile(title: new Text ("Toilet Disabilitas")),
                        ],
                      ),

                      Column(
                        mainAxisAlignment: MainAxisAlignment.start,
                        children: <Widget>[
                          Checkbox(
                            value: tempatIbadahVal,
                            onChanged: (bool value) {
                              setState(() {
                                tempatIbadahVal = value;
                              });
                            },
                          ),
                          new ListTile(title: new Text ("Tempat Ibadah")),
                        ],
                      ),

                      Column(
                        mainAxisAlignment: MainAxisAlignment.start,
                        children: <Widget>[
                          Checkbox(
                            value: bidangMiringVal,
                            onChanged: (bool value) {
                              setState(() {
                                bidangMiringVal = value;
                              });
                            },
                          ),
                          new ListTile(title: new Text ("Bidang Miring")),
                        ],
                      ),

                      Column(
                        mainAxisAlignment: MainAxisAlignment.start,
                        children: <Widget>[
                          Checkbox(
                            value: parkirUmumVal,
                            onChanged: (bool value) {
                              setState(() {
                                parkirUmumVal = value;
                              });
                            },
                          ),
                          new ListTile(title: new Text ("Parkir Umum")),
                        ],
                      ),

                      Column(
                        mainAxisAlignment: MainAxisAlignment.start,
                        children: <Widget>[
                          Checkbox(
                            value: parkirDisabilitasVal,
                            onChanged: (bool value) {
                              setState(() {
                                parkirDisabilitasVal = value;
                              });
                            },
                          ),
                          new ListTile(title: new Text ("Parkir Disabilitas")),
                        ],
                      ),

//                      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: () {}),
188
189
190
191
192
193
194
                    ],
                  ),
                ),
                Opacity(
                  opacity: showUrutan ? 0 : 1,
                  child: Column(
                    children: <Widget>[
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
                      Column(
                        mainAxisAlignment: MainAxisAlignment.start,
                        children: <Widget>[
                          Radio(
                            value: komentarTerbaru,
                            onChanged: (bool value) {
                              setState(() {
                                komentarTerbaru = value;
                              });
                            },
                          ),
                          new ListTile(title: new Text ("Komentar Terbaru")),
                        ],
                      ),
                      Column(
                        mainAxisAlignment: MainAxisAlignment.start,
                        children: <Widget>[
                          Radio(
                            value: komentarTerpopuler,
                            onChanged: (bool value) {
                              setState(() {
                                komentarTerpopuler = value;
                              });
                            },
                          ),
                          new ListTile(title: new Text ("Komentar Terpopuler")),
                        ],
                      ),
                      Column(
                        mainAxisAlignment: MainAxisAlignment.start,
                        children: <Widget>[
                          Radio(
                            value: komentarRatingTertinggi,
                            onChanged: (bool value) {
                              setState(() {
                                komentarRatingTertinggi = value;
                              });
                            },
                          ),
                          new ListTile(title: new Text ("Komentar dengan Rating Tertinggi")),
                        ],
                      ),
//                      new ListTile(title: new Text('Komentar Terbaru'), onTap: () {}),
//                      new ListTile(title: new Text('Komentar Terpopuler'), onTap: () {}),
//                      new ListTile(title: new Text('Komentar dengan Rating Tertinggi'), onTap: () {}),
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
                    ],
                  ),
                ),
              ],
            ),
          )
        ],
      ),
    );
  }

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

  }

fazasabira's avatar
fazasabira committed
258

259
}
260
261