密码字段
一个用于最常需要的密码文本字段小部件的 Flutter 包。它包含了密码文本字段所需的大多数功能
- 星标
- 14
- 复刻
- 5
- 最近推送(UTC)
- 2023年10月19日
- 项目状态
- 未归档
原始 README
以下为英文项目原文快照,最新内容请访问 GitHub。
passwordfield: ^0.2.0
A simple and easy to use flutter package to add a passwordfield to your Flutter project.
Getting Started
Installation
- Add the dependency
flutter pub add passwordfield
- Import the package
import 'package:passwordfield/passwordfield.dart';
- Voila! use the Widget
PasswordField();
Now Supports adding constraints on the Password

| Example 1 | Output |
|---|---|
|
|
| Example 2 | Output |
|---|---|
|
|
More examples here 👈
Properties
bool autoFocus: if autofocus is true keyboard pops up as soon as the widget is rendered on screen defaults to false
Color backgroundColor Background Color for the textfield (defaults to white), By default the backgroundColor is based on the current [Theme].
PasswordBorder border: Border class for the passwordfield which provides borders for different states of the passwordfield e.g [enabledBorder],[border], [focusedBorder], [focusedErrorBorder]
TextEditingController controller: A controller for an editable passwordfield.
int errorMaxLines: Defaults to null, which means that the [errorText] will be limited to a single line with [TextOverflow.ellipsis]
String errorMessage: custom message to show if the input password does not match the pattern.
String floatingText: floatingText to show when floatingPlaceholder is true
hasFloatingPlaceholder: whether the placeholder can float to left top on focus, defaults to false
final String hintText: default text to show on the passwordfield when it is empty
PasswordDecoration passwordDecoration: Decoration class for the PasswordField to customize the input styling
int maxLength: the max number of characters the password field can support
Function onSubmit: function triggerred when the submit button on keyboard is pressed
Function onChanged: function triggerred when the password is changed in the passwordfield
String passwordConstraint: supports adding constraints to the Passwordfield by adding a regex pattern
You are welcome to contribute to this package, to contribute please read the contributing guidelines.
分类
使用的依赖
依赖清单 3 项
- flutter
{"sdk":"flutter"} - flutter_test开发依赖
{"sdk":"flutter"} - lints开发依赖
^2.0.1
如何选择适合项目的代码仓?
先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
- 通过仓库名、作者或描述搜索,再按技术分类缩小范围。
- 结合星标、复刻与最近推送比较项目;星标反映社区关注,不代表质量保证。
- 使用前在 GitHub 核对 README、许可证与 Issues。
来源与维护
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗

