@@ -17,10 +17,15 @@ class _AnalyticsSpecificsState extends State<AnalyticsSpecifics> {
17
17
double containerHeight = 90 ;
18
18
bool expanded = false ;
19
19
20
- void expandContainer () {
20
+ void toggleContainer () {
21
21
setState (() {
22
- containerHeight = 180 ;
23
- expanded = true ;
22
+ if (expanded) {
23
+ containerHeight = 90 ;
24
+ expanded = false ;
25
+ } else {
26
+ containerHeight = 180 ;
27
+ expanded = true ;
28
+ }
24
29
});
25
30
}
26
31
@@ -139,26 +144,38 @@ class _AnalyticsSpecificsState extends State<AnalyticsSpecifics> {
139
144
),
140
145
SizedBox (height: 8 + 4 ),
141
146
InkWell (
142
- onTap: () => this . expandContainer (),
147
+ onTap: () => toggleContainer (),
143
148
child: AnimatedContainer (
144
149
duration: Duration (milliseconds: 300 ),
145
- padding:
146
- const EdgeInsets .symmetric (vertical: 16 , horizontal: 8 ),
150
+ padding: const EdgeInsets .symmetric (vertical: 16 , horizontal: 8 ),
147
151
height: containerHeight,
148
152
color: Theme .of (context).highlightColor,
149
153
child: Container (
150
154
padding: const EdgeInsets .symmetric (horizontal: 16 ),
151
- child: Row (
152
- mainAxisAlignment: MainAxisAlignment .spaceBetween,
153
- crossAxisAlignment: CrossAxisAlignment .center,
154
- children: [
155
- Text (
156
- "🚨 Air Quality Alerts" ,
157
- style: TextStyle (
158
- fontSize: 16 , fontWeight: FontWeight .w600),
159
- ),
160
- Icon (Icons .arrow_drop_down)
161
- ]),
155
+ child: Column (
156
+ children: [
157
+ Row (
158
+ mainAxisAlignment: MainAxisAlignment .spaceBetween,
159
+ crossAxisAlignment: CrossAxisAlignment .center,
160
+ children: [
161
+ Text (
162
+ "🚨 Air Quality Alerts" ,
163
+ style: TextStyle (
164
+ fontSize: 16 , fontWeight: FontWeight .w600),
165
+ ),
166
+ Icon (
167
+ expanded
168
+ ? Icons .arrow_drop_up
169
+ : Icons .arrow_drop_down
170
+ )
171
+ ],
172
+ ),
173
+ if (expanded) ...[
174
+ SizedBox (height: 16 ),
175
+ Text ("" ),
176
+ ],
177
+ ],
178
+ ),
162
179
decoration: BoxDecoration (
163
180
color: Theme .of (context).scaffoldBackgroundColor,
164
181
borderRadius: BorderRadius .circular (44 )),
0 commit comments