astextfield 0.0.9 copy "astextfield: ^0.0.9" to clipboard
astextfield: ^0.0.9 copied to clipboard

outdated

Creating ASTextField Package for use globally

astextfield #

Creating UITextField Package for use globally

Getting Started #

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Example #

//Initialize TextEditingController
var userName = TextEditingController();

//Define validator
String validateName(String value) {
     if (value.length == 0) {
       return enterUserName;
     }
     return null;
}

//Input formatter for name text field
List<TextInputFormatter> nameInputFormatter = [
  WhitelistingTextInputFormatter(RegExp("[a-zA-Z0-9]")),
   LengthLimitingTextInputFormatter(30)
];

//CLASS OBJECT - FULL NAME
   final userNameField = ASTextField(
       "User name",                             //Required hint name
       'assets/images/ic_user.png',             //Required prefix icon path
       userName,                                //Required TextEditingController
       validateName,                            //Required validator
       keyboardType: InputType.normal,          //Optional Keyboard type
       currentFocus: focusUserName,             //Optional current focus
       nextFocus: focusEmail,                   //Optional next focus
       txtInputFormatter: nameInputFormatter,   //Optional Input formatter
       keyboardAction: InputAction.done,        //Optional Keyboard action next/done
       txtColor: Colors.black,                  //Optional text colors
       txtFontFamily: "Roboto",                 //Optional text font family 
       txtFontSize: 20,                         //Optional text font size 
       txtErrorFontStyle: FontStyle.normal,     //Optional text font style 
       txtErrorFontWeight: FontWeight.normal,   //Optional text font weight 
       txtErrorColor:  Colors.red,              //Optional text error color 
       txtHintColor: Colors.grey);              //Optional text hint color 
0
likes
0
pub points
0%
popularity

Publisher

verified publisheratharvasystem.com

Creating ASTextField Package for use globally

Homepage

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on astextfield