草庐IT

cargill_flutter

全部标签

flutter - InheritedWidget 在小部件树 Flutter 中将数据作为空值提供

我正在尝试将数据从一个小部件传递到树下的另一个小部件。这是我从一个屏幕导航到另一个屏幕的代码:finalpage=LanguagePreferenceProvider(child:UserNameScreen(),language:_currentNationality,);navigate(context,page);navigate()方法:voidnavigate(BuildContextcontext,Widgetpage){Navigator.pushReplacement(context,PageRouteBuilder(pageBuilder:(context,anim1

flutter - FutureBuilder 加载数据时无法显示循环进度指示器

我试图在加载FutureBuilder中的数据时显示循环进度指示器,我尝试了两种方法来添加它,但是它们都不起作用。我怎样才能达到预期的结果?我的代码class_MyHomePageStateextendsState{@overrideMyHomePagegetwidget=>super.widget;@overrideWidgetbuild(BuildContextcontext){//ToshowtheListViewinsidetheFutureBuilderWidgetcreateTasksListView(BuildContextcontext,AsyncSnapshotsna

flutter - FutureBuilder 加载数据时无法显示循环进度指示器

我试图在加载FutureBuilder中的数据时显示循环进度指示器,我尝试了两种方法来添加它,但是它们都不起作用。我怎样才能达到预期的结果?我的代码class_MyHomePageStateextendsState{@overrideMyHomePagegetwidget=>super.widget;@overrideWidgetbuild(BuildContextcontext){//ToshowtheListViewinsidetheFutureBuilderWidgetcreateTasksListView(BuildContextcontext,AsyncSnapshotsna

flutter - 如何增加或减少日期格式输出的天数?

你好,我有这个格式的日期示例:2019年6月4日DateTimenow=DateTime.now();formattedDate=DateFormat.yMMMMd("fr_FR").format(now);我现在尝试在按下按钮后增加或减少天数,但之前的代码不兼容:varnewDate=now.add(newDuration(days:changedate)); 最佳答案 首先:定义你的格式化程序:final_dateFormatter=DateFormat.yMMMMd("fr_FR");然后你需要有一个方法来接收你的日期和天数(

flutter - 如何增加或减少日期格式输出的天数?

你好,我有这个格式的日期示例:2019年6月4日DateTimenow=DateTime.now();formattedDate=DateFormat.yMMMMd("fr_FR").format(now);我现在尝试在按下按钮后增加或减少天数,但之前的代码不兼容:varnewDate=now.add(newDuration(days:changedate)); 最佳答案 首先:定义你的格式化程序:final_dateFormatter=DateFormat.yMMMMd("fr_FR");然后你需要有一个方法来接收你的日期和天数(

flutter - 如何让你的文字换行?

我在一行中有一个文本小部件,它是我从API检索的文本,有时会变得很长。我希望文本在太长时换行并移动到下一行,但是它会溢出。有没有办法来解决这个问题?谢谢我的代码returnListView.builder(itemCount:values==null?0:values.length,itemBuilder:(BuildContextcontext,intindex){returnInk(child:InkWell(child:Card(child:Padding(padding:constEdgeInsets.all(16.0),child:Column(children:[.....

flutter - 如何让你的文字换行?

我在一行中有一个文本小部件,它是我从API检索的文本,有时会变得很长。我希望文本在太长时换行并移动到下一行,但是它会溢出。有没有办法来解决这个问题?谢谢我的代码returnListView.builder(itemCount:values==null?0:values.length,itemBuilder:(BuildContextcontext,intindex){returnInk(child:InkWell(child:Card(child:Padding(padding:constEdgeInsets.all(16.0),child:Column(children:[.....

flutter - TextFormField 值为空

我试图获取TextFormField值。但结果是null主页,children:[UrlTextField(),UsernameTextField(),UrlButton()]UrlTextField(),同UsernameTextField()classUrlTextFieldextendsStatelessWidget{finalmyController=TextEditingController();@overrideWidgetbuild(BuildContextcontext){returnAppTextField(decoration:InputDecoration(pre

flutter - TextFormField 值为空

我试图获取TextFormField值。但结果是null主页,children:[UrlTextField(),UsernameTextField(),UrlButton()]UrlTextField(),同UsernameTextField()classUrlTextFieldextendsStatelessWidget{finalmyController=TextEditingController();@overrideWidgetbuild(BuildContextcontext){returnAppTextField(decoration:InputDecoration(pre

在列中 flutter 不同的对齐方式

我有一个包含三行的列:@overrideWidgetbuild(BuildContextcontext){returnGestureDetector(onTap:(){print('cardofcourseclicked');},child:Card(shape:RoundedRectangleBorder(borderRadius:BorderRadius.circular(8.0)),child:Container(height:144,child:Row(children:[Padding(padding:EdgeInsets.all(16.0),child:ClipRRect(