isar / isar/hive

BUG!! hive couldn't reload data during swipe between tab pages

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

Description

In my case we have 3 tabs in `TabController` and in all of this pages we have some data which we want to use them, now on each tab when we are swiping between them we don't have previous data and length of `box` values is `0`, you suppose we have three tab as:

```
screen_a
screen_b
screen_c
```

into `screen_a` we have:

```dart
class Home extends StatefulWidget {
const Home({Key? key}) : super(key: key);

@override
State createState() =>MyHome();
}

class MyHome extends State {
late Box _level;
late List levels ;
late VideoPlayerController _controller;
List colors = [
DefaultColors.$mainBlue,
DefaultColors.$purple,
DefaultColors.$darkOrange,
DefaultColors.$red,
const Color(0xff6479FF)
];
@override
void initState() {
super.initState();
_level = Hive.box('level');
levels = _level.values.toList();
_controller = VideoPlayerController.network(
'https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4',
videoPlayerOptions: VideoPlayerOptions(mixWithOthers: true),
);
}
@override
Widget build(BuildContext context) {
```

now on starting application we have many data on `screen_a` and after swiping on `screen_b` and going back to `screen_a` we don't have any data in `hive` :| :|

what's the problem?

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.