dart_numerics
dart_numerics copied to clipboard
integer literal issue in flutter web
Hello, I am having the following issue when building for the web app. The app is working fine in both iOS and Android mobile platforms.
Syncing files to device Chrome...
../../../.pub-cache/hosted/pub.dartlang.org/dart_numerics-0.0.5/lib/src/precision.dart:16:27:
Error: The integer literal 9223372036854775807 can't be represented exactly in JavaScript.
Syncing files to device Chrome...
Try changing the literal to something that can be represented in Javascript. In Javascript
9223372036854775808 is the nearest value that can be represented exactly.
Syncing files to device Chrome...
const int int64MaxValue = 9223372036854775807;
Thanks in advance.
There is a note in docs about that - https://api.dart.dev/stable/2.12.1/dart-core/int-class.html Unfortunately, JavaScript won't let to use library like this. I should consider to remove 'Web' as supported platform.
Any update on this? I needed factorial and binomial for a website I'm building, so I've just implemented those myself, but it would be great if I could use this library.