write method

  1. @override
Future<void> write(
  1. String handle,
  2. String secret, {
  3. TomGatedLifetime lifetime = TomGatedLifetime.saved,
  4. String? reason,
})
override

Stores secret under handle, replacing any current value. A store whose key exists only after the check (Windows Hello) shows the prompt with reason here too. Throws TomGatedSecretStoreException.

Implementation

@override
Future<void> write(
  String handle,
  String secret, {
  TomGatedLifetime lifetime = TomGatedLifetime.saved,
  String? reason,
}) async {
  if (available == TomGatedAvailability.none) {
    throw const TomGatedSecretStoreException(
      TomGatedSecretErrorKind.unavailable,
    );
  }
  _items[handle] = (secret: secret, lifetime: lifetime);
}