NmPinCodeModel class

Andrey's PinCodeViewModel: holds the entered code, answers taps, reports count / fill (his SetPinCodeViews). Checking and storing the PIN belong to the app (onCompleted, onForgot).

Inheritance

Constructors

NmPinCodeModel({int pinCount = 4, ValueChanged<String>? onCompleted, VoidCallback? onForgot})
Creates a model for a PIN of pinCount digits (Andrey's default 4).

Properties

count → int
Number of dots (SetPinCodeViews.count).
no setter
fill → int
Filled dots (SetPinCodeViews.fill).
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
onCompleted → ValueChanged<String>?
Called with the code when the last digit is entered.
final
onForgot → VoidCallback?
Called by the forgot key (Andrey's model sends nothing; the app decides).
final
pinCode → String
Entered digits.
no setter
pinCount → int
Length of the PIN.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
clear() → void
Clears the code (after a wrong PIN, or between "enter" and "repeat").
dispose() → void
Discards any resources used by the object.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
onTap(NmPinCodeTap tapped) → bool
Andrey's onTapView: a digit is added while the code is shorter than pinCount; delete drops the last digit; forgot calls onForgot. Returns whether the tap changed or was handled.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Constants

buttons → const List<NmPinCodeTap>
The 12 cells, row by row: 1–9, forgot, 0, delete (Andrey's buttons).