fzyzcjy / flutter_rust_bridge

Flutter/Dart <-> Rust binding generator, feature-rich, but seamless and simple.
https://fzyzcjy.github.io/flutter_rust_bridge/
MIT License
3.64k stars 256 forks source link

For u64 and i128/u128 types, use BigInt in the Dart side. #1934

Closed iota9star closed 1 week ago

iota9star commented 2 weeks ago

Is your feature request related to a problem? Please describe.

In version 2.0.0-dev.33, the Dart code generated for u64 uses int, but the value range of u64 exceeds that of Dart's int. As for i128/u128 types, there's no available type in Dart. I think using BigInt in Dart could be a good solution.

image

fzyzcjy commented 2 weeks ago

Looks reasonable, and feel free to PR for this! Alternatively I will try to find time to fix it later.

P.S. usize may also be considered the same as u64

iota9star commented 1 week ago

@fzyzcjy Do you have plans to release a new version in the next couple of days?

fzyzcjy commented 1 week ago

Sure! Hopefully within a day, because I want to finish some other PRs