草庐IT

Contact_Dynamic

全部标签

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

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

asynchronous - Flutter Future<dynamic> 与 Future<String> 子类型错误?

我刚刚更新了Flutter,并成功地从git下载了我的原始项目。现在我遇到了一个奇怪的Future错误。我在github上看到在线提到它,但没有关于如何修复的明确答案。该项目甚至不加载。它从我的main.dart文件中读取Future语句并返回这个...[VERBOSE-2:dart_error.cc(16)]Unhandledexception:type'Futuredynamic'isnotasubtypeoftype'FutureString'whereFutureisfromdart:asyncFutureisfromdart:asyncStringisfromdart:cor

dart - 构建 FutureBuilder<List<dynamic>> 时抛出了 StackOverflowError

我正在使用纽约时报畅销书API,以便我可以获得畅销书中每个类别的图书列表。我的代码是这样的:import"dart:convert";import"package:flutter/material.dart";import"package:http/http.dart"ashttp;import"package:best_sellers/api.dart";classBestSellersListextendsStatefulWidget{finalAPIapi;finalListcategories;BestSellersList({Keykey,@requiredthis.api,

dynamic - Flutter - 动态创建表

我正在尝试使用Dart和Flutter动态创建表格。Somethinglikethis表格行数将根据传入的JSON文件而变化。我已经通读并完成了所有我能得到的Flutter教程,并通读了关于Table和ListBuilder类的文档,但是它们都没有完全完成我想要做的事情,因为示例要么只动态创建单个ListItems,要么所有数据和/或Widget都是硬编码的。我也试过这样做:TabledynamicTable=newTable();然后动态添加子WidgetswithdynamicTable.add(TableRow(children:[Text("test1"),Text("test