Flutter 常见问题

2020-07-16  本文已影响0人  DerekTime

1.If you're running an application and need to access the binary messenger before runApp() has been called...

void main() {//第一行加 WidgetsFlutterBinding.ensureInitialized(); PackageInfo.fromPlatform().then((packageInfo) { ZsConfig.packageInfo = packageInfo; runApp(MyApp()); });}
  1. import 'package: ***'; 不提示

暂时是重新创建了一个工程,把代码复制过去了,不知道到底该怎么办,求大神留言指导。

3.Unhandled Exception: 'package:flutter/src/widgets/scroll_controller.dart': Failed assertion: line 110 pos 12: '_positions.isNotEmpty': ScrollController not attached to any scroll views.

if (ctx.state.orderListController.hasClients){
ctx.state.orderListController.animateTo(ctx.state.orderListController.position.maxScrollExtent, curve: Curves.ease, duration:Duration(milliseconds:500));
}
上一篇下一篇

猜你喜欢

热点阅读