httpErrorHandle(
response: res,
context: context,
onSuccess: () async {
SharedPreferences prefs = await SharedPreferences.getInstance();
Provider.of<UserProvider>(context, listen: false).setUser(res.body);
await prefs.setString('x-auth-token', jsonDecode(res.body)['token']);
Navigator.pushNamedAndRemoveUntil(
context,
HomeScreen.routeName,
(route) => false,
);
},
);
我没有找到任何相关的解决方案,此代码使应用程序崩溃
1条答案
按热度按时间ql3eal8s1#