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,
        ),
    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;
                },
              ),
            ],
          ),
        );
      }
    }

Libraries

custom_textfield