isar / isar/hive

Wrong Pub dev documentation

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

Description

There is an error in the pub.dev documentation that can hinder beginners.

Here you can see that the documentation suggests this code,
![Documentation error](https://github.com/isar/hive/assets/63758301/38e8ac37-21f8-4a24-beb4-da3c318303c7)

But when putting this in the code it is possible to see that it does not work due to the lack of 'await' in the documentation
![Error code](https://github.com/isar/hive/assets/63758301/6153afb8-b371-4eb4-ad99-e736ab80e9e3)

The correct thing would be
```dart
final catsBox = await collection.openBox('cats');
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the pub.dev documentation example shown in the issue and compare it with the reported Dart error. Update the openBox example to include await, then verify that the corrected snippet is valid Dart and matches the documented asynchronous API.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.