@@ -17,19 +17,28 @@ class UserItem extends StatelessWidget {
1717
1818 final bool needImage;
1919
20- const UserItem (this .userItemViewModel, {super .key, this .onPressed, this .needImage = true });
20+ const UserItem (this .userItemViewModel,
21+ {super .key, this .onPressed, this .needImage = true });
2122
2223 @override
2324 Widget build (BuildContext context) {
2425 var me = StoreProvider .of <GSYState >(context).state.userInfo! ;
2526 Widget userImage = IconButton (
26- padding: const EdgeInsets .only (top: 0.0 , left: 0.0 , bottom: 0.0 , right: 10.0 ),
27+ padding: const EdgeInsets .only (
28+ top: 0.0 , left: 0.0 , bottom: 0.0 , right: 10.0 ),
2729 icon: ClipOval (
2830 child: FadeInImage .assetNetwork (
2931 placeholder: GSYICons .DEFAULT_USER_ICON ,
32+ key: (userItemViewModel.userPic != null &&
33+ userItemViewModel.userPic! .isNotEmpty)
34+ ? ValueKey (userItemViewModel.userPic)
35+ : null ,
3036 //预览图
3137 fit: BoxFit .fitWidth,
32- image: userItemViewModel.userPic ?? "https://github.com/CarGuo/gsy_github_app_flutter/blob/master/logo.png?raw=true" ,
38+ image: (userItemViewModel.userPic != null &&
39+ userItemViewModel.userPic! .isNotEmpty)
40+ ? userItemViewModel.userPic!
41+ : "https://github.com/CarGuo/gsy_github_app_flutter/blob/master/logo.png?raw=true" ,
3342 width: 40.0 ,
3443 height: 40.0 ,
3544 ),
0 commit comments