颤振编译错误"The integer literal 9223372036854775807 can't be represented exactly in JavaScript"



我正在尝试构建我的flutter应用程序及其引发的编译错误,基于这个错误,它似乎是由flutter文件引起的,而不是我的代码。知道怎么解决这个问题吗?

PS C:UsersFlutterProjecttirthankar> flutter build web
Target dart2js failed: Exception: /C:/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-3.4.0+1/lib/src/X509Certificate/asn1_decoder.dart:163:25:
Error: The integer literal 9223372036854775807 can't be represented exactly in JavaScript.
int int64MaxValue = 9223372036854775807;
^^^^^^^^^^^^^^^^^^^
Error: Compilation failed.

Compiling libmain.dart for the Web...                             18.3s
Exception: Failed to compile application for the Web.
PS C:UsersFlutterProjecttirthankar>

下面是dart/flutter中失败的代码。

static List<int> loadSubContent({@required Iterator<int> iterator}) {
var len = getContentLength(iterator: iterator);
int int64MaxValue = 9223372036854775807;
if (len >= BigInt.from(int64MaxValue)) {
return <int>[];
}
var byteArray = <int>[];
for (var i = 0; i < len.toInt(); i++) {
if (iterator.moveNext()) {
var n = iterator.current;
if (n != null) {
byteArray.add(n);
}
} else {
throw ASN1OutOfBufferError();
}
}
return byteArray;
}

我相信int在2^62和-2^62-1之间有界,我知道你已经达到了64位机器中可以表示的int值的极限,但自从BigInt bi = BigInt.parse("9223372036854775807");开始以来,你有没有尝试过使用类BigInt

相关内容

最新更新