isar / isar/hive

HiveList constructor Box type

Open
#1,150 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

Why does the factory constructor of HiveList
```
/// Allows defining references to other [HiveObjectMixin]s.
@experimental
abstract class HiveList extends HiveCollection
implements List {
/// Create a new HiveList which can contain HiveObjects from [box].
factory HiveList(Box box, {List? objects}) =>
HiveListImpl(box, objects: objects);

/// Disposes this list. It is important to call this method when the list is
/// no longer used to avoid memory leaks.
void dispose();

/// Casts the list to a new HiveList.
HiveList castHiveList();
}
```
not take a `Box` as an argument instead of `Box`? Would seem helpful for static analysis if it did.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the HiveList factory constructor shown in the issue and trace the related HiveListImpl constructor. Check how the Box parameter is typed and whether changing it to Box preserves the public API and static-analysis behavior; the work is done when the constructor provides the requested generic typing without breaking existing usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
database
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.