thikdb 1.0.0 copy "thikdb: ^1.0.0" to clipboard
thikdb: ^1.0.0 copied to clipboard

outdated

Thik Hive implementation for easy create simple config for app.

Hive implementation for easy create simple config for app.

Features #

  • Quick implement config (ex: for app) with data save to Hive db

Getting started #

Create class that extend ThikDb then call open() For example:

class AppConfig extends ThikDb {
  static const String dbDir = "db"; //create 'db' directory under app directory
  static late final AppConfig _; //static instance to quick access
  AppConfig() :super("app_config"); //db table name

  static Future<void> init() async {
    _ = AppConfig();
    String dbFullPath = (await _.open(dbDirName: dbDir))!;
    dbPath = dbFullPath;
  }
}

Usage #

Create some static variable that you will directly access. Longer examples is in /example folder.

static String get testStringVar => _.get("testStringVar", "");
static set testStringVar(String value) => _.put("testStringVar", value);

Additional information #

Either create issue on Github or email me if you found something or want more info

0
likes
0
points
3
downloads

Publisher

unverified uploader

Weekly Downloads

Thik Hive implementation for easy create simple config for app.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, hive, path, path_provider

More

Packages that depend on thikdb