plugfox_localstorage 0.1.1+1

  • Readme
  • Changelog
  • Example
  • Installing
  • new33

FLUTTER FOR MOBILE AND WEB #

plugfox_localstorage #

Description #

Simple cross-platform universal String Key-Value local storage, works on mobile and the web.
Has RAM caching. Great for small short values.

Example usage: #

import 'package:plugfox_localstorage/localstorage.dart'

Future<void> main() async {
    // Create an instance of the object (singleton)
    final LocalStorage storage = LocalStorage();
    // Wait for initialization
    await storage.init();
    
    // Set value
    storage['sampleKey'] = 'sampleValue';
    // Get value
    print(storage['sampleKey']); // 'sampleValue'
    
    // (optional) Close the storage - not necessary
    await storage.close();
}
Flutter logo #

[0.1.1+1] - 2019.09.29

  • Edit README.md

[0.1.1] - 2019.09.29

  • Add Example

[0.1.0] - 2019.09.29

  • Add MIT LICENSE
  • Format code

[0.0.1] - 2019.09.29

  • Initial version, created by PlugFox

example/README.md

Example usage: #

import 'package:plugfox_localstorage/localstorage.dart'

Future<void> main() async {
    // Create an instance of the object (singleton)
    final LocalStorage storage = LocalStorage();
    // Wait for initialization
    await storage.init();
    
    // Set key
    storage['sampleKey'] = 'sampleValue';
    // Get value
    print(storage['sampleKey']); // 'sampleKey'
    
    // (optional) Close the storage - not necessary
    await storage.close();
}

Use this package as a library

1. Depend on it

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


dependencies:
  plugfox_localstorage: ^0.1.1+1

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:plugfox_localstorage/drivers/baseStorageDriver.dart';
import 'package:plugfox_localstorage/drivers/browserStorageDriver.dart';
import 'package:plugfox_localstorage/drivers/mobileStorageDriver.dart';
import 'package:plugfox_localstorage/drivers/stubStorageDriver.dart';
import 'package:plugfox_localstorage/localstorage.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
25
Health:
Code health derived from static analysis. [more]
17
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
33
Learn more about scoring.

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

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms:

Error(s) prevent platform classification:

Error(s) in lib/drivers/browserStorageDriver.dart: Target of URI doesn't exist: 'dart:html'.

Health issues and suggestions

Fix lib/drivers/browserStorageDriver.dart. (-57.81 points)

Analysis of lib/drivers/browserStorageDriver.dart failed with 3 errors:

line 1 col 8: Target of URI doesn't exist: 'dart:html'.

line 9 col 3: Undefined class 'Storage'.

line 13 col 48: Undefined name 'window'.

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Error(s) in lib/drivers/browserStorageDriver.dart: Target of URI doesn't exist: 'dart:html'.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.28.0 <3.0.0
flutter 0.0.0
shared_preferences ^0.5.3+4 0.5.3+4
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test
test any