hive icon indicating copy to clipboard operation
hive copied to clipboard

big int will be 48856307306397696

Open zhengbomo opened this issue 11 months ago • 0 comments

final user = {
  'id': 48856307306397697,
  'accountId': 1967,
};
final dir = await getApplicationDocumentsDirectory();
final box = await Hive.openBox("test", path: dir.path);
// ⚠️ readUser.id will be 48856307306397696 next launch time
final readUser = box.get("user");

// write user
box.put('user', user);
await box.flush();

// readUser.id will be correct
final readUser2 = box.get("user");
// readUser2.id will be 48856307306397697

issure version:

  • hive 2.2.3
  • hive 3.0.0-dev

hive 4.0.0-dev.2: this version work well

zhengbomo avatar Jan 12 '25 10:01 zhengbomo