NmAuthFlow class

Sign in, create an account, ask for a reset link and set a new password, on one card. The product does the calls: each callback returns whether it succeeded; a successful sign-up or reset request moves to NmAuthStep.checkEmail. busy and error come from the product's session (wrap the flow in a ListenableBuilder).

Inheritance

Constructors

NmAuthFlow({Key? key, required String title, required String subtitle, required Future<bool> onSignIn(String email, String password), required Future<bool> onSignUp(String name, String email, String password), required Future<bool> onForgot(String reason), required Future<bool> onSetPassword(String reason), NmAuthStep initial = NmAuthStep.signIn, bool busy = false, String? error, ValueChanged<NmAuthStep>? onStepChanged, int minPasswordLength = 10})
Creates the flow.
const

Properties

busy → bool
A call is running.
final
error → String?
The product's error message.
final
hashCode → int
The hash code for this object.
no setterinherited
initial → NmAuthStep
First step; switching to NmAuthStep.setPassword later (a reset link arriving) is followed.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
Brand mark next to the title.
final
minPasswordLength → int
Shortest new password.
final
onForgot → Future<bool> Function(String reason)
Sends a reset link.
final
onSetPassword → Future<bool> Function(String reason)
Sets the new password (reset link).
final
onSignIn → Future<bool> Function(String email, String password)
Signs in.
final
onSignUp → Future<bool> Function(String name, String email, String password)
Creates an account.
final
onStepChanged → ValueChanged<NmAuthStep>?
Called on every step change (e.g. to clear the product's error).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
subtitle → String
Line under the title.
final
title → String
Card title.
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<NmAuthFlow>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

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