LocalStorage class abstract interface

LocalStorage for Flutter.

import 'package:localstorage/localstorage.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();

  localStorage.setItem('key', 'value');

  // Will print "value" after app reload as well.
  print(localStorage.getItem('key'));
}

Constructors

LocalStorage()

Properties

hashCode int
The hash code for this object.
no setterinherited
length int
The number of key/value pairs in the storage.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() → void
Clears all key/value pairs in the storage.
getItem(String key) String?
Returns the current value associated with the given key.
key(int index) String?
Returns the name of the nth key in the storage.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeItem(String key) → void
Removes the key/value pair with the given key from the storage.
setItem(String key, String value) → void
Sets value for the given key.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited