Skip to content

Commit 89705a8

Browse files
committed
bumped to 6.1.0
1 parent 17e85b9 commit 89705a8

File tree

4 files changed

+62
-5
lines changed

4 files changed

+62
-5
lines changed

CHANGELOG.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
[6.0.3]
1+
# [6.1.0]
2+
3+
### Features ✨
4+
5+
- Added haptic feedback
6+
`enum HapticFeedbackTypes { heavy, light, medium, selection, vibrate, }`
7+
- Added animated obscure widget support `obscuringWidget` and `blinkWhenObscuring`
8+
9+
### Fixes 🐛
210

311
- Fixed bug related to TextStyle not given.
412
- Fixed bug related to setState is being called after disposal.

README.md

+50-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ A flutter package which will help you to generate pin code fields with beautiful
2323
- Error animation. Currently have shake animation only. Watch the example app for how to integrate.
2424
- Works with Flutter's Form. You can use Form validator right off the bat.
2525
- Get currently typed text and use your condition to validate it. (for example: if (currentText.length != 6 || currentText != "your desired code"))
26+
- Haptic Feedback support
27+
- Animated obscure widget support
2628

2729
## Getting Started ⚡️
2830

@@ -45,7 +47,7 @@ A flutter package which will help you to generate pin code fields with beautiful
4547
## Properties 🔖
4648

4749
```Dart
48-
/// The [BuildContext] of the application
50+
/// The [BuildContext] of the application
4951
final BuildContext appContext;
5052
5153
///Box Shadow for Pincode
@@ -59,11 +61,36 @@ A flutter package which will help you to generate pin code fields with beautiful
5961
6062
/// Character used for obscuring text if obscureText is true.
6163
///
62-
/// Must not be empty. Single character is recommended.
64+
/// Must not be empty. Single character is recommended. If obscuringWidget
65+
/// is provided then it will be ignored.
6366
///
6467
/// Default is ● - 'Black Circle' (U+25CF)
6568
final String obscuringCharacter;
6669
70+
/// Widget used to obscure text
71+
///
72+
/// it overrides the obscuringCharacter
73+
final Widget obscuringWidget;
74+
75+
/// Whether to use haptic feedback or not
76+
///
77+
///
78+
final bool useHapticFeedback;
79+
80+
/// Haptic Feedback Types
81+
///
82+
/// heavy, medium, light links to respective impacts
83+
/// selection - selectionClick, vibrate - vibrate
84+
/// check [HapticFeedback] for more
85+
final HapticFeedbackTypes hapticFeedbackTypes;
86+
87+
/// Decides whether typed character should be
88+
/// briefly shown before being obscured
89+
final bool blinkWhenObscuring;
90+
91+
/// Blink Duration if blinkWhenObscuring is set to true
92+
final Duration blinkDuration;
93+
6794
/// returns the current typed text in the fields
6895
final ValueChanged<String> onChanged;
6996
@@ -272,6 +299,14 @@ Thanks to everyone whoever suggested their thoughts to improve this package. And
272299
<td align="center"><a href="https://github.com/ItamarMu"><img src="https://avatars0.githubusercontent.com/u/27651221?v=3" width="100px;" alt="ItamarMu"/><br /><sub><b>ItamarMu</b></sub></a><br /><a href="https://github.com/adar2378/pin_code_fields/commits?author=ItamarMu" title="Code">💻</a></td>
273300
<td align="center"><a href="https://github.com/Margarets00"><img src="https://avatars0.githubusercontent.com/u/39041161?v=3" width="100px;" alt="Kim Minju"/><br /><sub><b>Kim Minju</b></sub></a><br /><a href="https://github.com/adar2378/pin_code_fields/commits?author=Margarets00" title="Code">💻</a></td>
274301
</tr>
302+
303+
<tr>
304+
<td align="center"><a href="https://github.com/JSBmanD"><img src="https://avatars3.githubusercontent.com/u/5402335?s=400&v=4" width="100px;" alt="Dmitry Vakhnin"/><br /><sub><b>Dmitry Vakhnin</b></sub></a><br /><a href="https://github.com/adar2378/pin_code_fields/commits?author=JSBmanD" title="Code">💻</a></td>
305+
<td align="center"><a href="https://github.com/serendipity1004"><img src="https://avatars3.githubusercontent.com/u/20388249?s=400" width="100px;" alt="serendipity1004"/><br /><sub><b>Jiho Choi</b></sub></a><br /><a href="https://github.com/adar2378/pin_code_fields/commits?author=serendipity1004" title="Code">💻</a></td>
306+
<td align="center"><a href="https://github.com/ened"><img src="https://avatars0.githubusercontent.com/u/269860?v=3" width="100px;" alt="Sebastian Roth"/><br /><sub><b>Sebastian Roth</b></sub></a><br /><a href="https://github.com/adar2378/pin_code_fields/commits?author=ened" title="Code">💻</a></td>
307+
<td align="center"><a href="https://github.com/BrunoEleodoro"><img src="https://avatars2.githubusercontent.com/u/20596317?s=400" width="100px;" alt="BrunoEleodoro"/><br /><sub><b>Bruno Eleodoro Roza</b></sub></a><br /><a href="https://github.com/adar2378/pin_code_fields/commits?author=BrunoEleodoro" title="Code">💻</a></td>
308+
309+
</tr>
275310
</table>
276311

277312
**The pin code text field widget example**
@@ -323,6 +358,19 @@ enum PinCodeFieldShape { box, underline, circle }
323358
enum AnimationType { scale, slide, fade, none }
324359
```
325360

361+
**Haptic Feedbacks can be among these 5 types**
362+
363+
```Dart
364+
enum HapticFeedbackTypes {
365+
heavy,
366+
light,
367+
medium,
368+
selection,
369+
vibrate,
370+
}
371+
372+
```
373+
326374
**Trigger Error animation**<br>
327375

328376
1. Create a StreamController<ErrorAnimationType>

example/lib/main.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,9 @@ class _PinCodeVerificationScreenState extends State<PinCodeVerificationScreen> {
126126
fontWeight: FontWeight.bold,
127127
),
128128
length: 6,
129-
obscureText: false,
129+
obscureText: true,
130130
obscuringCharacter: '*',
131+
blinkWhenObscuring: true,
131132
animationType: AnimationType.fade,
132133
validator: (v) {
133134
if (v.length < 3) {

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: pin_code_fields
22
description: A flutter package which will help you to generate pin code fields. Can be useful for OTP for example.
3-
version: 6.0.3
3+
version: 6.1.0
44
homepage: https://github.com/adar2378
55
repository: https://github.com/adar2378/pin_code_fields
66

0 commit comments

Comments
 (0)