@@ -5,14 +5,15 @@ import 'package:flutter_twitter_clone/model/user.dart';
55import 'package:flutter_twitter_clone/state/authState.dart' ;
66import 'package:flutter_twitter_clone/state/feedState.dart' ;
77import 'package:flutter_twitter_clone/state/notificationState.dart' ;
8+ import 'package:flutter_twitter_clone/state/searchState.dart' ;
89import 'package:flutter_twitter_clone/widgets/customWidgets.dart' ;
910import 'package:flutter_twitter_clone/widgets/newWidget/customUrlText.dart' ;
1011import 'package:flutter_twitter_clone/widgets/newWidget/emptyList.dart' ;
1112import 'package:flutter_twitter_clone/widgets/newWidget/rippleButton.dart' ;
1213import 'package:provider/provider.dart' ;
1314
1415class UserListWidget extends StatelessWidget {
15- final List <String > list;
16+ final List <User > list;
1617 final String emptyScreenText;
1718 final String emptyScreenSubTileText;
1819 UserListWidget ({
@@ -26,49 +27,21 @@ class UserListWidget extends StatelessWidget {
2627 Widget build (BuildContext context) {
2728 var state = Provider .of <AuthState >(context, listen: false );
2829 String myId = state.userModel.key;
29- return list != null && list.isNotEmpty
30- ? ListView .separated (
31- itemBuilder: (context, index) {
32- return FutureBuilder (
33- future: state.getuserDetail (list[index]),
34- builder: (context, AsyncSnapshot <User > snapshot) {
35- if (snapshot.hasData) {
36- return UserTile (
37- user: snapshot.data,
38- myId: myId,
39- );
40- } else if (index == 0 ) {
41- return Container (
42- child: SizedBox (
43- height: 3 ,
44- child: LinearProgressIndicator (),
45- ));
46- } else {
47- return SizedBox .shrink ();
48- }
49- },
50- );
51- },
52- separatorBuilder: (context, index) {
53- return Divider (
54- height: 0 ,
55- );
56- },
57- itemCount: list.length,
58- )
59- : state.isbusy
60- ? SizedBox (
61- height: 3 ,
62- child: LinearProgressIndicator (),
63- )
64- : Container (
65- width: fullWidth (context),
66- padding: EdgeInsets .only (top: 0 , left: 30 , right: 30 ),
67- child: NotifyText (
68- title: emptyScreenText,
69- subTitle: emptyScreenSubTileText,
70- ),
71- );
30+ return ListView .separated (
31+ itemBuilder: (context, index) {
32+ return UserTile (
33+ user: list[index],
34+ myId: myId,
35+ );
36+ },
37+ separatorBuilder: (context, index) {
38+ return Divider (
39+ height: 0 ,
40+ );
41+ },
42+ itemCount: list.length,
43+ );
44+ // : LinearProgressIndicator();
7245 }
7346}
7447
0 commit comments