isar / isar/hive

Custom nested objects: custom object inside another custom object

Open
#1,020 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Dart
Stars
4.4k
Forks
449
PR merge metrics
No merged PRs in 30d

Description

**Question**
I have a class that has another class as field object. A Person object can have many houses, hence many addresses. Now how can I store this information with hive ?

**Code sample**
```dart
class Person{
String name;
List

addresses;

Person({required this.name, required this.addresses});
}

class Address{
String? country;
String? province;
String? town;
String? street;
String? houseNumber;

Address({this.country, this.province, this.town, this.street, this.houseNumber});
}
```

**Version**
- Platform: iOS, Android, Mac, Windows, Linux, Web
- Flutter version: latest
- Hive version: latest

Contributor guide

No contributing guide indexed for this repository

Research direction

No repository file, test, or entry point is mentioned. Start by reviewing Hive's Dart model and adapter serialization documentation and existing nested-object examples; done means documenting a supported way to persist Person with List

, or clarifying the limitation if no such support exists.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
database
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.