sdk
sdk copied to clipboard
Inability to Convert Dart BigInt to JSBigInt using new js_interop
There is currently no straightforward way to convert a Dart BigInt to a JSBigInt using the dart:js_interop package.
Steps to Reproduce:
- Attempt to pass a Dart BigInt to a JavaScript function that expects a JSBigInt.
- Observe that there is no built-in method to perform this conversion directly.
Expected Behavior: There should be a built-in method or straightforward way to convert a Dart BigInt to a JSBigInt, similar to how other types like String, num, and List are handled. (toDart, toJS)
Dart 3.4.3 (stable) Flutter 3.22.2 (stable)
Summary: Users cannot directly convert Dart BigInt to JavaScript BigInt using dart:js_interop. This prevents passing BigInt values to JavaScript functions expecting BigInt arguments.
Duplicate of https://github.com/dart-lang/sdk/issues/56539
I'm going to duplicate this in favor of that bug since that has a bit more detail on how to do this yourself until we add it to dart:js_interop, but this request is still being tracked.