Questions tagged [flutter-hive]

Use this tag when the question is related to the key-value database written in Dart, in combination with a project written in Flutter.

Summary

Hive is a key-value database written in pure Dart.

The data are arranged in boxes, which can also be encrypted for the storage of sensitive data. The box must be opened before use.

Useful Links

380 questions
3
votes
1 answer

Flutter Path Provider with Hive OS Error: Operation not permitted, errno = 1

I am using Hive and Path Provider inside my app and on the simulator everything is working just fine. But when running my app on a real device (iPhone X, iOS 15) I get this error: [VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception:…
Chris
  • 1,828
  • 6
  • 40
  • 108
3
votes
2 answers

Filter and sort records from Hive box in Flutter

Im using Hive with Flutter to store contacts with key as alphanumeric string, each contact data is a map with timestamp in it Box Rows = Key. => Value 'abc123' => {'name': 'JK', 'country':'GB', 'timestamp': '568'}, 'etergb' => {'name': 'FS',…
user2398514
  • 137
  • 4
  • 17
3
votes
1 answer

Riverpod's StreamProvider stuck in loading when reading Hive's box | Flutter

I am trying to stream the users data that I saved into a box called 'users' with Hive. This is for showing a screen based on the information provided from the user. For now, the box contains no data, so I expect the following code to show a blue…
Florian Leeser
  • 590
  • 1
  • 6
  • 20
3
votes
1 answer

flutter model with both .obs and hive fields

I'm kinda new to flutter. I am writing an application with Getx and Hive packages. I would like to make my model observable by making each field reactive. I prefer this approach rather than making the entire class observable in the controller; by…
user3360086
  • 71
  • 2
  • 7
3
votes
0 answers

Flutter Hive retrieve box elements and obtain key when using ListView.builder

Using Hive, I can Hive.openBox('boxName') to then pass into a ListView.builder and cast the entry to a Model to get the required information for my view like this: ListView.builder( itemCount: list?.length, itemBuilder: (context, index) { …
Zach Smith
  • 5,490
  • 26
  • 84
  • 139
3
votes
1 answer

Flutter: Hive method 'get' method called on null

I am trying to use Hive in my app as an alternative to Shared Preferences in Flutter. However, I keep getting an error that says: I/flutter ( 4004): The method 'get' was called on null. I/flutter ( 4004): Receiver: null I/flutter ( 4004): Tried…
Arnav
  • 1,404
  • 2
  • 19
  • 38
3
votes
1 answer

Cacheing API Results using Flutter an Hive

What is the proper way to cache API results using Hive? The current way I plan to implement it is using the request URL as the key and the returned data as the body. Is there a proper way to do this more production friendly? I can't find a…
Luso1218
  • 45
  • 3
3
votes
3 answers

Reading Hivebox value is returning List instead of saved List
I save a List to an index in a Hive Box. class Person { String name; Person(this.name); } List friends = []; friends.add(Person('Jerry')); var accountBox = Hive.openBox('account'); accountBox.put('friends',friends); //Testing as soon…
ZeroNine
  • 721
  • 1
  • 11
  • 29
3
votes
2 answers

How to retrieve HiveList from Flutter Hive

I need help with retrieving data from Flutter Hive using HiveList; I get the error below: HiveError: To use this list, you have to open the box " " first. E/flutter ( 3001): #0 HiveListImpl.box" I am trying to implement Hive relation from this…
Ko Lynn
  • 134
  • 4
  • 8
2
votes
2 answers

What is the proper database for a small flutter POS app?

Im trying to make a restaurant POS app using flutter. I have "Order" entity that will get large overtime and i need to be able to search for orders on exact date Question: -can i use hive to store "Order" and achieve what i want without worrying…
Khalin
  • 21
  • 1
2
votes
1 answer

Backup and recovery of hive flutter database offline in phone storage

I added backup and restore feature to the app. But it only works properly in debug mode and it doesn't work in the final version and on the real mobile. Sometimes backup and restore works on the real phone, but when you delete the application and…
2
votes
2 answers

Hive import and pub get after flutter update gradle error

Hello everyone sorry for misleading title did not know what to put there. The problem is while I import hive and hive_flutter or even add them to pub my project get the following error: Execution failed for task…
2
votes
0 answers

Precaching network responses using `Isolates` with Dio and Hive

I just want to precache some endpoint calls at the beginning of the app to load faster some request since the backend service is really slow. I've tried using Isolates for this but seems like Hive Cache doesn't support that, so even if I try to…
Keylin Wu
  • 33
  • 7
2
votes
1 answer

How to update data using Flutter and Hive DB?

void deleteTask(int index) { setState(() { db.toDoList.removeAt(index); }); db.updateDataBase(); } This is what the delete function looks like. How can I make the edit function for hive using flutter in that manner as above…
Amila
  • 63
  • 7
2
votes
0 answers

How can I copy Hive database from Device to PC

Device File Explore can be used to copy sqlite database from android to windows/linux. How can I copy Hive database . I could not locate it using Device File Explorer?
puzzled
  • 509
  • 1
  • 5
  • 18