NexusOtpBox class

A single node of the nexus style.

The node is a quiet dark rounded rectangle until it becomes the active one: its border then takes the accent color, a halo builds underneath it and a caret breathes in the middle. Digits drop in from above and settle with a short overshoot, and while the code is being checked a pair of arcs chases itself around the outline.

Inheritance

Constructors

NexusOtpBox({Key? key, required String char, required bool isActive, required double width, required double height, required double borderRadius, required Color backgroundColor, required Color borderColor, required Color accentColor, TextStyle? textStyle, bool isVerifying = false, bool showCaret = true})
Creates a NexusOtpBox.
const

Properties

accentColor Color
Color of the glow, the lit border and the caret.
final
backgroundColor Color
Fill color of the node.
final
borderColor Color
Color of the resting hairline border.
final
borderRadius double
Corner radius of the node.
final
char String
The character shown inside the node, or an empty string.
final
hashCode int
The hash code for this object.
no setterinherited
height double
Height of the node.
final
isActive bool
Whether this node is the one currently receiving input.
final
isVerifying bool
While true a pair of arcs runs around the outline.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showCaret bool
Whether the caret is drawn in the active node.
final
textStyle TextStyle?
Style of the digit. Defaults to a style scaled to height.
final
width double
Width of the node.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<NexusOtpBox>
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