hive dont recognize map type while storing
- Dominant language
- Dart
- Stars
- 4.4k
- Forks
- 449
- PR merge metrics
- No merged PRs in 30d
Description
hi, I m trying to save a Map into the hive box. it is saved correctly but when I m trying to get the same map it returns Map and it gives me a cast error.
here is my save code:
` abstract class HiveCurd {
static Future> getBox(
{required String name}) async {
if(Hive.isBoxOpen(name)){
return Hive.box(name);
}else {
return (await Hive.openBox(name));}}}
`
`
Box>> box =
await HiveCurd.getBox>>(name: "category");
box.put("categories", data);
`
data is a map>and it is my get code from the box:
' Box>> box = await
HiveCurd.getBox>> (name: "category");
return box.get("categories", defaultValue: {});
'
it should return the same Map> type not map
i provided all box type as the Map>
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.