custom_text_form_field 0.0.6 custom_text_form_field: ^0.0.6 copied to clipboard
This package contains a text box that you pass properties to. It is flexible that you can control as you like, such as color, length, width, font size suitable for all screens.
custom_textfield_package #
A new Flutter package (custom textfield package).
Getting Started #
- For Call Class
CustomTextField(
width: size.width * 0.39,
label: getTranslated(context, "first_name"),
isRequired: true,
controller: _firstNameController,
maxLength: 30,
withValidate: true,
),
copied to clipboard
import 'package:custom_text_form_field/custom_textfield.dart';
import 'package:flutter/material.dart';
class LoginPage extends StatelessWidget {
const LoginPage({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: Column(
children: [
SizedBox(height: 50,),
CustomTextField(
label: "First name",
isRequired: true,
maxLength: 30,
withValidate: true,
errorText: "please enter you first name",
),
SizedBox(height: 20,),
CustomTextField(
label: "Email",
prefixIcon: Padding(
padding: const EdgeInsets.all(8.0),
child: Icon(
Icons.email
),
),
customValidator: (value) {
if (value.toString().trim().isEmpty) {
return "can_not_empty";
}return null;
},
),
],
),
);
}
}
copied to clipboard