草庐IT

colors - 透明背景的 Flutter 卡片

我试图让我的卡片透明以便在背景中显示。我曾尝试将卡片的颜色属性设置为透明,但它显示的是不透明的灰色背景。我也尝试使用不同不透明度的白色,但结果不是透明的纯白色。Card(color:Colors.transparent,child:Padding(padding:constEdgeInsets.all(16),child:Column(crossAxisAlignment:CrossAxisAlignment.stretch,children:[CardLabelSmall("CurrentPremixPlanDocument"),Expanded(child:PremixPlanDo

flutter - 如何在 flutter 中更新 SilverGrid 或 SilverList 的项目? Flutter 中是否有等同于 notifyDatasetChanged() 的东西?

使用thesamplecodeprovidedbyEmilyFortunainaMediumarticle,"Slivers,Demystified",我使用SilverList和SilverGrid类创建了一个Flutter列表。但是创建列表后我无法更改数据。import'package:flutter/material.dart';import'dart:math'asmath;voidmain()=>runApp(MyApp());classMyAppextendsStatelessWidget{@overrideWidgetbuild(BuildContextcontext){

flutter - 如何在 flutter 中更新 SilverGrid 或 SilverList 的项目? Flutter 中是否有等同于 notifyDatasetChanged() 的东西?

使用thesamplecodeprovidedbyEmilyFortunainaMediumarticle,"Slivers,Demystified",我使用SilverList和SilverGrid类创建了一个Flutter列表。但是创建列表后我无法更改数据。import'package:flutter/material.dart';import'dart:math'asmath;voidmain()=>runApp(MyApp());classMyAppextendsStatelessWidget{@overrideWidgetbuild(BuildContextcontext){

flutter - 错误 : NoSuchMethodError, 在 null 上调用了 getter 'index'

我正在使用AnimatedContainer,以便它的高度可以(通过动画)适应其中存在的选项卡内容。我应该可以使用DefaultTabController.of(context).index访问选项卡的当前索引,并且我正在将此数据传输到一个函数,该函数将根据当前选项卡重建小部件。当我运行代码时,它向我显示错误,但我不明白:这是否意味着DefaultTabController返回null?代码如下:import'package:flutter/material.dart';import'package:travel_agent_app/loginForm.dart';import'pac

flutter - 错误 : NoSuchMethodError, 在 null 上调用了 getter 'index'

我正在使用AnimatedContainer,以便它的高度可以(通过动画)适应其中存在的选项卡内容。我应该可以使用DefaultTabController.of(context).index访问选项卡的当前索引,并且我正在将此数据传输到一个函数,该函数将根据当前选项卡重建小部件。当我运行代码时,它向我显示错误,但我不明白:这是否意味着DefaultTabController返回null?代码如下:import'package:flutter/material.dart';import'package:travel_agent_app/loginForm.dart';import'pac

datetime - Flutter DateTime,打开关闭如果

我想在上午9:00到晚上20:00之间显示小部件,其他时间显示另一个小部件例如现在13:00myshopopen我想显示开我的店。谢谢openSaat(){returnContainer(width:170,height:40,decoration:BoxDecoration(color:Colors.black),child:Row(mainAxisAlignment:MainAxisAlignment.center,children:[CircleAvatar(backgroundColor:Colors.green,radius:12,),SizedBox(width:5,),T

datetime - Flutter DateTime,打开关闭如果

我想在上午9:00到晚上20:00之间显示小部件,其他时间显示另一个小部件例如现在13:00myshopopen我想显示开我的店。谢谢openSaat(){returnContainer(width:170,height:40,decoration:BoxDecoration(color:Colors.black),child:Row(mainAxisAlignment:MainAxisAlignment.center,children:[CircleAvatar(backgroundColor:Colors.green,radius:12,),SizedBox(width:5,),T

laravel - Flutter - 使用 laravel 获取方法 api

我有flutter应用程序,我正在尝试调用api,并获取json,但它对我不起作用它向我显示了这个错误I/flutter(13300):getter'length'被调用为null。I/flutter(13300):接收器:nullI/flutter(13300):尝试调用:length模型Category_list.dartclassCategory{Listdata;Stringstatus;Category({this.data,this.status});factoryCategory.fromJson(Mapjson){varlist1=json['data']asList;

laravel - Flutter - 使用 laravel 获取方法 api

我有flutter应用程序,我正在尝试调用api,并获取json,但它对我不起作用它向我显示了这个错误I/flutter(13300):getter'length'被调用为null。I/flutter(13300):接收器:nullI/flutter(13300):尝试调用:length模型Category_list.dartclassCategory{Listdata;Stringstatus;Category({this.data,this.status});factoryCategory.fromJson(Mapjson){varlist1=json['data']asList;

flutter - 导航器中的未定义名称 'context'

我是flutter的初学者,几天前才开始。我想从一个小部件转到另一个文件中的另一个小部件。但是当我使用导航器时它显示错误。我已经尝试使用一些关于堆栈溢出的类似问题的答案来解决它,但我无法解决它。另外,我无法正确理解这些内容。这些是其中的一些:Undefinedname'context'Undefinedname'context'influtternavigation“take_attendance.dart”classTakeAttendanceextendsStatefulWidget{staticStringtag='take-attendance';@override_TakeA