Skip to content

Commit

Permalink
bumped to 6.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
adar2378 committed Jan 20, 2021
1 parent 17e85b9 commit 89705a8
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 5 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
52 changes: 50 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ⚡️

Expand All @@ -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
Expand All @@ -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<String> onChanged;
Expand Down Expand Up @@ -272,6 +299,14 @@ Thanks to everyone whoever suggested their thoughts to improve this package. And
<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>
<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>
</tr>

<tr>
<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>
<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>
<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>
<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>

</tr>
</table>

**The pin code text field widget example**
Expand Down Expand Up @@ -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**<br>

1. Create a StreamController<ErrorAnimationType>
Expand Down
3 changes: 2 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ class _PinCodeVerificationScreenState extends State<PinCodeVerificationScreen> {
fontWeight: FontWeight.bold,
),
length: 6,
obscureText: false,
obscureText: true,
obscuringCharacter: '*',
blinkWhenObscuring: true,
animationType: AnimationType.fade,
validator: (v) {
if (v.length < 3) {
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_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

Expand Down

0 comments on commit 89705a8

Please sign in to comment.