LocalStorage class abstract

Key/value storage of strings, the type of PlatformDependencies.storage.

get is synchronous: an implementation on top of an asynchronous store loads the values before the app is created.

import 'package:firebase_app_dart/platform_dependencies.dart';

class MapStorage extends LocalStorage {
  final Map<String, String> values = <String, String>{};

  @override
  String? get(String key) => values[key];

  @override
  Future<void> set(String key, String? value) async {
    if (value == null) {
      values.remove(key);
    } else {
      values[key] = value;
    }
  }
}
Implementers

Constructors

LocalStorage()
Constructor for subclasses.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

get(String key) → String?
Gets the values at key, or null if none found.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
set(String key, String? value) → Future<void>
Saves the value at key.
toString() → String
A string representation of this object.
inherited

Operators

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