FlutterStore class final

The default FlagneticStore of a Flutter app: shared preferences for the small entries (the index of unit sets, anonymous unit IDs) and one file under the application support directory for each unit set's last good values, which are a whole evaluate response and do not belong in a preference.

On the web there is no application support directory, so every entry lives in the preferences.

Construct it and pass it straight to the client: every call answers with a future, and the client loads the last good values before it sends its first request.

final client = Flagnetic.client(
  'fn_cli_…',
  baseUrl: Uri.parse('https://flags.example.com'),
  context: FlagneticContext(units: {'anonymous': anonymous}),
  options: ClientOptions(store: FlutterStore()),
);
Implemented types

Constructors

FlutterStore({Future<String> directory()?})
The default store. directory answers where the files go; the application support directory when it is null.

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) → Future<String?>
The value under key, or null.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(String key) → Future<void>
Removes key; a missing key is not an error.
override
set(String key, String value) → Future<void>
Stores value under key.
override
toString() → String
A string representation of this object.
inherited

Operators

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