hive icon indicating copy to clipboard operation
hive copied to clipboard

expect List but got a CastList<int, dynamic>

Open yaragroup opened this issue 3 years ago • 0 comments

In the first run, the data is correct, but after refreshing the page, you get castlist<int, dynamic> instead of List. This problem did not exist and it happened without changing the codes!

@HiveType(typeId: 5)
class FileSchema {
  @HiveField(0)
  String file;

  @HiveField(1)
  List bytes;

  @HiveField(2)
  int v;
var _files  = await Hive.openBox<FileSchema>('filesBox');
FileSchema _file = await  B.boxFiles.get(id);

Version

  • Platform: Android, Windows, Web
  • Flutter version: 3.3.0
  • hive: ^2.2.3
  • hive_flutter: ^1.1.0

yaragroup avatar Sep 08 '22 07:09 yaragroup