github_storage 1.0.1 copy "github_storage: ^1.0.1" to clipboard
github_storage: ^1.0.1 copied to clipboard

Lightweight key-value database within your GitHub repository

example/github_storage_example.dart

import 'package:github_storage/github_storage.dart';
import 'package:github_storage/src/github_box.dart';

void main() async {
  final git = GithubStorage(
      username: "this is yours",
      personalAccessToken: "yout token",
      repository: "your repo");

  /// Create if not exist yet on repo
  await git.createBox(name: "user", folder: "data");

  /// Create object of GithubBox
  GithubBox userBox = git.box(name: "user", folder: "data");
  GithubBox settingBox = git.box(name: "setting", folder: "setting");

  await userBox.put("flutter", {"version": 1, "isDart": true});
  await settingBox.put("isDarkTheme", true);

  bool isDark = await settingBox.get("isDark");
  print(isDark);

  await userBox.remove("jack");
  Map setting = await settingBox.getRawData();
  print(setting.toString());

  Map user = {
    "user": "jack",
    "no": 10,
    "color": [
      "red",
      "blue",
    ],
    "planet": {"earth": "moon"}
  };

  await settingBox.put("jack", user);
}
2
likes
160
pub points
0%
popularity

Publisher

unverified uploader

Lightweight key-value database within your GitHub repository

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

github

More

Packages that depend on github_storage