dart-lang / sdk

The Dart SDK, including the VM, dart2js, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
9.94k stars 1.53k forks source link

Inability to Convert Dart BigInt to JSBigInt using new js_interop #56104

Open maks-yakauleu opened 5 days ago

maks-yakauleu commented 5 days ago

There is currently no straightforward way to convert a Dart BigInt to a JSBigInt using the dart:js_interop package.

Steps to Reproduce:

  1. Attempt to pass a Dart BigInt to a JavaScript function that expects a JSBigInt.
  2. 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)

dart-github-bot commented 5 days ago

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.