草庐IT

flutter - 快照错误类型 'int' 不是类型 'String' 的子类型

我正在尝试使用FutureBuilder获取数据并显示。fetch调用后显示type'int'isnotasubtypeoftype'String'这是我的json模型:classFeatured{finalintid;finalStringshop_type;finalStringname;finalStringname_bn;finalStringprice;finalStringprice_bn;finalboolold_price;finalStringold_price_val;finalStringold_price_val_bn;finalStringimage;Feat

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 - 如何在 flutter 中将 int 转换为 Uint32

有没有办法将整数转换成Uint32格式。intx=94;Uint32y=x.toUint32();///Pseudocode 最佳答案 Dart没有无符号整数。但是您可以使用BigInt并使用toUnsigned(32)在你对它进行的每一次操作之后。 关于flutter-如何在flutter中将int转换为Uint32,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/5747405

flutter - 将 int32 转换为 dart 中的字节列表

我想将int32转换成字节数组。具体来说,我想将477转换为字节数组,例如[el1,el2,el3,el4]我试过utf8.encode(477.toString());得到[52,55,55] 最佳答案 最简单的方法是创建字节列表(Uint8list),然后将底层缓冲区视为32位整数列表(Int32List)并存储整数那里。这将允许您读回字节。import"dart:typed_data";Uint8Listint32bytes(intvalue)=>Uint8List(4)..buffer.asInt32List()[0]=va

Flutter MQTT 客户端分离套接字无法同时实现 'Stream<List<int>>' 和 'Stream<Uint8List>'

我有一个正在运行的mosquitto代理在公共(public)ip中运行,比如234.56.xx.345端口1883。我正在制作一个基于flutter的android应用程序,以便在一段时间后分享一些信息。我包含了mqttflutter包,但在编译时出现错误。在下面找到我的代码。我得到的错误是编译器消息:file:///home/cccc/.pub-cache/hosted/pub.dartlang.org/mqtt_client-5.5.3/lib/src/connectionhandling/mqtt_client_mqtt_ws2_connection.dart:11:7:Err

android - flutter 错误 : type 'int' is not a subtype of type 'String' in type cast

我正在尝试使用Flutter应用从RESTAPI获取数据。我正在以json_serializable方式构建模型类。下面是我的代码。ma​​in.dartimport'package:flutter/material.dart';import'dart:convert'asconvert;import'package:http/http.dart'ashttp;import'./category.dart';voidmain(){runApp(MyApp());}classMyAppextendsStatefulWidget{@overrideStatecreateState(){//

Flutter:从托管解析 json 时,类型 'String' 不是类型 'int' 的子类型

我正在从服务器解析json并将其显示在屏幕上。当我从本地主机解析时这是有效的,但是当我从主机解析时出现这样的错误I/flutter(18089):[{"id":10,"reservation":"497538","order":"900000025301","equipment":"F6U-EA112","matcode":"6166357","description":"GASKET:2JKT;HE2;1302X1342X3MM;NASB\/CS","q_need":"1","q_available":"0","q_debt":"0","unit":"EA","location":"

google-cloud-firestore - 如何检查 int 字段在 firebase 中是否存在

我有两个按钮,如果该字段存在,则它显示一个按钮,否则它显示其他用户,我将在其中提供将数据添加到我的数据库的功能...我正在使用云firebase...如何检查该字段是否存在或不……下面是我的代码……//如果分数不存在,它会显示一个凸起的按钮,这样你就可以点击它//代码:import'dart:async';import'package:flutter/material.dart';import'package:cloud_firestore/cloud_firestore.dart';BuildContextbuildContext;intfilter=0;StreamSubscrip

dart - Flutter Dio 不接受 int 值作为 queryParameters

我正在使用Dio进行调用,使用映射构造函数发送一些查询参数response=awaitDio().get(url,queryParameters:{"apikey":publicKey,"hash":hash,"ts":timestamp,"nameStartsWith":searchTerm});一切正常,但是当尝试发送一个int值时,Dio抛出一个错误response=awaitDio().get(url,queryParameters:{"apikey":publicKey,"hash":hash,"ts":timestamp,"nameStartsWith":searchTer

dart - flutter 错误 : Attempt to invoke virtual method 'void com.google.firebase.auth.internal.zzab.zzf(int)' on a null object reference, null

每当我构建我的应用程序时,我的应用程序都会成功构建,但在将其安装到设备时,我会遇到以下错误并且应用程序在设备上崩溃并显示白屏。Launchinglib/main.dartonPixel2XLindebugmode...Initializinggradle...Resolvingdependencies...Running'gradlewassembleDebug'...Configuration'compile'inproject':app'isdeprecated.Use'implementation'instead.registerResGeneratingTaskisdeprec