Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/TinoGuo/pin_input_text_field
A textField widget to help display different style pin
https://github.com/TinoGuo/pin_input_text_field
dart flutter pin pub textfield-widget
Last synced: about 2 months ago
JSON representation
A textField widget to help display different style pin
- Host: GitHub
- URL: https://github.com/TinoGuo/pin_input_text_field
- Owner: TinoGuo
- License: apache-2.0
- Created: 2018-12-23T16:41:14.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-08T08:06:39.000Z (9 months ago)
- Last Synced: 2024-04-08T09:34:59.327Z (9 months ago)
- Topics: dart, flutter, pin, pub, textfield-widget
- Language: Dart
- Size: 158 MB
- Stars: 364
- Watchers: 7
- Forks: 79
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
![](https://github.com/TinoGuo/pin_input_text_field/workflows/Flutter%20Build%20Test%20CI/badge.svg?branch=master)
[![pub package](https://img.shields.io/pub/v/pin_input_text_field.svg)](https://pub.dartlang.org/packages/pin_input_text_field)
![GitHub](https://img.shields.io/github/license/TinoGuo/pin_input_text_field)
![GitHub top language](https://img.shields.io/github/languages/top/TinoGuo/pin_input_text_field)# pin_input_text_field
[δΈζ](./README_CN.md)
PinInputTextField is a TextField widget to help display different style pin. It supports all the platforms [flutter](https://github.com/flutter/flutter) supports.## Notes π¨
**please use 4.4.1 for flutter version is below 3.7.0**## Feature π
* allow you customized the shape, any!
* built-in 4 commonly used pin styles of shape
* obscure support
* solid support
* enterColor support
* cursor support
* support all the textField properties theoretically
* Flutter all platform support## Example π¦
Thanks to the [Flutter Web](https://flutter.dev/web), you can enjoy the preview by [website](https://tinoguo.github.io/pin_input_text_field/) without any installation.
### Decoration
**UnderlineDecoration**
**BoxLooseDecoration**
**BoxTightDecoration**
**CircleDecoration**
## Installing π§
Install the latest version from [pub](https://pub.dartlang.org/packages/pin_input_text_field).## Usage βοΈ
### Attributes
Customizable attributes for PinInputTextFieldAttribute Name
Example Value
Description
pinLength
6
The max length of pin, the default is 6
onSubmit
(String pin){}
The callback will execute when user click done, sometimes is not working in Android.
decoration
BoxLooseDecoration
Decorate the pin, there are 3 inside styles, the default is BoxLooseDecoration
inputFormatters
WhitelistingTextInputFormatter.digitsOnly
Just like TextField's inputFormatter, the default is WhitelistingTextInputFormatter.digitsOnly
keyboardType
TextInputType.phone
Just like TextField's keyboardType, the default is TextInputType.phone
pinEditingController
PinEditingController
Controls the pin being edited. If null, this widget will create its own PinEditingController
autoFocus
false
Same as TextField's autoFocus, the default is false
focusNode
FocusNode
Same as TextField's focusNode
textInputAction
TextInputAction.done
Same as TextField's textInputAction, not working in digit mode
enabled
true
Same as TextField's enabled, the default is true
onChanged
(String pin){}
Same as TextField's onChanged
textCapitalization
TextCapitalization.words
Same as TextField's textCapitalization
cursor
Cursor.disabled()
The cursor of the pin, default is not enabled
### FormField
Instead of using PinInputTextField, using PinInputTextFormField to control validate.### ObscureStyle
```
/// Determine whether replace [obscureText] with number.
final bool isTextObscure;
/// The display text when [isTextObscure] is true, emoji supported
final String obscureText;
```## Known Issue π₯Ά
The `PinEditingController` listener will execute more than once when programmatically set text, you can filter some duplicate values in your code.
## License
```text
Copyright 2019 Tino Guo.Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```