lock_screen_pin 0.1.1 copy "lock_screen_pin: ^0.1.1" to clipboard
lock_screen_pin: ^0.1.1 copied to clipboard

A customizable PIN/passcode lock screen with keypad, code dots, optional biometrics entry, and themeable colors and strings.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:lock_screen_pin/lock_screen_pin.dart';

void main() {
  runApp(const LockScreenPinExampleApp());
}

/// Example application for `lock_screen_pin`.
class LockScreenPinExampleApp extends StatelessWidget {
  /// Creates the example application.
  const LockScreenPinExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'lock_screen_pin example',
      theme: ThemeData(brightness: Brightness.dark),
      home: const PinLockPage(),
    );
  }
}

/// A page that shows a four-digit PIN lock screen.
class PinLockPage extends StatelessWidget {
  /// Creates a PIN lock page.
  const PinLockPage({super.key});

  @override
  Widget build(BuildContext context) {
    return LockScreen(
      title: 'Enter your PIN',
      passLength: 4,
      styles: const PinLockTheme(
        numberColor: Colors.white70,
        dotBorderColor: Colors.white,
      ),
      strings: const PinLockStrings(
        wrongPassTitle: 'Oops!',
        wrongPassContent: 'The passcode you entered is incorrect.',
        wrongPassCancelButtonText: 'Cancel',
      ),
      showWrongPassDialog: true,
      passCodeVerify: (code) async => code.join() == '1234',
      onSuccess: () {
        ScaffoldMessenger.of(
          context,
        ).showSnackBar(const SnackBar(content: Text('Unlocked')));
      },
    );
  }
}
0
likes
160
points
231
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A customizable PIN/passcode lock screen with keypad, code dots, optional biometrics entry, and themeable colors and strings.

Repository (GitHub)
View/report issues

Topics

#widget #pin #passcode #security #lock-screen

License

MIT (license)

Dependencies

flutter

More

Packages that depend on lock_screen_pin