草庐IT

dart-polymer

全部标签

flutter - 无法将 rest api json 转换为 dart 对象

在使用jsondecode转换restapi响应后无法循环我有来自laravel后端的restapi,我正在尝试使用flutter应用程序。使用jsondecode转换响应后无法遍历它并制作一个列表以在小部件View中使用apiJSON响应:{"success":true,"data":[{"id":1,"user_id":1,"mobile_num":"34567","date_before":"2018-12-2000:00:00","cargo_id":3,"weight":12,"description":"medicalstoer","country_id":22,"dele

flutter - 无法将 rest api json 转换为 dart 对象

在使用jsondecode转换restapi响应后无法循环我有来自laravel后端的restapi,我正在尝试使用flutter应用程序。使用jsondecode转换响应后无法遍历它并制作一个列表以在小部件View中使用apiJSON响应:{"success":true,"data":[{"id":1,"user_id":1,"mobile_num":"34567","date_before":"2018-12-2000:00:00","cargo_id":3,"weight":12,"description":"medicalstoer","country_id":22,"dele

dart - 获取文件大小而不下载它

如何从URL获取文件大小(在Flutter中)?我可以通过以下方式获得它:http.Responseresponse=awaithttp.get(url);print(response.contentLength);但这会下载整个文件。是否可以在不完全下载文件的情况下获取文件大小?谢谢 最佳答案 找到答案:HEAD请求。http.Responser=awaithttp.head(url);r.headers["content-length"]注意:r.contentLength;直接不行。

dart - 获取文件大小而不下载它

如何从URL获取文件大小(在Flutter中)?我可以通过以下方式获得它:http.Responseresponse=awaithttp.get(url);print(response.contentLength);但这会下载整个文件。是否可以在不完全下载文件的情况下获取文件大小?谢谢 最佳答案 找到答案:HEAD请求。http.Responser=awaithttp.head(url);r.headers["content-length"]注意:r.contentLength;直接不行。

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

dart - DropdownMenuItem 如何获取文本小部件的字符串数据

List>department=[];@overridevoidinitState(){super.initState();department.add(DropdownMenuItem(value:'DEP0000001',child:Text('IT-SAP'),));department.add(DropdownMenuItem(value:'DEP0000002',child:Text('HR-Admin'),));department.add(DropdownMenuItem(value:'DEP0000003',child:Text('Engineering'),));}@

dart - DropdownMenuItem 如何获取文本小部件的字符串数据

List>department=[];@overridevoidinitState(){super.initState();department.add(DropdownMenuItem(value:'DEP0000001',child:Text('IT-SAP'),));department.add(DropdownMenuItem(value:'DEP0000002',child:Text('HR-Admin'),));department.add(DropdownMenuItem(value:'DEP0000003',child:Text('Engineering'),));}@

dart - 如何修复 "pub get failed(1)"

我想构建一个使用firestore的Flutter应用程序。我实现了Firestore,当我点击“Packagesget”时出现了这个错误。ThecurrentDartSDKversionis2.1.0-dev.9.4.flutter-f9ebf21297.Becausekegel_apprequiresSDKversion>=1.19.0我该如何解决这个问题?:/Pubspec.yamlversion:1.0.0+1environment:sdk:">=2.0.0-dev.68.0 最佳答案 kegel_app是一个依赖项Beca

dart - 如何修复 "pub get failed(1)"

我想构建一个使用firestore的Flutter应用程序。我实现了Firestore,当我点击“Packagesget”时出现了这个错误。ThecurrentDartSDKversionis2.1.0-dev.9.4.flutter-f9ebf21297.Becausekegel_apprequiresSDKversion>=1.19.0我该如何解决这个问题?:/Pubspec.yamlversion:1.0.0+1environment:sdk:">=2.0.0-dev.68.0 最佳答案 kegel_app是一个依赖项Beca