Browse Source

ui 修改

null_safety
fmk 4 years ago
parent
commit
e4071b0323
  1. 19
      lib/home/points_mall_page.dart
  2. 31
      lib/mine/mine_page.dart

19
lib/home/points_mall_page.dart

@ -72,15 +72,16 @@ class _PointsMallPage extends State<PointsMallPage>
}
refreshUserInfo() {
SharedPreferences.getInstance().then((value) => {
client = ApiService(Dio(),
context: context,
token: value.getString('token'),
showLoading: false),
SmartDialog.showLoading(msg: S.current.zhengzaijiazai),
creditGoods(categoryId),
queryUser(),
});
if(mounted)
SharedPreferences.getInstance().then((value) => {
client = ApiService(Dio(),
context: context,
token: value.getString('token'),
showLoading: false),
SmartDialog.showLoading(msg: S.current.zhengzaijiazai),
creditGoods(categoryId),
queryUser(),
});
}
int pageNum = 1;

31
lib/mine/mine_page.dart

@ -64,6 +64,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
super.initState();
refreshUserInfo();
eventBus.on<EventType>().listen((event) {
print("EventType: Mine");
print("EventType: ${event.type}");
if (event.type < 3) {
setState(() {});
@ -72,23 +73,25 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
refreshUserInfo();
}
});
}
refreshUserInfo() {
SharedPreferences.getInstance().then(
(value) =>
{
apiService = ApiService(Dio(),
context: context,
token: value.getString('token'),
showLoading: false),
if (value.containsKey('user'))
{
userinfo = UserInfo.fromJson(jsonDecode(value.getString('user'))),
},
queryUserInfo()
},
);
if(mounted)
SharedPreferences.getInstance().then(
(value) =>
{
apiService = ApiService(Dio(),
context: context,
token: value.getString('token'),
showLoading: false),
if (value.containsKey('user') && value.getString('user') != null && value.getString('user') != "")
{
userinfo = UserInfo.fromJson(jsonDecode(value.getString('user'))),
},
queryUserInfo()
},
);
}
UserInfo userinfo;

Loading…
Cancel
Save