文章目录

  • 一、报错信息
  • 二、解决方案

一、报错信息


报错信息 :

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("动画状态 : 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: "动画状态 : 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
====================================================================================================

报错组件 :

Text("动画状态 : $animationStatus"),
Text("动画值 : $animationValue"),

二、解决方案


Flutter 中 Text 组件需要设置文本方向 ;

修改后的代码为 :

Text("动画状态 : $animationStatus", textDirection: TextDirection.ltr,),
Text("动画值 : $animationValue", textDirection: TextDirection.ltr,),

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

  1. 【错误记录】Flutter 界面报错 ( No MediaQuery widget ancestor found. | Scaffold widgets require a MediaQuery )

    文章目录 一.报错信息 二.解决方案 一.报错信息 Flutter 应用运行时报如下错误 : Launching lib\main.dart on Pixel 2 in debug mode... R ...

  2. 【错误记录】Groovy 报错 ( Execution failed for task ‘:compileGroovy‘. > org/apache/tools/ant/taskdefs/Java )

    文章目录 一.报错信息 二.问题分析 三.解决方案 一.报错信息 编译 Groovy 代码时 , 报如下错误 , 该错误不是代码错误 , 而是 Groovy 工程的环境配置错误 ; 相同的环境 , 昨 ...

  3. 【错误记录】前台进程报错 ( Bad notification for startForeground invalid channel for service notification )

    文章目录 一.报错信息 二.解决方案 一.报错信息 使用如下代码启动前台服务 : public class ForegroundService extends Service {public Fore ...

  4. 【错误记录】NDK 报错 java.lang.UnsatisfiedLinkError 的一种处理方案 ( 主应用与依赖库 Module 的 CPU 架构配置不匹配导致 )

    文章目录 一.问题描述 二.问题排查 三.解决方案 一.问题描述 NDK 开发 , 在调用 JNI 对应 Java 类时 , 静态代码块中 System.loadLibrary 语句调用时 , 报如下 ...

  5. 【错误记录】前台进程报错 ( Permission Denial: startForeground requires android.permission.FOREGROUND_SERVICE )

    文章目录 一.报错信息 二.修改方案 一.报错信息 进程保活时 , 遇到的问题 , 手机 Pixel 2 , Android 10.0 系统 ; 2021-04-08 18:17:09.953 155 ...

  6. 【错误记录】国际化报错 ( “xxx“ is not translated in “zh“ (Chinese) )

    文章目录 一.报错信息 二.解决方案 一.报错信息 对应用进行国际化时报错 , 报错信息 : "xxx" is not translated in "zh" ( ...

  7. vue 引用组件报错——找不到组件的解决方案

    vue在开发页面时引用组件报错 在使用vue开发页面时报如下错,到处找问题,components的注入也是写正确的 后来才发现是这里引入写错了,引入组件不能写{} 改成下面这种就可以了 记录下工作中的 ...

  8. QML添加图片资源和自定义组件报错解决

    QML添加图片资源和自定义组件报错解决 建立工程 添加图片资源 使用自定义组件 QML工程如果选择Qt Quick Application,那么添加图片资源和自定义组件会出现不能文件或该类型不存在的错 ...

  9. element-ui中el-date-picker组件报错Prop being mutated: “placement“

    el-date-picker组件报错Prop being mutated: "placement",该问题是element-ui当前版本的源码问题. 在el-date-picker ...

最新文章

  1. linux系统性能监控命令uptime(六)
  2. MVC--Rzaor--例子
  3. 手机腾讯视频android版插件,小程序1.6.5版更新,终于支持腾讯视频插件了
  4. 计算机科学与技术python方向是什么意思-第一模块·开发基础-第1章 Python基础语法...
  5. mac 如何查看anaconda的路径_Mac OS如何直接查看gif图片?分享MAC直接查看gif图片的三种方法...
  6. python文件处理练习
  7. Android开发之Gradle多渠道打包总结
  8. C++之invalid initialization of non-const reference of type ‘int’ from an rvalue of type ‘int’
  9. vue-cli3引入第三方的js依赖包并使用其方法
  10. linux虚拟化管理平台,linux虚拟化管理
  11. 苹果6s强制删除id锁_回收宝:苹果6S手机从细节查真假
  12. 最通俗易懂的 Java 10 新特性讲解 | 原力计划
  13. 图片加载框架之Fresco
  14. 如何保持交互的可见性
  15. 基于SATI的建筑智能化最新调查与进展
  16. 橡胶支座抗压弹性模量计算公式_板式橡胶支座抗压弹性模量检测方法的试验研究...
  17. redis是干什么的
  18. 【Linux】动态防火墙,实现对攻击IP的动态拦截,一定程度上解决云服务器主机经常被境外IP尝试登录,屏蔽指定地区、国家的IP连接
  19. 网站SEO优化知识梳理
  20. java小白日常报错

热门文章

  1. 两道相似题——water-easyJavabeans
  2. 牛腩新闻发布系统(2)使用存储过程查询表
  3. 冬天了,麦克风/话筒 有杂音 的原因!
  4. box_sizing
  5. js事件技巧方法整合
  6. js中获得当前时间是年份和月份
  7. log4j使用方法(一)——先跑起来再说
  8. python优雅写法
  9. Solidworks输出Autocad的DWG格式乱码怎么办
  10. 面试算法:Maxbuild