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
0
votes
0 answers

How can i fix bug routes length was called on null when i add element in the Hive Db in Flutter?

I am using hive db to my flutter project. i want to save in favs some elemnets from the list, the main issue in about this error: As i understand this error occurs because dart thinks that i am trying to save not list of elements, but just a one…
inkwelll075
  • 494
  • 4
  • 19
0
votes
0 answers

Showing a type cast error by hive when I tries to retrieve the data I stored . Flutter hive

I am creating a music player and using hive for database. I am entering the values as key value pairs into database where the key is user input from text field and it is the name of playlist they are creating. The database takes in values as…
Vivek T V
  • 33
  • 4
0
votes
1 answer

Flutter - remove or delete Hive with new app-version

If I have a new version of my Flutter-App und want to delete/remove my old Hive-boxes before my new app-version starts with runApp(MaterialApp ... What is the correct way to implement that? I'm new to Flutter and I experienced problems when changing…
KarlB
  • 1
  • 2
0
votes
1 answer

Inserting Huge Data to Flutter Hive Storage Making App to Crash

I have data around 100 000 (each object consists 10 - 15 fields). It's crashing the application while trying to insert such data. I am bit confused whether choosing hive for this purpose was correct. I need to sync the data on regular basis. Is…
Jashwanth Neela
  • 263
  • 1
  • 8
0
votes
0 answers

How to save data to LocalStorage and retrieve when reopen browser fllutter web

I am trying to save json object data locally when user closed the browser the data should not clear in flutter web. I try hive to store data locally but when browser closed the hive DB clear. I am using hive: ^2.0.4 plugin. There is any solution for…
wahab sohail
  • 161
  • 1
  • 12
0
votes
1 answer

Flutter Hive, How to filter hive box to listenable

I want to show data from hive, but i want to filter spesific box only to pass to ValueListenableBuilder, using this : // Read all note (working properly) static ValueListenable> readNote() { return noteBox.listenable(); …
0
votes
1 answer

Unhandled Exception: Bad state: No element While trying to fetch values from Hive

I'm trying to fetch some values from Hive to check whether data is available or I need to fetch it again. I'm using hive to save the data. I'm using Layout builder in main.dart with a navigator widget to set up named routes. My Initial route is the…
araina1995
  • 21
  • 1
  • 3
0
votes
1 answer

deleteing hive flutter record using provider

Im new to flutter and im trying to create todo app using flutter, hive and provider. when i'm trying to delete record using deleteAt method keep getting following exception. [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception:…
ishara
  • 9
  • 1
0
votes
1 answer

How to use a variable for method name

I want to use a variable to access a certain value in my hive database: In the code below if I use myBox.getAt(i).attributeSelect I get an error because attributeSelect is not defined for the box. If I use myBox.getAt(i).test it works. How can I…
0
votes
1 answer

How to listen to custom key changes in hive and how to listen to all data like firestore snapshot?

I am using hive and I am trying to listen to the value change of custom stored key as in the code below and I can't get any data ? So how can I achieve this ? Stream listenToLocalCartItem(String cartItemId) { var box =…
Omar Abdelazeem
  • 381
  • 2
  • 20
0
votes
1 answer

Box not found ERROR when calling Hive.openBox()

Box not found. Did you forget to call Hive.openBox()? is the result of a call to Hive.openBox(). It is shown in the console. However the widget works fine and the contents of the box is shown correctly! I mean I know that the box is NOT open,…
ThommyB
  • 1,456
  • 16
  • 34
0
votes
1 answer

Flutter Hive getter isn't defined for the type 'hiveobjectmixin'

After creating model to make a relationship between 2 models i can't get field data from nested relationship I have a User model which that contain other model as Transactions which that's a HiveList, now when i try to get a field such as cost from…
DolDurma
  • 15,753
  • 51
  • 198
  • 377
0
votes
1 answer

flutter : how to bind hive watching into RxList object in getx

I am using hive and getx together, I am trying to get all data inside hive with watch method: Stream> watchVocabsFromdb() => hiveService.vocabularyBox .watch() .map((event) => hiveService.vocabularyBox.values …
Cyrus the Great
  • 5,145
  • 5
  • 68
  • 149
0
votes
1 answer

Is required register a list of Objects in Hive?

This is my Hive model and I already generate the adapter: @HiveType(typeId: 7) class GoalModel { @HiveField(0) bool progessNotificaitons; @HiveField(1) List daysToWork; @HiveField(2) int amountGoal; @HiveField(3) DateTime…
Esteban Muñoz
  • 308
  • 2
  • 7
0
votes
2 answers

How to register two Adapters for two different Modal classes with HIVE , Flutter?

My main.dart file with the error while registering todosAdapter() WidgetsFlutterBinding.ensureInitialized(); final appDocumentDirectory = await path_provider.getApplicationDocumentsDirectory(); await Hive.initFlutter(); …