日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

【错误记录】Flutter 组件报错 ( No Directionality widget found. | RichText widgets require a Directionality )

發(fā)布時(shí)間:2025/6/17 编程问答 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【错误记录】Flutter 组件报错 ( No Directionality widget found. | RichText widgets require a Directionality ) 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

文章目錄

  • 一、報(bào)錯(cuò)信息
  • 二、解決方案





一、報(bào)錯(cuò)信息



報(bào)錯(cuò)信息 :

Performing hot reload... Syncing files to device Pixel 2... Reloaded 0 libraries in 353ms.======== Exception caught by widgets library ======================================================= The following assertion was thrown building Text("動(dòng)畫狀態(tài) : null"): No Directionality widget found.RichText widgets require a Directionality widget ancestor.The specific widget that could not find a Directionality ancestor was: RichTextsoftWrap: wrapping at box widthmaxLines: unlimitedtext: "動(dòng)畫狀態(tài) : null"dirty The ownership chain for the affected widget is: "RichText ← Text ← Column ← Padding ← Container ← AnimationApp ← [root]"Typically, the Directionality widget is introduced by the MaterialApp or WidgetsApp widget at the top of your application widget tree. It determines the ambient reading direction and is used, for example, to determine how to lay out text, how to interpret "start" and "end" values, and to resolve EdgeInsetsDirectional, AlignmentDirectional, and other *Directional objects.The relevant error-causing widget was: Text file:///D:/002_Project/002_Android_Learn/flutter_animation/lib/main.dart:118:11 When the exception was thrown, this was the stack: #0 debugCheckHasDirectionality.<anonymous closure> (package:flutter/src/widgets/debug.dart:272:7) #1 debugCheckHasDirectionality (package:flutter/src/widgets/debug.dart:292:4) #2 RichText.createRenderObject (package:flutter/src/widgets/basic.dart:5539:37) #3 RenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5423:28) #4 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6166:11) ... ============================================================================================================ Exception caught by widgets library ======================================================= No Directionality widget found. The relevant error-causing widget was: Text file:///D:/002_Project/002_Android_Learn/flutter_animation/lib/main.dart:120:11 ============================================================================================================ Exception caught by rendering library ===================================================== A RenderFlex overflowed by 199358 pixels on the bottom. The relevant error-causing widget was: Column file:///D:/002_Project/002_Android_Learn/flutter_animation/lib/main.dart:96:14 ====================================================================================================

報(bào)錯(cuò)組件 :

Text("動(dòng)畫狀態(tài) : $animationStatus"), Text("動(dòng)畫值 : $animationValue"),



二、解決方案



Flutter 中 Text 組件需要設(shè)置文本方向 ;

修改后的代碼為 :

Text("動(dòng)畫狀態(tài) : $animationStatus", textDirection: TextDirection.ltr,), Text("動(dòng)畫值 : $animationValue", textDirection: TextDirection.ltr,),

總結(jié)

以上是生活随笔為你收集整理的【错误记录】Flutter 组件报错 ( No Directionality widget found. | RichText widgets require a Directionality )的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。