dart_numerics icon indicating copy to clipboard operation
dart_numerics copied to clipboard

integer literal issue in flutter web

Open lucaszhao19 opened this issue 4 years ago • 2 comments

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.

lucaszhao19 avatar Aug 03 '20 11:08 lucaszhao19

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.

zlumyo avatar Mar 10 '21 14:03 zlumyo

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.

gvol avatar Dec 01 '22 21:12 gvol