Skip to content

Commit

Permalink
update parameter and keep same (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
TinoGuo authored Dec 30, 2020
1 parent b2136a2 commit c5e44ed
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [3.3.0] - 2020/12/30
* Update: `inputFormatter` replace with `inputFormatters` to keep same as TextField.

## [3.2.0] - 2020/12/29
* New: Cursor display #56
* Hint: Cursor would override hintText is enabled.
Expand Down
14 changes: 7 additions & 7 deletions lib/src/widget/pin_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class PinInputTextField extends StatefulWidget {
this.pinLength: _kDefaultPinLength,
this.onSubmit,
this.decoration = _kDefaultDecoration,
List<TextInputFormatter> inputFormatter,
List<TextInputFormatter> inputFormatters,
this.keyboardType: TextInputType.phone,
this.controller,
this.focusNode,
Expand Down Expand Up @@ -99,11 +99,11 @@ class PinInputTextField extends StatefulWidget {
(decoration as SupportGap).getGapWidthList == null ||
(decoration as SupportGap).getGapWidthList.length ==
pinLength - 1)),
inputFormatters = inputFormatter == null
inputFormatters = inputFormatters == null
? <TextInputFormatter>[
LengthLimitingTextInputFormatter(pinLength),
]
: inputFormatter
: inputFormatters
..add(LengthLimitingTextInputFormatter(pinLength)),
textCapitalization = textCapitalization ?? TextCapitalization.none,
cursor = cursor ?? Cursor.disabled(),
Expand Down Expand Up @@ -398,7 +398,7 @@ class PinInputTextFormField extends FormField<String> {
this.pinLength = _kDefaultPinLength,
ValueChanged<String> onSubmit,
PinDecoration decoration = _kDefaultDecoration,
List<TextInputFormatter> inputFormatter,
List<TextInputFormatter> inputFormatters,
TextInputType keyboardType = TextInputType.phone,
FocusNode focusNode,
bool autoFocus = false,
Expand Down Expand Up @@ -433,11 +433,11 @@ class PinInputTextFormField extends FormField<String> {
(decoration as SupportGap).getGapWidthList == null ||
(decoration as SupportGap).getGapWidthList.length ==
pinLength - 1)),
inputFormatters = inputFormatter == null
inputFormatters = inputFormatters == null
? <TextInputFormatter>[
LengthLimitingTextInputFormatter(pinLength),
]
: inputFormatter
: inputFormatters
..add(LengthLimitingTextInputFormatter(pinLength)),
super(
key: key,
Expand Down Expand Up @@ -471,7 +471,7 @@ class PinInputTextFormField extends FormField<String> {
pinLength: pinLength,
onSubmit: onSubmit,
decoration: decoration.copyWith(errorText: field.errorText),
inputFormatter: inputFormatter,
inputFormatters: inputFormatters,
keyboardType: keyboardType,
controller: state._effectiveController,
focusNode: focusNode,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: pin_input_text_field
description: A textField widget to help display different style pin written in pure dart, no extra dependency.
version: 3.2.0
version: 3.3.0
homepage: https://github.com/TinoGuo/pin_input_text_field

environment:
Expand Down

0 comments on commit c5e44ed

Please sign in to comment.