var result =
await LoginDao.registration(userName, password, imoocid, orderId);
print(2222);
print(result);
if (result[‘code’] == 0) {
print(‘注册成功’);
if (widget.onJumpToLogin != null) {
widget.onJumpToLogin();
}
} else {
print(result[‘meg’]);
}
按照视频中写完之后 发现会报错
flutter: 2222
flutter: null
[VERBOSE-2:ui_dart_state.cc(186)] Unhandled Exception: NoSuchMethodError: The method ‘[]’ was called on null.
Receiver: null
Tried calling:
flutter: HiNet:{code: 5004, msg: 请先购买课程@https://coding.imooc.com/class/487.html}
await没有等待 直接执行到后面 导致result是null 请问这是为什么
一次性掌握Flutter高阶技能+商业级复杂项目架构设计与开发方案
了解课程