dart flutter类型“int”不是类型“Int64?”的子类型,'

ycl3bljg  于 10个月前  发布在  Flutter
关注(0)|答案(2)|浏览(171)

如何在dart中初始化Int64数
我希望这个数字是一个Int64数字。

Int64 secs = Int64(5);

字符串
但我得到了这个警告

A value of type 'int' can't be assigned to a variable of type 'Int64'.
Try changing the type of the variable, or casting the right-hand type to

vlf7wbxs

vlf7wbxs1#

你可以尝试使用dart core的BigInt
Int64也来自fixnum

Int64 secs = Int64(5);

字符串

jaxagkaj

jaxagkaj2#

可以使用toInt()。
示例
int result = response.result.toInt();

相关问题