flutter_secure_pin_pad
An enterprise-grade, highly customizable PIN entry pad widget for Flutter. Designed for banking, fintech, and security-sensitive apps, featuring biometric auth fallback, anti-shoulder surfing shuffle mode, shake error feedback, and brute-force lockout timers.
๐ Key Features
- ๐ Anti-Shoulder Surfing Mode: Option to dynamically shuffle digit positions on every press to prevent screen recording and shoulder surfing attacks.
- ๐ Biometric Fallback Support: Native integration hook for Face ID / Fingerprint authentication.
- โฑ๏ธ Brute-Force Lockout Protection: Automatically locks out entry after configurable failed attempt thresholds with animated countdown timers.
- ๐ณ Haptic Feedback & Animations: Built-in elastic shake animations and native haptic feedback response on keypress.
- ๐จ Full Theme Customization: Dark and Light mode presets with customizable dot shapes, button shapes, colors, and icons.
๐ฆ Installation
Add flutter_secure_pin_pad to your pubspec.yaml:
dependencies:
flutter_secure_pin_pad: ^1.0.0
Then run:
flutter pub get
๐ Quick Start
import 'package:flutter/material.dart';
import 'package:flutter_secure_pin_pad/flutter_secure_pin_pad.dart';
class MyPinScreen extends StatefulWidget {
@override
State<MyPinScreen> createState() => _MyPinScreenState();
}
class _MyPinScreenState extends State<MyPinScreen> {
final PinPadController _controller = PinPadController(
pinLength: 4,
maxFailedAttempts: 3,
lockoutDuration: const Duration(seconds: 30),
);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: SecurePinPad(
controller: _controller,
enableDigitShuffle: true, // Anti-shoulder surfing
theme: PinPadTheme.dark(),
onPinSubmitted: (pin) {
if (pin == '1234') {
_controller.recordSuccess();
print('Access Granted!');
} else {
_controller.recordFailedAttempt();
print('Invalid PIN');
}
},
onBiometricPressed: () {
print('Biometric auth pressed');
},
),
),
);
}
}
๐งช Testing
Run automated package tests:
flutter test
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
Developed with โค๏ธ by Olamilekan Adeyemi (@lekthedeveloper).