You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So far, I have been using protobuf to read and write data from a Java program.
The buffer includes thousands of "long" which are specified as "int64" in the protobuf file.
Now I want to read the same protobuf encoded file in my native dart (flutter) program.
The generated code uses Int64 from the fixnum package.
Looking at long in Java (with minimum -2^63 to maximum 2^63-1) it has the same precision as Dart's native int.
I am trying to understand why it is using Int64 (javascript?) and if there is a way to have the generated classes use int.
Thanks for your time. Any hint would be helpful.
The text was updated successfully, but these errors were encountered:
The reason for using package:fixnum is that dart on web (when compiled to javascript) uses javascript numbers which are double-precision floating points. These can only represent up to 53 bits of integer values without loss of precision.
Package:fixnum could on have an implementation of Int64 on native that used a single int as underlying representation - and switching with conditional imports. (dart-lang/core#172). With "inline classes" (upcoming language feature) this should even be very efficient.
So far, I have been using protobuf to read and write data from a Java program.
The buffer includes thousands of "long" which are specified as "int64" in the protobuf file.
Now I want to read the same protobuf encoded file in my native dart (flutter) program.
The generated code uses Int64 from the fixnum package.
Looking at long in Java (with minimum -2^63 to maximum 2^63-1) it has the same precision as Dart's native int.
I am trying to understand why it is using Int64 (javascript?) and if there is a way to have the generated classes use int.
Thanks for your time. Any hint would be helpful.
The text was updated successfully, but these errors were encountered: