cross_settings 0.3.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 65

Cross settings #

Pub

Cross platform settings, that is all this is. If you want to load a settings file, all one needs to do is

Settings(vmBase:"appName").loadSettings("settingsFile");

vmBase is only used when ran on non-android/non-ios devices, for places like ~/.config/appName

Changelog #

0.3.0 #

  • Added CachedSettings
  • Added type annotations to BLoCSettings
  • Added some more docs.

0.2.0+3 #

  • Whoops! I put blocSettings out for you now!

0.2.0+2 #

  • More ignore lines

0.2.0+1 #

  • Added another ignore line.

0.2.0 #

  • Added BLoCSettings

0.1.1 #

  • Done some stuff that maybe fixes the package

0.1.0 #

  • Created project

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);
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  cross_settings: ^0.3.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:cross_settings/cross_settings.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
31
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
65
Learn more about scoring.

We analyzed this package on Nov 11, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:cross_settings/cross_settings.dart.

Health suggestions

Format lib/blocSettings.dart.

Run dartfmt to format lib/blocSettings.dart.

Format lib/cachedSettings.dart.

Run dartfmt to format lib/cachedSettings.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.2 <3.0.0
path_provider ^1.3.0 1.4.0
pedantic ^1.8.0 1.8.0+1
Transitive dependencies
collection 1.14.11 1.14.12
flutter 0.0.0
meta 1.1.7 1.1.8
platform 2.2.1
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8