LoginUic class
A Login form, that is composed of 'Username' and 'Password' text fields, and a 'Sign In' button.
The basic usage of LoginUic widget requires only to specify onSignIn callback, that performs the actual signing in process, and optional onSignInCompleted callback, where you implement actions on successful signing in, like navigation to another screen. All other logic, like basic input validation, managing the form state while signing in is performing and handling sign in errors are under the hood.
For more control, you can provide your custom usernameValidator and passwordValidator functions.
The appearance of the Login form can be adjusted with theme, inputDecoration, errorTextStyle and signInProgressView parameters.
The Login form is using default field names, error messages and other texts in English. To provide your custom string values, use strings parameter.
See also:
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- LoginUic
Constructors
-
LoginUic({Key? key, TextStyle? errorTextStyle, InputDecoration? inputDecoration, required Future<
void> onSignIn(String username, String password), void onSignInCompleted(BuildContext context)?, String passwordValidator(String?)?, Widget? signInProgressView, LoginUicStrings strings = const LoginUicStrings(), ThemeData? theme, String usernameValidator(String?)?}) -
Creates LoginUic widget.
const
Properties
- errorTextStyle → TextStyle?
-
A style of error messages in the 'Username' and 'Password' text fields.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- inputDecoration → InputDecoration?
-
Decoration of the 'Username' and 'Password' text fields.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onSignIn
→ Future<
void> Function(String username, String password) -
A callback that performs sign in action.
final
- onSignInCompleted → void Function(BuildContext context)?
-
A callback that is called on successful signing in.
final
- passwordValidator → String Function(String?)?
-
A function that validates user's password
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- signInProgressView → Widget?
-
A custom view to show on the 'Sign In' button, while the signing in is
is performed.
final
- strings → LoginUicStrings
-
A set of strings that are used in the Login form.
final
- theme → ThemeData?
-
A theme, which is used to display a Login form
final
- usernameValidator → String Function(String?)?
-
A function that validates username.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _LoginUicState -
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