采纳答案成功!
向帮助你的同学说点啥吧!感谢那些助人为乐的人
请问下,老师,flutter启动直接报错 Operand of null-aware operation ‘!’ has type ‘WidgetsBinding’ which excludes null. …/…/src/smart_refresher.dart:513 请指点下,谢谢了
你新创建一个项目运行也是这个问题吗,如果是的话可以将flutter版本回退到2.10稳定版看看呢
这是运行的那一节的代码呢,另外flutter doctor检查下环境的截图发我帮你看看哈
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.
我就是直接启动app就报错了
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:
登录后可查看更多问答,登录/注册
一次性掌握Flutter高阶技能+商业级复杂项目架构设计与开发方案
994 2
1.4k 8
1.1k 2
1.8k 5
1.0k 2