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