FakeStorageAdapter class

An in-memory ReviewStorageAdapter for testing.

Behaves like a real storage backend without any external dependencies.

import 'package:happy_review/testing.dart';

final storage = FakeStorageAdapter();
await HappyReview.instance.configure(storageAdapter: storage, ...);
Inheritance

Constructors

FakeStorageAdapter()

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

clear() Future<void>
Removes all data written by the library.
override
getBool(String key, {bool defaultValue = false}) Future<bool>
Reads a boolean value.
override
getDateTime(String key) Future<DateTime?>
Reads a DateTime value. Returns null if not set.
override
getInt(String key, {int defaultValue = 0}) Future<int>
Reads an integer value.
override
getString(String key) Future<String?>
Reads a string value. Returns null if not set.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setBool(String key, bool value) Future<void>
Writes a boolean value.
override
setDateTime(String key, DateTime value) Future<void>
Writes a DateTime value.
override
setInt(String key, int value) Future<void>
Writes an integer value.
override
setString(String key, String value) Future<void>
Writes a string value.
override
toString() String
A string representation of this object.
inherited

Operators

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