@@ -97,6 +97,8 @@ class ChatScreenState extends State<ChatScreen> {
97
97
groupChatId = '$peerId -$id ' ;
98
98
}
99
99
100
+ Firestore .instance.collection ('users' ).document (id).updateData ({'chattingWith' : peerId});
101
+
100
102
setState (() {});
101
103
}
102
104
@@ -190,31 +192,31 @@ class ChatScreenState extends State<ChatScreen> {
190
192
child: Material (
191
193
child: CachedNetworkImage (
192
194
placeholder: (context, url) => Container (
193
- child: CircularProgressIndicator (
194
- valueColor: AlwaysStoppedAnimation <Color >(themeColor),
195
- ),
196
- width: 200.0 ,
197
- height: 200.0 ,
198
- padding: EdgeInsets .all (70.0 ),
199
- decoration: BoxDecoration (
200
- color: greyColor2,
201
- borderRadius: BorderRadius .all (
202
- Radius .circular (8.0 ),
203
- ),
204
- ),
195
+ child: CircularProgressIndicator (
196
+ valueColor: AlwaysStoppedAnimation <Color >(themeColor),
197
+ ),
198
+ width: 200.0 ,
199
+ height: 200.0 ,
200
+ padding: EdgeInsets .all (70.0 ),
201
+ decoration: BoxDecoration (
202
+ color: greyColor2,
203
+ borderRadius: BorderRadius .all (
204
+ Radius .circular (8.0 ),
205
205
),
206
+ ),
207
+ ),
206
208
errorWidget: (context, url, error) => Material (
207
- child: Image .asset (
208
- 'images/img_not_available.jpeg' ,
209
- width: 200.0 ,
210
- height: 200.0 ,
211
- fit: BoxFit .cover,
212
- ),
213
- borderRadius: BorderRadius .all (
214
- Radius .circular (8.0 ),
215
- ),
216
- clipBehavior: Clip .hardEdge,
217
- ),
209
+ child: Image .asset (
210
+ 'images/img_not_available.jpeg' ,
211
+ width: 200.0 ,
212
+ height: 200.0 ,
213
+ fit: BoxFit .cover,
214
+ ),
215
+ borderRadius: BorderRadius .all (
216
+ Radius .circular (8.0 ),
217
+ ),
218
+ clipBehavior: Clip .hardEdge,
219
+ ),
218
220
imageUrl: document['content' ],
219
221
width: 200.0 ,
220
222
height: 200.0 ,
@@ -249,14 +251,14 @@ class ChatScreenState extends State<ChatScreen> {
249
251
? Material (
250
252
child: CachedNetworkImage (
251
253
placeholder: (context, url) => Container (
252
- child: CircularProgressIndicator (
253
- strokeWidth: 1.0 ,
254
- valueColor: AlwaysStoppedAnimation <Color >(themeColor),
255
- ),
256
- width: 35.0 ,
257
- height: 35.0 ,
258
- padding: EdgeInsets .all (10.0 ),
259
- ),
254
+ child: CircularProgressIndicator (
255
+ strokeWidth: 1.0 ,
256
+ valueColor: AlwaysStoppedAnimation <Color >(themeColor),
257
+ ),
258
+ width: 35.0 ,
259
+ height: 35.0 ,
260
+ padding: EdgeInsets .all (10.0 ),
261
+ ),
260
262
imageUrl: peerAvatar,
261
263
width: 35.0 ,
262
264
height: 35.0 ,
@@ -284,31 +286,31 @@ class ChatScreenState extends State<ChatScreen> {
284
286
child: Material (
285
287
child: CachedNetworkImage (
286
288
placeholder: (context, url) => Container (
287
- child: CircularProgressIndicator (
288
- valueColor: AlwaysStoppedAnimation <Color >(themeColor),
289
- ),
290
- width: 200.0 ,
291
- height: 200.0 ,
292
- padding: EdgeInsets .all (70.0 ),
293
- decoration: BoxDecoration (
294
- color: greyColor2,
295
- borderRadius: BorderRadius .all (
296
- Radius .circular (8.0 ),
297
- ),
298
- ),
289
+ child: CircularProgressIndicator (
290
+ valueColor: AlwaysStoppedAnimation <Color >(themeColor),
291
+ ),
292
+ width: 200.0 ,
293
+ height: 200.0 ,
294
+ padding: EdgeInsets .all (70.0 ),
295
+ decoration: BoxDecoration (
296
+ color: greyColor2,
297
+ borderRadius: BorderRadius .all (
298
+ Radius .circular (8.0 ),
299
299
),
300
+ ),
301
+ ),
300
302
errorWidget: (context, url, error) => Material (
301
- child: Image .asset (
302
- 'images/img_not_available.jpeg' ,
303
- width: 200.0 ,
304
- height: 200.0 ,
305
- fit: BoxFit .cover,
306
- ),
307
- borderRadius: BorderRadius .all (
308
- Radius .circular (8.0 ),
309
- ),
310
- clipBehavior: Clip .hardEdge,
311
- ),
303
+ child: Image .asset (
304
+ 'images/img_not_available.jpeg' ,
305
+ width: 200.0 ,
306
+ height: 200.0 ,
307
+ fit: BoxFit .cover,
308
+ ),
309
+ borderRadius: BorderRadius .all (
310
+ Radius .circular (8.0 ),
311
+ ),
312
+ clipBehavior: Clip .hardEdge,
313
+ ),
312
314
imageUrl: document['content' ],
313
315
width: 200.0 ,
314
316
height: 200.0 ,
@@ -372,6 +374,7 @@ class ChatScreenState extends State<ChatScreen> {
372
374
isShowSticker = false ;
373
375
});
374
376
} else {
377
+ Firestore .instance.collection ('users' ).document (id).updateData ({'chattingWith' : null });
375
378
Navigator .pop (context);
376
379
}
377
380
0 commit comments