rounded_text_form_field 0.0.2 copy "rounded_text_form_field: ^0.0.2" to clipboard
rounded_text_form_field: ^0.0.2 copied to clipboard

A Flutter library for rounded text form field with custom design and decoration.

Rounded Text Form Field #

rounded_text_form_field A Flutter library for rounded text form field with custom design and decoration with support for labels, hints, validation, and more. This widget simplifies the process of creating and customizing text input fields in your Flutter applications. ✨

It's support some type of image decoration such as [ TextInputAction, TextEditingController, HintText, Validator, Enabled or ReadOnly], etc.

Installation #

Create a new project with the command

flutter create MyApp

Add

rounded_text_form_field: ...

to your pubspec.yaml of your flutter project. OR run

flutter pub add rounded_text_form_field

in your project's root directory.

In your library add the following import:

import 'package:rounded_text_form_field/rounded_text_form_field.dart';

For help getting started with Flutter, view the online documentation.

Usage #

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Rounded Text Form Field',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          backgroundColor: Theme.of(context).colorScheme.inversePrimary,
          title: Text(widget.title),
        ),
        body: Center(
          child: Padding(
            padding: const EdgeInsets.symmetric(horizontal: 16),
            child: Column(
              children: [
                const SizedBox(height: 16),
                const Text(
                  "Name",
                  style: TextStyle(
                    fontSize: 14,
                    fontWeight: FontWeight.w600,
                  ),
                ),
                const SizedBox(height: 8),
                RoundedTextFormField(
                  textInputAction: TextInputAction.done,
                  controller: nameTextField,
                  hintText: "Please enter your name",
                  validator: (value) {
                    if (value!.isEmpty) {
                      return "Please enter your name";
                    } else if (value.length < 4) {
                      return "Please enter valid name";
                    }
                    return null;
                  },
                ),
                const SizedBox(height: 20),
              ],
            ),
          ),
        )
    );
  }
}

Constructor #

Basic

Parameter Default Description Required
controller - Text Editing Controller. True
hintText - Text form field hint text . True
validator - Text form field validator. false
textInputAction - Keyboard input action. false
enabled true To enable and disable text field. false
readOnly false Set read only status. false
onPressed - OnTap call back. false
maxLines 1 Text form field max line. false
1
likes
160
pub points
36%
popularity

Publisher

verified publisheraddwebsolution.com

A Flutter library for rounded text form field with custom design and decoration.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter

More

Packages that depend on rounded_text_form_field