草庐IT

dynamic-sizing

全部标签

flutter - 类型 'Future<dynamic>' 不是类型 'Future<List<History>>' 的子类型

使用这段代码已经有一段时间了,试图在flutter中创建一个历史数据库。似乎找不到Future的问题。如有任何帮助,我们将不胜感激!提前致谢!import'dart:convert';HistoryhistoryFromJson(Stringstr){finaljsonData=json.decode(str);returnHistory.fromJson(jsonData);}StringhistoryToJson(Historydata){finaldyn=data.toJson();returnjson.encode(dyn);}classHistory{intid;String

flutter - 错误 : The argument type '(int) → dynamic' can't be assigned to the parameter type '(String) → void'

我有一些字段发布String和int,String字段工作正常,我在数据库中获取这些值,在int类型字段中,我收到此错误消息。Theargumenttype'(int)→dynamic'can'tbeassignedtotheparametertype'(String)→void'.我正在使用bloc发布到firebase数据库。这是它的样子。Widgetbuild(BuildContextcontext){finaltrackerBloc=Provider.of(context);StringdocId=DateTime.now().millisecondsSinceEpoch.to

flutter : 'Future <dynamic>' is not a subtype of type bool

我试图实现一个简单的登录/注销功能。我的场景是这样的:我有2个页面(登录页面和主页),在main.dart中,我使用SharedPreferences检查用户是否已经登录,如果用户已登录,我在单击按钮时将bool值设置为true。我遇到的问题是,我创建了一个routeLogin函数来在主页和登陆页之间进行选择。我得到这个错误:I/flutter(9026):══╡EXCEPTIONCAUGHTBYWIDGETSLIBRARY╞═══════════════════════════════════════════════════════════I/flutter(9026):Thefol

asynchronous - 如何解决将 Future<dynamic> 实例作为参数传递的错误?

我得到错误:I/flutter(4091):ThefollowingNoSuchMethodErrorwasthrownbuildingBuilder:I/flutter(4091):Class'Future'hasnoinstancemethod'[]'.I/flutter(4091):Receiver:Instanceof'Future'I/flutter(4091):Triedcalling:[]("main")并追溯到:voidupdateUI(dynamicweatherData){setState((){if(weatherData==null){//errorchecki

flutter - 未处理的异常 : Content size below specified contentLength. 已写入 206 字节但预期为 375482。#228

我正在尝试使用multi_image_picker上传多个文件使用下面的代码,但我收到标题中的错误。我正在关注document中的代码但我不确定我的做法是否正确。提前致谢FuturesendDataToServer()async{//stringtouriUriuri=Uri.parse(Settings.SERVER_URL+'api/uploadproduct');//createmultipartrequestMultipartRequestrequest=http.MultipartRequest("POST",uri);request.fields['name']=produ

size - 如何在 flutter 中的不同屏幕分辨率之间具有相同大小的圆圈比例

我尝试制作自定义地理围栏,为此,我显示了一个googlemap的Url,并添加了一个带有圆圈的堆栈,我用一个系数调整了大小以获得良好的表示。问题是我的系数在任何屏幕设备上都不是动态的Container(padding:constEdgeInsets.only(top:160.0),child:newCard(elevation:2.0,child:newStack(alignment:AlignmentDirectional.center,children:[newContainer(child:newImage.network(statichomeMapUri.toString())

dart - 获取 _InternalLinkedHashMap<String, dynamic >' is not a subtype of type ' FutureOr<Response>'

我是Dart/Flutter的新手,我正在尝试获取使用网络服务的future结果:Future_readData()async{(...)http.Responseresponse=awaithttp.post(request,headers:{"SOAPAction":"http://www.totvs.com/IwsConsultaSQL/RealizarConsultaSQL","Content-Type":"text/xml;charset=UTF-8","Authorization":"BasicbWVzdHJlOnRvdHZz","cache-control":"no-ca

flutter - 如何将 InternalLinkedHashMap 转换为 Map<dynamic, dynamic>?

我正在设置firebase云消息传递并在我的onResume()中回调我有以下内容:FutureonResume(Mapmessage)async{finalMapdata=message['data'];finalStringurl=data['url'];if(url!=null){_webViewController?.loadUrl(url);}}当函数到达finalMapdata=message['data'];它会在没有警告的情况下过早地、无声地返回。如果我改为运行finaldynamicdata=message['data'];它按预期继续。检查message类型狂欢me

asynchronous - 未处理的异常 : type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'Future<dynamic>'

我收到错误消息:UnhandledException:type'_InternalLinkedHashMap'isnotasubtypeoftype'Future`_LocationScreenState.build.(package:clima/screens/location_screen.dart:71:32)被精确定位的线在里面:FlatButton(onPressed:()async{varweatherData=awaitweather.getLocationWeather();updateUI(weatherData);//weather.getLocationWeath

flutter - 类型 'Future<dynamic>' 不是类型转换中类型 'List<dynamic>' 的子类型

我试图从我的firestore中获取确定集合中的所有文档,之后,我想将它们设置在文档列表中,列表的每个位置代表一个文档。但是,当我编写代码时,我收到了这个错误:类型“Future”不是类型转换中类型“List”的子类型import'package:cloud_firestore/cloud_firestore.dart';classRestaurant{Stringkeyword;Stringstate;Stringaddress;Stringcity;intevaluation;Stringimage;Stringphone;doublerating;Stringschedule;S