Orientação gerada a partir de informações públicas. Apenas para referência.
Material Text Fields é um widget personalizável do Flutter projetado para entrada eficiente de texto em formulários, seguindo os princípios do Material Design. Oferece uma interface consistente e visualmente atraente em plataformas como Android, iOS, Web, macOS, Windows e Linux. O widget suporta vários tipos de entrada, validação e opções de estilo, tornando-o ideal para criar formulários responsivos e acessíveis. Desenvolvido com Dart, integra-se perfeitamente em aplicações Flutter e é mantido pela devcrew.io.
Casos de uso
Entradas de formulário
Registro de usuário
Barras de pesquisa
Formulários de contato
Telas de login
Coleta de dados
Principais recursos
Aparência personalizável
Compatibilidade multiplataforma
Validação embutida
Conformidade com o Material Design
Integração fácil
Layout responsivo
Indicado para
Desenvolvedores construindo aplicativos com muitos formulários
Equipes que priorizam a consistência da interface
Projetos que exigem suporte multiplataforma
Aplicativos que precisam de entradas de texto acessíveis
Prototipagem rápida
Considerações
Requer Flutter SDK
Limitado à estética do Material Design
Pode ser necessário lógica de validação adicional
Depende do maintenance de pacotes externos
Não adequado para interfaces não Material
README original
Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.
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.