026
根据这种报错能看到子组件和父组件类型不匹配,
SizedBox 继承自SingleChildRenderObjectWidget继承自RenderObjectWidget
而它SizedBox的父组件要求是RenderSliver类型的子集
A RenderViewport expected a child of typeRenderSliverbut received a child of typeRenderConstrainedBox.
父类需要的是RenderSliver 类型的子集但收到了RenderConstrainedBox类型的
The RenderConstrainedBox that did not match the expected child type was created by:SizedBox< Viewport <
IgnorePointer-[GlobalKey#94dc6] Semantics Listener _GestureSemantics <
RawGestureDetector-[LabeledGlobalKey#8bdab] € Listener € _ScrollableScope €
025、类型不匹配
Positioned widget 用于定位 Stack 的子 widget。
报这个错是因为,Positioned放到了Column中。
Incorrect use of ParentDataWidget.
The ParentDataWidget Positioned(left: 0.0, right: 0.0, bottom: 0.0) wants to apply ParentData of type StackParentData to a RenderObject, which has been set up to accept ParentData of incompatible type FlexParentData.
Usually, this means that the Positioned widget has the wrong ancestor RenderObjectWidget. Typically, Positioned widgets are placed directly inside Stack widgets
The offending Positioned is currently placed inside a Column widget.
024
flutter: error==== {"error":{"message":"Required request body is missing: public void com.wd.paas.controller.ApiV4ModuleController.chatCompletion(java.lang.String,com.wd.paas.domain.v4.chat.ChatCompletionRequest,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)","code":"400"}}
flutter: pustChatGPT==== null
022、
│ Following this change, your app will not be available to users running Android SDKs below 21. │
│ Consider searching for a version of this plugin that supports these lower versions of the │
这是安卓最低支持版本问题,到安卓基础信息配置文件中,更改一下安卓最低支持版本即可,
位置在Android/app/build.gradle中,修改他的值minSdkVersion
021
Unhandled Exception: MissingPluginException(No implementation found for method isInstalled on channel v7lin.github.io/alipay_kit)
Unhandled Exception: MissingPluginException(No implementation found for method isInstalled on channel v7lin.github.io/alipay_kit)
020
接收JSON数据解析问题,double对应浮点类型,int对应整数,
但网址JSON转model,会将12.0自动转成整数类型,需要我们手动更改一下
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'int' is not a subtype of type 'double?'
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'double' is not a subtype of type 'int?'
019
Vertical viewport was given unbounded height.
018
BoxConstraints forces an infinite width.
在row中添加过宽的部件,需要包一个Expanded
017
Unable to load asset: "assets/image/my/my_vip_icon.png".
需要到pubspec中配置图片路径
011
401报错
Client error - the request contains bad syntax or cannot be fulfilled"
请求头配置有问题,
010 Dio解析错误
Reloaded 1 of 1452 libraries in 466ms (compile: 108 ms, reload: 168 ms, reassemble: 152 ms).
[🔔 Dio] The data is a type of Map (_Map), but the transformer can only encode Map.
If you are writing maps using {}, consider writing{}.
009
Typically, this is done by calling "WidgetsFlutterBinding.ensureInitialized()" or "runApp()" (the latter calls the former). Typically this call is done in the "void main()" method. The "ensureInitialized" method is idempotent; calling it multiple times is not harmful. After calling that method, the "instance" getter will return the binding.
调用第三方或者使用了底层数据,需要在调用之前初始化
WidgetsFlutterBinding.ensureInitialized()
008.
Vertical viewport was given unbounded height.
垂直视口被赋予了无限高度。
007
Vertical viewport was given unbounded height.
不可滚动的部件内容过高或过宽导致的,
如在Column中使用GridView。
GridView.builder没有设置滚动,就会导致这种情况
将其shrinkWrap属性设置为可滚动即可
shrinkWrap: true,
或者使用Expanded将GridView包裹起来。
006
A RenderFlex overflowed by 392 pixels on the bottom.
说明内容超出了屏幕高度或宽度,这是因为所用部件不是滚动的,请改用滚动部件,
或者使用Expanded包裹起来。
005、
"RecommendLogic" not found. You need to call "Get.put(RecommendLogic())" or "Get.lazyPut(()=>RecommendLogic())"
需要再MainBinding 中将RecommendLogic做捆绑
004、
Cannot find declaration to go to
003、
部分插件在适配空安全的版本放弃维护了,得自行更新或寻找替代,如: flutter_swiper 变为 flutter_swiper_null_safety ,插件更新后要注意项目中的用法是否需要更新
002
Error (Xcode): Build input file cannot be found: '/Users/tyu/.pub-cache/hosted/pub.flutter-io.cn/video_player_avfoundation-2.5.1/darwin/Classes/messages.g.m'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it?
删掉这个两个文件,然后重新运行,