plugin method

PhoneNumberPlugin<TContext> plugin({
  1. Duration expiresIn = const Duration(minutes: 5),
  2. int allowedAttempts = 3,
  3. bool allowSignUp = true,
})

Creates a real phone plugin.

The digest key is intentionally public and fixture-only. Production code must supply an application secret instead of copying this setup. The fixture's auth runtime must use an AuthPhoneNumberBackend, such as InMemoryAuthStore.

Implementation

PhoneNumberPlugin<TContext> plugin({
  Duration expiresIn = const Duration(minutes: 5),
  int allowedAttempts = 3,
  bool allowSignUp = true,
}) => PhoneNumberPlugin<TContext>(
  sendCode: deliveries.capture,
  codeHashKey: _testOnlyHashKey,
  generateCode: _nextCode,
  expiresIn: expiresIn,
  allowedAttempts: allowedAttempts,
  allowSignUp: allowSignUp,
);