I'm trying to store a list of Maps in the ObjectBox box, but since I'm new to ObjectBox I don't understand how to store custom data types.
The data I'm trying to store (Structure looks like this)
name: 'name',
total: 100,
refNo: 00,
listOfProds: [{Map1},{Map2},{Map3},...]//<-Problem
I've tried
@Entity()
class ABC{
int id;
String name;
int total;
int refNo;
List<Map>? products;
ABC({
this.id=0,
required this.name,
required this.total,
required this.refNo,
//required this.products, <-This will throw an error since List is not supported
});
}
//Adding into DB
void addIntoDB(){
late ABC _abc;
_abc = ABC(
name: 'name',
total: 100,
refNo: 00,
//How can I assign the 'list of maps here' or any other ways?
);
_store.box<ABC>().put(_abc);
}