草庐IT

dart-isolates

全部标签

dart - 如何将 TextInputType 设置为韩语?

我必须为TextField将TextInputType实现为韩语,但默认TextInputType.text仅为英语。如何将此选项设置为我的特定语言? 最佳答案 当前版本的Flutter尚未实现此功能。问题已发布https://github.com/flutter/flutter/issues/25841所以最好不要与它抗争并等待。 关于dart-如何将TextInputType设置为韩语?,我们在StackOverflow上找到一个类似的问题: https:

dart - 如何在堆栈中定位小部件,但不匹配父级的宽度/高度?

我想在Stack的顶部中心放置一个小部件,但它被拉伸(stretch)到父级的宽度,如下面的屏幕截图所示:这是我使用的代码:@overrideWidgetbuild(BuildContextcontext){returnScaffold(key:key,appBar:AppBar(title:Text("Justatestapp"),),body:Stack(children:[Positioned(left:0,right:0,child:Card(child:Text("Avariablesizedtext"),),),],),);}我想要实现的是这个(但在堆栈中):

dart - 如何在堆栈中定位小部件,但不匹配父级的宽度/高度?

我想在Stack的顶部中心放置一个小部件,但它被拉伸(stretch)到父级的宽度,如下面的屏幕截图所示:这是我使用的代码:@overrideWidgetbuild(BuildContextcontext){returnScaffold(key:key,appBar:AppBar(title:Text("Justatestapp"),),body:Stack(children:[Positioned(left:0,right:0,child:Card(child:Text("Avariablesizedtext"),),),],),);}我想要实现的是这个(但在堆栈中):

dart - 使用 MaterialApp 路由在屏幕旋转时调用 Widget 的 didUpdateWidget 方法

当我在MaterialApp中使用routes时,每当我旋转屏幕/打开键盘等classMyAppextendsStatelessWidget{@overrideWidgetbuild(BuildContextcontext){returnMaterialApp(title:'FlutterDemo',routes:{'/':(_)=>MyHomePage(title:'FlutterDemoHomePage'),},initialRoute:'/',);}}另一方面,当我使用home参数时,旋转屏幕/打开键盘时不会调用didUpdateWidget。classMyAppextendsS

dart - 使用 MaterialApp 路由在屏幕旋转时调用 Widget 的 didUpdateWidget 方法

当我在MaterialApp中使用routes时,每当我旋转屏幕/打开键盘等classMyAppextendsStatelessWidget{@overrideWidgetbuild(BuildContextcontext){returnMaterialApp(title:'FlutterDemo',routes:{'/':(_)=>MyHomePage(title:'FlutterDemoHomePage'),},initialRoute:'/',);}}另一方面,当我使用home参数时,旋转屏幕/打开键盘时不会调用didUpdateWidget。classMyAppextendsS

dart - 使用列表访问 dart flutter 中的函数

如何通过列表访问函数?我有这样的东西:ListprocessList=[[001,'Volume',0.8,0,0],[002,'Complexity',0.5,0,0],[003,'Silence',0.3,0,0],[004,'Notice',0.3,0,0],....];我希望001、002等成为我可以调用的函数processList[i][0]();就像一个函数列表...我无法以某种方式弄清楚它的语法,我唯一能做的就是用函数的结果填充列表,但这不是我需要的。 最佳答案 尝试voidmain(){ListprocessList

dart - 使用列表访问 dart flutter 中的函数

如何通过列表访问函数?我有这样的东西:ListprocessList=[[001,'Volume',0.8,0,0],[002,'Complexity',0.5,0,0],[003,'Silence',0.3,0,0],[004,'Notice',0.3,0,0],....];我希望001、002等成为我可以调用的函数processList[i][0]();就像一个函数列表...我无法以某种方式弄清楚它的语法,我唯一能做的就是用函数的结果填充列表,但这不是我需要的。 最佳答案 尝试voidmain(){ListprocessList

dart - 安装google api日历时出现flutter dart错误

我将显示来自Google日历的事件列表。我已经按照以下链接中的示例进行操作:HowtouseGoogleAPIinflutter?我的脚本如下:将'package:http/http.dart'导入为http;假设我已经登录。GoogleSignIn_googleSignIn=GoogleSignIn(scopes:['email','https://www.googleapis.com/auth/contacts.readonly','https://www.googleapis.com/auth/calendar'],);'classGoogleHttpClientextendsh

dart - 安装google api日历时出现flutter dart错误

我将显示来自Google日历的事件列表。我已经按照以下链接中的示例进行操作:HowtouseGoogleAPIinflutter?我的脚本如下:将'package:http/http.dart'导入为http;假设我已经登录。GoogleSignIn_googleSignIn=GoogleSignIn(scopes:['email','https://www.googleapis.com/auth/contacts.readonly','https://www.googleapis.com/auth/calendar'],);'classGoogleHttpClientextendsh

dart - 选择时更改 ListTile 的背景颜色和自定义高度的 tiles flutter

我已经制作了一个GridView,但是现在我在这个GridView中有一些ListTiles需要被选中在选择时,我想要改变背景颜色。而且我还面临另一个问题,我想自定义这些ListTile的高度,但我没有成功。我将附上图片、我得到的输出和我想要的输出。我得到了什么:我想要的:代码如下:class_SelectLanguageNewStateextendsState{ListlistResponseData;bool_color;@overridevoidinitState(){//TODO:implementinitStatesuper.initState();getLang();_co