From 57046a1d5cf4fbc2c1a1ffe4c70db0028e1598a1 Mon Sep 17 00:00:00 2001 From: Kirill Velikanov Date: Thu, 4 May 2023 11:03:36 +0300 Subject: [PATCH 1/2] Add support for autofill hints --- lib/src/flutter_pin_code_fields.dart | 4 ++++ lib/src/pin_code_fields_state.dart | 1 + 2 files changed, 5 insertions(+) diff --git a/lib/src/flutter_pin_code_fields.dart b/lib/src/flutter_pin_code_fields.dart index 60d300a..db9ced6 100644 --- a/lib/src/flutter_pin_code_fields.dart +++ b/lib/src/flutter_pin_code_fields.dart @@ -59,6 +59,9 @@ class PinCodeFields extends StatefulWidget { /// Default is false final bool autofocus; + /// A list of strings that helps the autofill service identify the type of this text input. + final Iterable? autofillHints; + /// Custom text style final TextStyle textStyle; @@ -147,6 +150,7 @@ class PinCodeFields extends StatefulWidget { this.focusNode, this.onChange, required this.onComplete, + this.autofillHints, }); @override diff --git a/lib/src/pin_code_fields_state.dart b/lib/src/pin_code_fields_state.dart index abad4d1..16e295d 100644 --- a/lib/src/pin_code_fields_state.dart +++ b/lib/src/pin_code_fields_state.dart @@ -40,6 +40,7 @@ class PinCodeFieldsState extends State { controller: _textEditingController, focusNode: _focusNode, enabled: widget.enabled, + autofillHints: widget.autofillHints, autofocus: widget.autofocus, autocorrect: false, keyboardType: widget.keyboardType, From ccd2249527839f11bca1f4d1f105b0d9bc3d378c Mon Sep 17 00:00:00 2001 From: Sanif Himani Date: Sat, 6 May 2023 12:31:40 -0400 Subject: [PATCH 2/2] Update version and changelog --- CHANGELOG.md | 3 +++ README.md | 1 + pubspec.yaml | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05044d9..998881f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [2.2.0] +- Add support for auto fill hints + ## [2.1.0] - Add support for input formatters diff --git a/README.md b/README.md index 3f9f7c0..ba50c52 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ A Flutter package to generate customizable pin code fields. * Responsive * Supports animations * Supports autofocus +* Supports autofill * Supports obscuring text with custom character # Usage diff --git a/pubspec.yaml b/pubspec.yaml index fa1a302..16419fa 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_pin_code_fields description: A flutter package which will help you generate customizable pin code fields. Can be used for login pins or OTP. -version: 2.1.0 +version: 2.2.0 homepage: https://github.com/sanifhimani/flutter_pin_code_fields repository: https://github.com/sanifhimani/flutter_pin_code_fields issue_tracker: https://github.com/sanifhimani/flutter_pin_code_fields/issues