Flutter 踩坑 macos项目无法运行

error: unable to parse contents of file list '/Users/用户名/Desktop/Code/Flutter/tyty_flutter/macos/Flutter/ephemeral/FlutterInputs.xcfilelist'

error: unable to parse contents of file list '/Users/用户名/Desktop/Code/Flutter/tyty_flutter/macos/Flutter/ephemeral/FlutterOutputs.xcfilelist'

遇到这种错误不要慌,先用安卓studio或者VS Code跑一下 然后再run 你的工程就可以啦!

Navigator operation requested with a context that does not include a Navigator.
The context used to push or pop routes from the Navigator must be that of a widget that is a descendant of a Navigator widget.

遇到这种push报错,不要慌,慌也没用,提示错误是上下文类型不对,看看你的runApp函数写法和官方写法有什么不同吧(暂时总结为:要使用Navigator,根元素不能是MaterialApp)

1、Flutter Column 套 ListView 不显示

将 ListView 放到 Column 内部后无法显示 ListView 内容。遇到这种问题 不要慌 慌也没用
将 ListView 用 Expand 包裹起来。完事儿!

Share