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
1 answer

Hive mapping boxes in Flutter

I was searching and didn't find anything about this topic. I want to ask if there exists any mapper or automapper for Hive box, or what is the proper way to map boxes in Hive? For example I have: class Company extends HiveObject { @HiveField(0) …
Yolanda
  • 5
  • 1
  • 6
0
votes
1 answer

Flutter & Hive - How to Save Reordered List in Hive

I'm a beginner with Flutter and I'm currently implementing a local Save of Items using Hive and Boxes. Everything was okay until I decided to reorder the list of Items. My question is: How can I save the reordered changes, knowing that I can't use…
Macawena
  • 39
  • 3
0
votes
1 answer

In flutter using Hive how would you add a custom object from a POST response body to a box?

I'm looking to store a User object in a hive box. After a successful POST, I return a User object, which Hive won't add to a box because it's not the HiveType model that I wrote (HiveUser). Is there a way around this or can I convert my User object…
Carter
  • 179
  • 11
0
votes
2 answers

Initialize hive in flutter initState method

Rather than calling some async function to get document directory and initialize hive database inside main function, I want to keep things as abstract as possible. I want to implement Hive.init(..) inside a provider service and calling that service…
0
votes
1 answer

Flutter Hive Adapter for Geopoint

I'm storing a geopoint in firestore and I'm trying to retrieve it with my Hive adapter. However, Im getting Cannot write, unknown type: GeoPoint. Did you forget to register an adapter? I'm registering the adapter so that's not the issue. is the…
0
votes
1 answer

How to insert an item at position 0 in a Hive DB box?

I'm using Hive for Flutter. I want to insert every item at position 0 of a box. The items inside the box have to increase index automatically. If I use the 'add' method, the new item inserted takes the last position. This is not good for a List…
Daniel
  • 11
  • 1
  • 6
0
votes
1 answer

Flutter Hive: GroupBy the list By Date

I'm working with Hive Flutter. I have a result list like this, but I want GroupBy the List By the Date. Result what I want, something like this: Monday, December 9,2019 ggh ggh ggh ggh I already research and I found some package: Collection…
Zeffry Reynando
  • 3,445
  • 12
  • 49
  • 89
-1
votes
2 answers

Change value of object class in Hive using StateNotifier/ChangeNotifier

I have a Hive box to save an object class, which is InappPengguna to save user info that would be in use for offline auto login. The value of InappPengguna.status is UserStatus.loggedinSuccessfully which generated from Login Page. Then at Home Page,…
pras
  • 97
  • 1
  • 14
-1
votes
1 answer

Why am I unable to add and get data with Hive so it saves?

I am trying to save values with Hive so that they are saved even after my app is closed. This is the code I am running: @override void initState() { super.initState(); box = Hive.box('exerciseBox'); } addInfo() { box.put('Exercise…
nsa41620
  • 13
  • 4
-1
votes
2 answers

How to read/write a custom nested object in Hive?

I am caching a big chunk of data from API, I get it as a dynamic list which contains Map. I can either save the dynamic list itself which I get in response or else I can save the parsed object but the object's class is nested and…
-1
votes
1 answer

What happens for hive local database in flutter after updating app in app store?

I'm new i flutter. I'm developing an offline money management app. I used hive as local database of my app for storing data locally. I have one important question: if I release new update after publishing my app in the app store, what happens for…
Hossein Vejdani
  • 961
  • 8
  • 19
-1
votes
1 answer

type 'List' is not a subtype of type 'List?' in type cast

I use Hive to store daily expenses inside expenseBox like this: final String now = DateFormat('yyyyMMdd').format(DateTime.now()); List todaysExpenses = Hive.box>('expenses').get(now, defaultValue: []) as…
-1
votes
5 answers

Hive .g.dart file not getting generated

I want to use Hive for local database for storage. This is my model class import 'package:flutter/material.dart'; import 'package:hive/hive.dart'; part 'addForm.g.dart'; @HiveType(typeId: 0) class AddForm extends HiveObject{ @HiveField(0) …
Hadi Khan
  • 90
  • 1
  • 9
-1
votes
2 answers

Is it possible to disable null safety for a dependent Dart package?

I'm trying to build app using hive but the hive_flutter package doesn't supporting null safety. Is there any way to turn off null safety for this package only or is there any alternative for the hive_flutter package?
prathamesh
  • 13
  • 1
-1
votes
1 answer

The method was called on null error flutter Hive

Opening the box var savedList; Future initiateHive() async { ///Creating a HiveBox to Store data savedList = await Hive.openBox('Musicbox'); } The function to put data to hive var songFav = SongPlayList()..songInfo =…
Abin vs
  • 103
  • 5
1 2 3
25
26