apptomate_custom_text_field 0.0.1
apptomate_custom_text_field: ^0.0.1 copied to clipboard
CustomTextFormField is a reusable and highly customizable text input widget for Flutter applications
apptomate_custom_text_field #
CustomTextFormField is a reusable and highly customizable text input widget for Flutter applications.
📝 Description #
CustomTextFormField is a reusable and highly customizable text input widget for Flutter applications. It extends StatefulWidget to provide flexible input handling, validation, and styling.
🚀 Features #
✔️ Customizable margins, padding, and borders
✔️ Support for text input formatting and capitalization
✔️ Ability to show/hide counters and set character limits
✔️ Custom styling for labels, hints, errors, and text
✔️ Optional prefix and suffix icons
✔️ Configurable keyboard types and actions
✔️ Built-in validation and focus handling
✔️ Supports autofill hints
✔️ Obscure text for password fields
📲 Installation #
Add the dependency to your pubspec.yaml:
dependencies:
apptomate_custom_text_field: ^0.0.1
Basic Example #
TextEditingController emailController=TextEditingController();
FocusNode emailFocus=FocusNode();
CustomTextFormField(
margin: const EdgeInsets.only(top: 5,left: 24,right: 24),
hintText: "Email Address",
onTap: () {},
label: "Email",
autofillHints: const [AutofillHints.email],
obscureText: false,
textCapitalization: TextCapitalization.none,
textInputType: TextInputType.emailAddress,
actionKeyboard: TextInputAction.next,
functionValidate: (){},
controller:emailController,
focusNode: emailFocus,
onSubmitField: (val) {},
filledColor: Colors.white,
isFilled: true,
validator: (value) {
return null ;
},
textStyle: textFieldStyle,
borderRadius: 0,
errorBorder: textBoxOutLineLineErrorBorder,
enabledBorder: textBoxOutLineLineBorderEnabledStyle,
disabledBorder: textBoxOutLineLineBorderDisabledStyle,
hintStyle: textFieldHintStyle,
onChanged: (value) => null,
),
FocusNode passwordFocus=FocusNode();
TextEditingController passwordController=TextEditingController();
CustomTextFormField(
margin: const EdgeInsets.only(top: 12,left: 24,right: 24),
hintText: "Password",
autofillHints: [AutofillHints.password],
onTap: () {},
maxLines:1,
padding: EdgeInsets.only(top: 15,bottom: 15,left: 12,right: 12),
obscureText: _isObscured,
//prefixIcon: const Icon(Icons.password),
textInputType: TextInputType.text,
actionKeyboard: TextInputAction.done,
controller: passwordController,
focusNode: passwordFocus,
onSubmitField: (val) {},
filledColor: whiteColor,
isFilled: true,
validator: (value) =>null,
textStyle: textFieldStyle,
borderRadius: 0,
enabledBorder: textBoxOutLineLineBorderEnabledStyle,
disabledBorder: textBoxOutLineLineBorderDisabledStyle,
hintStyle: textFieldHintStyle,
onChanged: (value) => null,
errorBorder: textBoxOutLineLineErrorBorder,
suffixIcon: IconButton(
icon: Icon(_isObscured ? Icons.visibility_off : Icons.visibility),
onPressed: () {
setState(() {
_isObscured = !_isObscured;
});
},
),
),