Package selection guidance compiled from public package information, community data, and project usage.
Material Text Fields is a customizable Flutter widget designed for efficient text input within forms, following Material Design principles. It provides a consistent and visually appealing interface across platforms including Android, iOS, Web, macOS, Windows, and Linux. The widget supports various input types, validation, and styling options, making it ideal for creating responsive and accessible forms. Built with Dart, it integrates seamlessly into Flutter applications and is maintained by devcrew.io.
Use cases
Form inputs
User registration
Search bars
Contact forms
Login screens
Data collection
Key features
Customizable appearance
Cross-platform compatibility
Built-in validation
Material Design compliance
Easy integration
Responsive layout
Suitable for
Developers building form-heavy apps
Teams prioritizing UI consistency
Projects requiring multi-platform support
Apps needing accessible text inputs
Rapid prototyping
Considerations
Requires Flutter SDK
Limited to Material Design aesthetics
May need additional validation logic
Depends on external package maintenance
Not suitable for non-Material UIs
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
Material Text Field
Material Text Field is a customizable widget for text input values in Dart. You can define the styling of the text field in your app's theme file or create multiple text fields with different styling. You can easily create text input fields with customizable styling and behaviors.
Installation
To use Material Text Field in your Dart project, add the following dependency to your "pubspec.yaml" file
You can create multiple text fields with different styling with providing "theme" attribute.
MaterialTextField(
keyboardType: TextInputType.text,
labelText: 'Name',
theme: FilledOrOutlinedTextTheme(
enabledColor: Colors.grey,
focusedColor: Colors.green,
fillColor: Colors.transparent,
// You can use all properties of FilledOrOutlinedTextTheme// to decor text field
),
prefixIcon: Image.asset('assets/images/ic_email.png'),
)
Advance Usage
With all possible params
MaterialTextField(
keyboardType: TextInputType.emailAddress,
hint: 'Email',
textInputAction: TextInputAction.next,
prefixIcon: Image.asset('assets/images/ic_lock.png'),
controller: _emailTextController,
validator: FormValidation.emailTextField,
onChanged: (text) {
print('First text field: $text');
},
suffixIcon: Image.asset('assets/images/ic_lock.png'),
enabled: false,
obscureText: true,
style: constTextStyle(fontSize: 16, color: Colors.black),
labelText: 'Password',
theme: FilledOrOutlinedTextTheme(
enabledColor: Colors.grey,
focusedColor: Colors.green,
fillColor: Colors.transparent,
) // you can use theme param to differ this text field from app level theming
)
Theming
To define the styling of the text field, you can either use the app-level theme file or specify the styling directly on the widget.
App-level theme
You can use MaterialTextFieldTheme class for text field theming. This Theme class which define theming for Filled/Outlined and underline text field theming. You can use this class for text field theming
Contributions, issues, and feature requests are welcome!
Show your Support
Give a star if this project helped you.
Bugs and feature requests
Have a bug or a feature request? Please first search for existing and closed issues.
If your problem or idea is not addressed yet, please open a new issue.