@@ -22,18 +22,11 @@ class DetailScreen extends StatefulWidget {
22
22
}
23
23
24
24
class _DetailScreenState extends State <DetailScreen > {
25
- bool joint = false ;
26
25
bool user = false ;
27
26
28
27
@override
29
28
void initState () {
30
29
super .initState ();
31
- if (widget.feedElementData.isMember != null &&
32
- widget.feedElementData.isMember! ) {
33
- setState (() {
34
- joint = true ;
35
- });
36
- }
37
30
is_owner ();
38
31
}
39
32
@@ -136,6 +129,13 @@ class _DetailScreenState extends State<DetailScreen> {
136
129
style: const TextStyle (
137
130
color: Colors .black, fontSize: 20 )),
138
131
]),
132
+ Row (children: [
133
+ const Icon (Icons .people),
134
+ Text (
135
+ "Joined: ${(data ["member_list" ]) == null ? "?" : (data ["member_list" ]).length }" ,
136
+ style: const TextStyle (
137
+ color: Colors .black, fontSize: 20 )),
138
+ ]),
139
139
],
140
140
),
141
141
),
@@ -162,49 +162,6 @@ class _DetailScreenState extends State<DetailScreen> {
162
162
Row (
163
163
mainAxisAlignment: MainAxisAlignment .center,
164
164
children: [
165
- Expanded (
166
- flex: 1 ,
167
- child: Container (
168
- margin: const EdgeInsets .fromLTRB (0 , 15 , 5 , 0 ),
169
- width: double .infinity,
170
- child: ElevatedButton (
171
- onPressed: () async {
172
- bool response = joint;
173
- if (! joint) {
174
- response = await joinEvent (
175
- widget.feedElementData.id);
176
- } else {
177
- response = await leaveEvent (
178
- widget.feedElementData.id);
179
- response = ! response;
180
- }
181
- setState (() {
182
- joint = response;
183
- });
184
- },
185
- style: ButtonStyle (
186
- backgroundColor: joint
187
- ? MaterialStateProperty .all (Colors .black)
188
- : MaterialStateProperty .all (
189
- const Color (0xffFE7F2D )),
190
- shape: MaterialStateProperty .all<
191
- RoundedRectangleBorder > (
192
- RoundedRectangleBorder (
193
- borderRadius: BorderRadius .circular (20.0 ),
194
- ))),
195
- child: joint
196
- ? const Icon (
197
- Icons .check,
198
- color: Colors .white,
199
- )
200
- : const Text (
201
- "Join" ,
202
- style: TextStyle (
203
- color: Colors .black, fontSize: 20 ),
204
- ),
205
- ),
206
- ),
207
- ),
208
165
Expanded (
209
166
flex: 1 ,
210
167
child: user == true
0 commit comments