Material Text Fields는 폼 내에서 효율적인 텍스트 입력을 위해 설계된 사용자 정의 가능한 Flutter 위젯으로, Material Design 원칙을 따릅니다. Android, iOS, 웹, macOS, Windows, Linux 등 다양한 플랫폼에서 일관되고 시각적으로 매력적인 인터페이스를 제공합니다. 다양한 입력 유형, 검증 및 스타일링 옵션을 지원하여 반응형이고 접근성 있는 폼을 만들기에 이상적입니다. Dart로 작성되어 Flutter 애플리케이션에 자연스럽게 통합되며, devcrew.io에서 유지 관리됩니다.
사용 사례
폼 입력
사용자 등록
검색 바
연락처 양식
로그인 화면
데이터 수집
주요 기능
사용자 정의 가능한 외관
크로스 플랫폼 호환성
내장 검증
Material Design 준수
간편한 통합
반응형 레이아웃
적합한 대상
양식 중심 앱을 개발하는 개발자
UI 일관성을 우선시하는 팀
다중 플랫폼 지원이 필요한 프로젝트
접근성 있는 텍스트 입력이 필요한 앱
빠른 프로토타이핑
고려 사항
Flutter SDK가 필요합니다
마테리얼 디자인 미학에 국한됨
추가 검증 로직이 필요할 수 있습니다
외부 패키지 유지보수에 의존
Material UI가 아닌 경우에 적합하지 않음
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
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.