cross_settings 0.3.0 copy "cross_settings: ^0.3.0" to clipboard
cross_settings: ^0.3.0 copied to clipboard

Cross platform key-value stored settings (Meaning flutter apps can store settings on all platforms)

example/main.dart

import 'package:cross_settings/cross_settings.dart';

main() async {
  Settings settingsManager = Settings(vmBase: "cross_settings_example");
  Map settings = await settingsManager.loadSettings("main") ?? {};
  var now = DateTime.now();
  print("Currently it's $now");
  DateTime lastRan;
  try {
    lastRan = DateTime.tryParse(settings["lastOpened"]);
  } catch (e) {
    // Fail silently
    lastRan = null;
  }
  print(
      "This program was last ran ${lastRan != null ? "on " + lastRan.toString() : "never"}");
  settings["lastOpened"] = now.toIso8601String();
  await settingsManager.saveSettings("main", settings);
}
0
likes
40
pub points
0%
popularity

Publisher

unverified uploader

Cross platform key-value stored settings (Meaning flutter apps can store settings on all platforms)

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

path_provider, pedantic

More

Packages that depend on cross_settings