- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这是我的Flutter中凸起按钮的代码,如果我更换
void main()=> runApp(MaterialApp(home:MyApp()));
与
void main()=> runApp(MyApp());
引发错误
为我提供解决方案……它与flutter和flutter插件的版本是否有联系?
谁能提供这两行之间的区别?
import 'package:flutter/material.dart';
void main() => runApp(MaterialApp(home:MyApp()));
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return Container(
child: Center(
child: RaisedButton(
child: Text("Hello"),
onPressed: (){
print("Hello world");
},
)
),
);
}
}
错误:
Performing hot restart...
Syncing files to device SM G965F...
Restarted application in 1,759ms.
I/flutter (22269): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter (22269): The following assertion was thrown building InkWell(gestures: [tap], clipped to BoxShape.rectangle,
I/flutter (22269): dirty, state: _InkResponseState<InkResponse>#db17e):
I/flutter (22269): No Directionality widget found.
I/flutter (22269): InkWell widgets require a Directionality widget ancestor.
I/flutter (22269): The specific widget that could not find a Directionality ancestor was:
I/flutter (22269): InkWell
I/flutter (22269): The ownership chain for the affected widget is: "InkWell ← DefaultTextStyle ←
I/flutter (22269): AnimatedDefaultTextStyle ← _InkFeatures-[GlobalKey#cee82 ink renderer] ←
I/flutter (22269): NotificationListener<LayoutChangedNotification> ← CustomPaint ← _ShapeBorderPaint ← PhysicalShape
I/flutter (22269): ← _MaterialInterior ← Material ← ⋯"
I/flutter (22269): Typically, the Directionality widget is introduced by the MaterialApp or WidgetsApp widget at the
I/flutter (22269): top of your application widget tree. It determines the ambient reading direction and is used, for
I/flutter (22269): example, to determine how to lay out text, how to interpret "start" and "end" values, and to resolve
I/flutter (22269): EdgeInsetsDirectional, AlignmentDirectional, and other *Directional objects.
I/flutter (22269):
I/flutter (22269): The relevant error-causing widget was:
I/flutter (22269): RaisedButton file:///F:/Flutter_Projects/flutter_test_app/lib/main.dart:16:18
I/flutter (22269):
I/flutter (22269): When the exception was thrown, this was the stack:
I/flutter (22269): #0 debugCheckHasDirectionality.<anonymous closure> (package:flutter/src/widgets/debug.dart:247:7)
I/flutter (22269): #1 debugCheckHasDirectionality (package:flutter/src/widgets/debug.dart:263:4)
I/flutter (22269): #2 InkResponse.debugCheckContext (package:flutter/src/material/ink_well.dart:521:12)
I/flutter (22269): #3 _InkResponseState.build (package:flutter/src/material/ink_well.dart:843:19)
I/flutter (22269): #4 StatefulElement.build (package:flutter/src/widgets/framework.dart:4619:28)
I/flutter (22269): #5 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4502:15)
I/flutter (22269): #6 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4675:11)
I/flutter (22269): #7 Element.rebuild (package:flutter/src/widgets/framework.dart:4218:5)
I/flutter (22269): #8 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4481:5)
I/flutter (22269): #9 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4666:11)
I/flutter (22269): #10 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4476:5)
I/flutter (22269): ... Normal element mounting (92 frames)
I/flutter (22269): #102 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3446:14)
I/flutter (22269): #103 Element.updateChild (package:flutter/src/widgets/framework.dart:3214:18)
I/flutter (22269): #104 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:1148:16)
I/flutter (22269): #105 RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:1119:5)
I/flutter (22269): #106 RenderObjectToWidgetAdapter.attachToRenderTree.<anonymous closure> (package:flutter/src/widgets/binding.dart:1061:17)
I/flutter (22269): #107 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2607:19)
I/flutter (22269): #108 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:1060:13)
I/flutter (22269): #109 WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:941:7)
I/flutter (22269): #110 WidgetsBinding.scheduleAttachRootWidget.<anonymous closure> (package:flutter/src/widgets/binding.dart:922:7)
I/flutter (22269): (elided 11 frames from class _RawReceivePortImpl, class _Timer, dart:async, and dart:async-patch)
I/flutter (22269):
I/flutter (22269): ════════════════════════════════════════════════════════════════════════════════════════════════════
最佳答案
MaterialApp
建立在WidgetApp
之上。这些类用于提供一些基础知识Flutter Widget作为导航处理(仅作为示例)。
错误说:
I/flutter (22269): No Directionality widget found.
MaterialApp
用于提供 Material 设计外观。
关于android - void main()=> runApp(MaterialApp(home:MyApp()))之间的区别;和void main()=> runApp(MyApp());,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61231069/
抱歉,如果不解释整个情况,我想不出更具描述性的标题。 我正在使用 IIS7 和 Tomcat7。我使用 GWT 创建了一个 Web 应用程序,将其打包成一个 war 文件并将其部署在 Tomcat 上
我知道有几个主题与此有关,但几天后我无法定位并解决这个问题。到目前为止我已经完成的步骤: 已安装tomcat 8.5.8 更改了/opt/tomcat/conf/server.xml 中的以下行
(顺便说一下,我正在使用 WebSphere 7) 我有一个带有基本身份验证和配置的安全约束的 Java 网络应用程序(如下所示)。 当我在 http://localhost:9080/myapp/
在 Windows 批处理文件或命令提示符中,调用 start mspaint 和 mspaint 之间有什么区别?它们似乎在做完全相同的事情。 另一个例子,所有 4 个案例似乎都在做同样的事情。如果
在构建我的 C# .NET 项目时,“MyApp.vshost.exe”文件与 Visual Studio 2010 下的“MyApp.exe”一起放置在发布站中。分发“MyApp.exe”时,我应该
我正在使用 Firebase Auth signInWithPopup(),这绝对很棒。但最初配置时,弹出窗口显示: Choose an account to continue to myApp-12
我将 war 文件放在共享驱动器上。我在我的 tomcat ...\conf\Catalina\localhost\myapp.xml 中设置了 docBase,如下所示: 当共享驱动器启动时,tom
身份验证后,asp.net 将我的用户重定向到 .../myapp/default.aspx 而不是 .../myapp/ 有什么办法可以解决这个问题吗?我认为在 url 上包含额外的 default
我知道这听起来可能很愚蠢,但我只是想知道如果我在我的已安装应用程序列表中输入“myapp”而不是“myapp.apps.myappConfig”有什么区别。它与模型有关还是什么? 问候 最佳答案 如果
来自 vshost(在 VS 版本中运行) array pure 00:00:02.9634819 1200000000 Basic: 00:00:04.1682663 来自独立程序(编译版本)
我有错误: BadRequestError: app "dev~myapp" cannot access app "s~myapp"'s data 这很相似,但是 the opposite way a
我已经为我的软件制作了安装程序(使用Inno Setup),最终安装在 C:\Program Files (x86)\MyApp\myapp.exe 像往常一样在 Windows 平台上运行,并且运行
我正在尝试运行 Ratchet 应用程序演示,但我无法执行该文件 这是我的文件结构 /var/www/src/MyApp/ /var/www/src/MyApp/chat.php /var/www/s
这是我的Flutter中凸起按钮的代码,如果我更换 void main()=> runApp(MaterialApp(home:MyApp())); 与 void main()=> runApp(My
就在几天前,我成功将 Ionic 应用程序上传到 Apple Store,而在这一天,我收到了验证警告: The app references non-public selectors in Payl
使用 Morph Labs 的 Appspace 部署站点意味着无法自动将“myapp.com”重定向到“www.myapp.com”(并且无法访问 .htacess)。 是否有 rails 内方式来
当我使用 Java 时,我需要输入类似java -?的命令如果用户在最后输入-?,为什么应用程序知道这个来回复输出?请告诉我识别-?的c代码 最佳答案 它们作为参数传递给 main(): #inclu
我试过使用 Environment.CommandLine 来检查可执行文件,但这没有用,它总是显示 dll 文件。关于如何知道 myapp.exe 文件是否用于运行应用程序或者是否使用 dotnet
我有一个问题,大约 2 天我无法解决。我分析了几乎所有关于这个错误的问题,但我无法处理它。 这是我的树: MyAppRoot -MyApp -libs -jar4.jar
最近我在 Linux Centos 上遇到 Apache Tomcat 6.0.35 的问题。我收到错误 - java.lang.UnsupportedClassVersionError: myApp
我是一名优秀的程序员,十分优秀!