sparrowu93 / Onscreen-num-keyboard

On Screen Numeric Keyboard

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

numeric_keyboard

A simple numeric keyboard widget

pub package

Installation

Add onscreen_num_keyboard: ^1.0.2 in your pubspec.yaml dependencies. And import it:

import 'package:onscreen_num_keyboard/onscreen_num_keyboard.dart';

How to use

Simply create a NumericKeyboard widget and pass the required params:

NumericKeyboard(
  onKeyboardTap: _onKeyboardTap
)

_onKeyboardTap(String value) {
  setState(() {
    text = text + value;
  });
}

Params

NumericKeyboard(
  onKeyboardTap: _onKeyboardTap,
  textStyle: TextStyle(
    fontSize: 20.0,
    color: Colors.black
  ),
  rightButtonFn: () {
    setState(() {
      text = text.substring(0, text.length - 1);
    });
  },
  rightIcon: Icon(Icons.backspace, color: Colors.red,),
  leftButtonFn: () {
    print('left button clicked');
  },
  leftIcon: Icon(Icons.check, color: Colors.red,),
  mainAxisAlignment: MainAxisAlignment.spaceEvenly
)

Example

Example UI for the widget: Example

If something is missing, feel free to open a ticket or contribute!

About

On Screen Numeric Keyboard

License:MIT License


Languages

Language:C++ 43.8%Language:CMake 20.7%Language:Dart 17.1%Language:HTML 10.2%Language:Shell 2.0%Language:C 1.9%Language:Objective-C 1.7%Language:Java 1.3%Language:Swift 1.1%Language:Kotlin 0.3%