草庐IT

dynamic-text

全部标签

dart - 每 5 分钟或定期刷新 Flutter Text 小部件内容

我有一个FlutterText小部件,它的内容是通过外部REST调用填充的。我想通过调用REST端点每5分钟定期刷新小部件内容。到目前为止,我设法每5分钟调用一次端点,但无法使用来自网络的新数据更新/刷新小部件内容。classPatientCount{intcount;doubleamount;PatientCount({this.count,this.amount});PatientCount.fromJson(Mapmap):count=map['count'],amount=map['amount'];}FuturefetchPatientCount()async{varurl=

dart - 每 5 分钟或定期刷新 Flutter Text 小部件内容

我有一个FlutterText小部件,它的内容是通过外部REST调用填充的。我想通过调用REST端点每5分钟定期刷新小部件内容。到目前为止,我设法每5分钟调用一次端点,但无法使用来自网络的新数据更新/刷新小部件内容。classPatientCount{intcount;doubleamount;PatientCount({this.count,this.amount});PatientCount.fromJson(Mapmap):count=map['count'],amount=map['amount'];}FuturefetchPatientCount()async{varurl=

flutter : Text floating on the container margin or padding

我正在尝试制作一个ListView,其中的项目由里面一行4个展开的容器每个容器里面都有一个中心部件和一个文本关键是我想为每个项目做一个底边距但当它需要更多空间时,文本会浮在上面这是我的代码首先是ListViewWidget_buildList(Listlist,BuildContextcontext){returnExpanded(child:ListView.builder(itemBuilder:(BuildContextcontext,intindex){Stringid=list[index]["default_code"].toString();Stringname=list

flutter : Text floating on the container margin or padding

我正在尝试制作一个ListView,其中的项目由里面一行4个展开的容器每个容器里面都有一个中心部件和一个文本关键是我想为每个项目做一个底边距但当它需要更多空间时,文本会浮在上面这是我的代码首先是ListViewWidget_buildList(Listlist,BuildContextcontext){returnExpanded(child:ListView.builder(itemBuilder:(BuildContextcontext,intindex){Stringid=list[index]["default_code"].toString();Stringname=list

dart - 我无法添加 Text(installedApps[index] ["app_name"]) 因为 'index' 未定义。我怎样才能添加这个文本?

我正在构建一个flutter应用程序。我已经构建了一个带有构造函数的类。我制作了构造函数,因此我可以自定义我的ListTile像这样:classAppListextendsStatefulWidget{@overrideAppListStatecreateState()=>AppListState();AppList({Keykey,this.child}):super(key:key);finalWidgetchild;}classAppListStateextendsState{Widgetchild;List>_installedApps;@overridevoidinitSta

dart - 我无法添加 Text(installedApps[index] ["app_name"]) 因为 'index' 未定义。我怎样才能添加这个文本?

我正在构建一个flutter应用程序。我已经构建了一个带有构造函数的类。我制作了构造函数,因此我可以自定义我的ListTile像这样:classAppListextendsStatefulWidget{@overrideAppListStatecreateState()=>AppListState();AppList({Keykey,this.child}):super(key:key);finalWidgetchild;}classAppListStateextendsState{Widgetchild;List>_installedApps;@overridevoidinitSta

flutter - 类型 List<dynamic> 不是类型 'Map<String, dynamic>' 的子类型

我正在尝试从API获取数据。我收到错误消息“类型列表不是map的子类型。我是新手,不明白我在哪里犯了错误。这是我的fetchpost函数:FuturefetchPost()async{finalresponse=awaithttp.get('http://starlord.hackerearth.com/beercraft');if(response.statusCode==200){returnPost.fromJson(json.decode(response.body));}else{throwException('Failedtoloadpost');}}在我的主屏幕中,我使用

flutter - 类型 List<dynamic> 不是类型 'Map<String, dynamic>' 的子类型

我正在尝试从API获取数据。我收到错误消息“类型列表不是map的子类型。我是新手,不明白我在哪里犯了错误。这是我的fetchpost函数:FuturefetchPost()async{finalresponse=awaithttp.get('http://starlord.hackerearth.com/beercraft');if(response.statusCode==200){returnPost.fromJson(json.decode(response.body));}else{throwException('Failedtoloadpost');}}在我的主屏幕中,我使用

android - Flutter Firebase Error Null fundtion(FirebaseUser)无法分配给参数,仪表类型 FutureOr <dynamic>

在我的Firebase身份验证中,我遇到了错误:error:Theargumenttype'NullFunction(FirebaseUser)'can'tbeassignedtotheparametertype'FutureOrFunction(AuthResult)'.(argument_type_not_assignableat[authentication]lib\loginpage.dart:44)如果导入firebase_auth和flutterMaterialonPressed:(){FirebaseAuth.instance.signInWithEmailAndPass

android - Flutter Firebase Error Null fundtion(FirebaseUser)无法分配给参数,仪表类型 FutureOr <dynamic>

在我的Firebase身份验证中,我遇到了错误:error:Theargumenttype'NullFunction(FirebaseUser)'can'tbeassignedtotheparametertype'FutureOrFunction(AuthResult)'.(argument_type_not_assignableat[authentication]lib\loginpage.dart:44)如果导入firebase_auth和flutterMaterialonPressed:(){FirebaseAuth.instance.signInWithEmailAndPass