From 89705a8f4629e79e87a4eb963fed6bd6d1b0e7cd Mon Sep 17 00:00:00 2001 From: adar2378 Date: Wed, 20 Jan 2021 18:43:32 +0600 Subject: [PATCH] bumped to 6.1.0 --- CHANGELOG.md | 10 ++++++++- README.md | 52 +++++++++++++++++++++++++++++++++++++++++-- example/lib/main.dart | 3 ++- pubspec.yaml | 2 +- 4 files changed, 62 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd9935ca..8a5d909b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,12 @@ -[6.0.3] +# [6.1.0] + +### Features ✨ + +- Added haptic feedback + `enum HapticFeedbackTypes { heavy, light, medium, selection, vibrate, }` +- Added animated obscure widget support `obscuringWidget` and `blinkWhenObscuring` + +### Fixes 🐛 - Fixed bug related to TextStyle not given. - Fixed bug related to setState is being called after disposal. diff --git a/README.md b/README.md index 0b4be1fe..c19d6351 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ A flutter package which will help you to generate pin code fields with beautiful - Error animation. Currently have shake animation only. Watch the example app for how to integrate. - Works with Flutter's Form. You can use Form validator right off the bat. - Get currently typed text and use your condition to validate it. (for example: if (currentText.length != 6 || currentText != "your desired code")) +- Haptic Feedback support +- Animated obscure widget support ## Getting Started ⚡️ @@ -45,7 +47,7 @@ A flutter package which will help you to generate pin code fields with beautiful ## Properties 🔖 ```Dart - /// The [BuildContext] of the application + /// The [BuildContext] of the application final BuildContext appContext; ///Box Shadow for Pincode @@ -59,11 +61,36 @@ A flutter package which will help you to generate pin code fields with beautiful /// Character used for obscuring text if obscureText is true. /// - /// Must not be empty. Single character is recommended. + /// Must not be empty. Single character is recommended. If obscuringWidget + /// is provided then it will be ignored. /// /// Default is ● - 'Black Circle' (U+25CF) final String obscuringCharacter; + /// Widget used to obscure text + /// + /// it overrides the obscuringCharacter + final Widget obscuringWidget; + + /// Whether to use haptic feedback or not + /// + /// + final bool useHapticFeedback; + + /// Haptic Feedback Types + /// + /// heavy, medium, light links to respective impacts + /// selection - selectionClick, vibrate - vibrate + /// check [HapticFeedback] for more + final HapticFeedbackTypes hapticFeedbackTypes; + + /// Decides whether typed character should be + /// briefly shown before being obscured + final bool blinkWhenObscuring; + + /// Blink Duration if blinkWhenObscuring is set to true + final Duration blinkDuration; + /// returns the current typed text in the fields final ValueChanged onChanged; @@ -272,6 +299,14 @@ Thanks to everyone whoever suggested their thoughts to improve this package. And ItamarMu
ItamarMu

💻 Kim Minju
Kim Minju

💻 + + + Dmitry Vakhnin
Dmitry Vakhnin

💻 + serendipity1004
Jiho Choi

💻 + Sebastian Roth
Sebastian Roth

💻 + BrunoEleodoro
Bruno Eleodoro Roza

💻 + + **The pin code text field widget example** @@ -323,6 +358,19 @@ enum PinCodeFieldShape { box, underline, circle } enum AnimationType { scale, slide, fade, none } ``` +**Haptic Feedbacks can be among these 5 types** + +```Dart +enum HapticFeedbackTypes { + heavy, + light, + medium, + selection, + vibrate, +} + +``` + **Trigger Error animation**
1. Create a StreamController diff --git a/example/lib/main.dart b/example/lib/main.dart index 5345a4a8..ca5272ed 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -126,8 +126,9 @@ class _PinCodeVerificationScreenState extends State { fontWeight: FontWeight.bold, ), length: 6, - obscureText: false, + obscureText: true, obscuringCharacter: '*', + blinkWhenObscuring: true, animationType: AnimationType.fade, validator: (v) { if (v.length < 3) { diff --git a/pubspec.yaml b/pubspec.yaml index 05bb96df..778382e7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: pin_code_fields description: A flutter package which will help you to generate pin code fields. Can be useful for OTP for example. -version: 6.0.3 +version: 6.1.0 homepage: https://github.com/adar2378 repository: https://github.com/adar2378/pin_code_fields