026
根據(jù)這種報(bào)錯(cuò)能看到子組件和父組件類型不匹配碗淌,
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先朦。
報(bào)這個(gè)錯(cuò)是因?yàn)檠嗌伲琍ositioned放到了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? ? │
這是安卓最低支持版本問(wèn)題埃篓,到安卓基礎(chǔ)信息配置文件中,更改一下安卓最低支持版本即可疆股,
位置在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
接收J(rèn)SON數(shù)據(jù)解析問(wèn)題,double對(duì)應(yīng)浮點(diǎn)類型押桃,int對(duì)應(yīng)整數(shù)葵萎,
但網(wǎng)址JSON轉(zhuǎn)model导犹,會(huì)將12.0自動(dòng)轉(zhuǎn)成整數(shù)類型,需要我們手動(dòng)更改一下
[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中添加過(guò)寬的部件羡忘,需要包一個(gè)Expanded
017
Unable to load asset: "assets/image/my/my_vip_icon.png".
需要到pubspec中配置圖片路徑
011
401報(bào)錯(cuò)
Client error - the request contains bad syntax or cannot be fulfilled"
請(qǐng)求頭配置有問(wèn)題谎痢,
010 Dio解析錯(cuò)誤
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.
調(diào)用第三方或者使用了底層數(shù)據(jù),需要在調(diào)用之前初始化
WidgetsFlutterBinding.ensureInitialized()
008.
Vertical viewport was given unbounded height.
垂直視口被賦予了無(wú)限高度卷雕。
007
Vertical viewport was given unbounded height.
不可滾動(dòng)的部件內(nèi)容過(guò)高或過(guò)寬導(dǎo)致的节猿,
如在Column中使用GridView。
GridView.builder沒(méi)有設(shè)置滾動(dòng)漫雕,就會(huì)導(dǎo)致這種情況
將其shrinkWrap屬性設(shè)置為可滾動(dòng)即可
shrinkWrap: true,
或者使用Expanded將GridView包裹起來(lái)滨嘱。
006
A RenderFlex overflowed by 392 pixels on the bottom.
說(shuō)明內(nèi)容超出了屏幕高度或?qū)挾龋@是因?yàn)樗貌考皇菨L動(dòng)的浸间,請(qǐng)改用滾動(dòng)部件太雨,
或者使用Expanded包裹起來(lái)。
005魁蒜、
"RecommendLogic" not found. You need to call "Get.put(RecommendLogic())" or "Get.lazyPut(()=>RecommendLogic())"
需要再M(fèi)ainBinding 中將RecommendLogic做捆綁
004囊扳、
Cannot find declaration to go to
003、
部分插件在適配空安全的版本放棄維護(hù)了兜看,得自行更新或?qū)ふ姨娲断蹋纾?flutter_swiper 變?yōu)?flutter_swiper_null_safety ,插件更新后要注意項(xiàng)目中的用法是否需要更新
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?
刪掉這個(gè)兩個(gè)文件细移,然后重新運(yùn)行搏予,