isar / isar/hive

hive dont recognize map type while storing

Open
#784 2 comments 0 reactions 0 assignees View on GitHub
problem
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.