Browse Source

ui 修改

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

1
lib/home/points_mall_page.dart

@ -72,6 +72,7 @@ class _PointsMallPage extends State<PointsMallPage>
}
refreshUserInfo() {
if(mounted)
SharedPreferences.getInstance().then((value) => {
client = ApiService(Dio(),
context: context,

5
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,9 +73,11 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
refreshUserInfo();
}
});
}
refreshUserInfo() {
if(mounted)
SharedPreferences.getInstance().then(
(value) =>
{
@ -82,7 +85,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
context: context,
token: value.getString('token'),
showLoading: false),
if (value.containsKey('user'))
if (value.containsKey('user') && value.getString('user') != null && value.getString('user') != "")
{
userinfo = UserInfo.fromJson(jsonDecode(value.getString('user'))),
},

Loading…
Cancel
Save