Search packages, repositories and app categories

number_pad_keyboard cover
Package detailsv0.0.6

number_pad_keyboard

A Flutter package that provides a customizable number pad keyboard for entering PIN codes or numeric input. It includes features such as custom styling for numbers and buttons.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
52
Likes
90
Pub points
160

Install package

flutter pub add number_pad_keyboard

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter package offering a customizable number pad keyboard designed for entering PIN codes or numeric input. It allows developers to tailor the appearance of numbers and buttons with custom styling, ensuring a consistent look across platforms. The keyboard is optimized for mobile and desktop environments, supporting Android, iOS, Web, macOS, Windows, and Linux. Ideal for authentication flows, payment inputs, or any scenario requiring secure numeric entry.

Use cases

  • PIN code entry
  • Secure numeric input
  • Payment form fields
  • Authentication screens
  • User ID verification
  • Digital keypad interfaces

Key features

  • Customizable button styling
  • Cross-platform compatibility
  • PIN code focused design
  • Configurable number layout
  • Responsive UI components
  • Easy integration with TextFormField

Suitable for

  • Mobile app developers
  • Web application creators
  • Desktop app builders
  • Security-focused applications
  • Forms requiring numeric input

Considerations

  • Limited to numeric input only
  • No built-in validation
  • Requires manual handling of input events
  • Not suitable for text input
  • May need additional styling for dark mode

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Number Pad Keyboard

A Flutter package that provides a customizable number pad keyboard widget for entering PIN codes or numeric input.

Features

  • Customizable Design: Easily customize the look and feel of the number pad keyboard.
  • PIN Code Entry: Suitable for entering PIN codes or any numeric input in Flutter applications.
  • Flexible Usage: Integrate seamlessly into any Flutter project requiring a numeric keyboard interface.

Installation

Add the following dependency to your pubspec.yaml file:

dependencies:
  number_pad_keyboard: ^1.0.0

Importing

To use the Number Pad Keyboard widget in your Flutter project, import it as follows:

import 'package:number_pad_keyboard/number_pad_keyboard.dart';

Example


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

void main() {
  runApp(
    const MyApp(),
  );
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Number Pad Keyboard Example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final TextEditingController _textController = TextEditingController();

  void _addDigit(int digit) {
    if (_textController.text.length < 10) {
      setState(() {
        _textController.text = _textController.text + digit.toString();
      });
    }
  }

  void _backspace() {
    if (_textController.text.isNotEmpty) {
      setState(() {
        _textController.text =
            _textController.text.substring(0, _textController.text.length - 1);
      });
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Number Pad Keyboard Example'),
      ),
      body: SizedBox(
        width: double.infinity,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.end,
          children: <Widget>[
            Padding(
              padding: const EdgeInsets.all(20.0),
              child: TextFormField(
                controller: _textController,
                decoration: const InputDecoration(
                  border: OutlineInputBorder(),
                  labelText: 'PIN Code',
                ),
                readOnly: true,
                textAlign: TextAlign.center,
                style: const TextStyle(fontSize: 24.0),
              ),
            ),

            const SizedBox(height: 200.0,),

            NumberPadKeyboard(
              addDigit: _addDigit,
              backspace: _backspace,
              enterButtonText: 'ENTER',
              onEnter: () {
                debugPrint('PIN Code: ${_textController.text}');
              },
            ),
          ],
        ),
      ),
    );
  }
}

Categories

Source repository

Projects using this package

No data available yet.