请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

flutter 启动报错

请问下,老师,flutter启动直接报错 Operand of null-aware operation ‘!’ has type ‘WidgetsBinding’ which excludes null.
…/…/src/smart_refresher.dart:513
图片描述
请指点下,谢谢了

正在回答 回答被采纳积分+3

2回答

CrazyCodeBoy 2022-03-25 20:21:47

你新创建一个项目运行也是这个问题吗,如果是的话可以将flutter版本回退到2.10稳定版看看呢

0 回复 有任何疑惑可以回复我~
CrazyCodeBoy 2022-03-25 12:25:01

这是运行的那一节的代码呢,另外flutter doctor检查下环境的截图发我帮你看看哈

0 回复 有任何疑惑可以回复我~
  • 提问者 精慕门8879228 #1
    flutter --version
    Flutter 2.13.0-0.0.pre.59 • channel master • https://github.com/flutter/flutter.git
    Framework • revision 57aa49028d (2 weeks ago) • 2022-03-09 16:01:03 -0800
    Engine • revision 2c1816b391
    Tools • Dart 2.17.0 (build 2.17.0-182.0.dev) • DevTools 2.11.1
    
    
    
    flutter doctor
    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel master, 2.13.0-0.0.pre.59, on macOS 12.2 21D49 darwin-arm, locale zh-Hans-CN)
    [✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    [✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
        ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
    [✓] Android Studio (version 2021.1)
    [✓] VS Code (version 1.65.2)
    [✓] Connected device (1 available)
    [✓] HTTP Host Availability
    
    ! Doctor found issues in 1 category.
    回复 有任何疑惑可以回复我~ 2022-03-25 13:08:38
  • 提问者 精慕门8879228 #2
    我就是直接启动app就报错了
    回复 有任何疑惑可以回复我~ 2022-03-25 13:09:56
  • 提问者 精慕门8879228 #3
    Future<void> main() async {
      await Global.init();
      runApp(const MyApp());
      SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark); //显示出手机状态栏
    }
    
    class MyApp extends StatelessWidget {
      const MyApp({Key? key}) : super(key: key);
      // This widget is the root of your application.
      @override
      Widget build(BuildContext context) {
        return ScreenUtilInit(
          minTextAdapt: true,
          splitScreenMode: true,
          designSize: const Size(375, 1040),
          builder: () => RefreshConfiguration(
            headerBuilder: () => const ClassicHeader(
              refreshingText: '获取新的数据',
            ),
            footerBuilder: () => const ClassicFooter(
              noDataText: '我是有底线',
            ),
            hideFooterWhenNotFull: true,
            headerTriggerDistance: 80,
            maxOverScrollExtent: 100,
            footerTriggerDistance: 50,
            child:
    回复 有任何疑惑可以回复我~ 2022-03-25 13:11:00

相似问题

登录后可查看更多问答,登录/注册

问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信