isar / isar/hive

Typed box, persisting a value on the object?

Open
#437 4 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**
Is this following the recommended way to persist a single value in a typed box??

**Code sample**
```dart
var hiveBoxUserData = await Hive.openBox('userData');
hiveBoxUserData.values.first.stats.all.impact += mission.impact;
await hiveBoxUserData.putAt(0, hiveBoxUserData.values.first);
```

ps `hiveBoxUserData.values.first.stats.all.impact += mission.impact;` seems to persist the value in memory, but on app reload it's lost.

**Version**
[√] Flutter (Channel dev, 1.22.0-12.0.pre, on Microsoft Windows [Version 10.0.19041.450], locale en-GB)

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[√] Android Studio (version 4.0)
[√] VS Code (version 1.49.0)
[√] Connected device (1 available)
- Hive version: hive: ^1.4.4, hive_flutter: ^0.3.1

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.