Skip to content
This repository was archived by the owner on Feb 18, 2026. It is now read-only.
This repository was archived by the owner on Feb 18, 2026. It is now read-only.

Reading list #41

@Raghuvorkady

Description

@Raghuvorkady

About local storage:

Object box ❌ vs Hive ✅

As you can see, in the below example
The problem with object_box is, the put method here returns a unique id for every unique object that is being stored.
In order to retrieve the data stored, we need to use the same id, which is not a feasible solution in our use case i.e., using it instead of shared_preferences

//object_box implementation
final id = box.put(person);  // Create

person = box.get(id)!;       // Read

Therefore, in this use case using Hive will be a better choice, because it's not just similar to shared_pref but also even faster (shared_pref is faster in reads)

Reference:

  1. https://medium.com/flutter-community/using-hive-instead-of-sharedpreferences-for-storing-preferences-2d98c9db930f
  2. https://pub.dev/packages/hive
  3. https://github.com/hivedb/hive_benchmark

mixin vs constants?

if we are using mixins then

mixin Constants on FirebaseService {
  String USERS = "users";
  String ACCOUNTS = "accounts";
  String BANK_AC1_DOC = "bankAc1Doc";
  String TAGS = "tags";
  String TAG_DOC = "tagDoc";
  String TRANSACTIONS = "transactions";
}

But as you can see, these are mutable fields, whereas the ones declared in constants/firebase.dart are the const fields

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions