sp_ios_num_keyboard 1.2.5 copy "sp_ios_num_keyboard: ^1.2.5" to clipboard
sp_ios_num_keyboard: ^1.2.5 copied to clipboard

Flutter plugin to display a simple numeric keyboard on Android & iOS. (Customized Onscreen-num-keyboard)

numeric_keyboard #

A simple numeric keyboard widget

pub package

Installation #

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

import 'package:onscreen_num_keyboard/sp_ios_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: () {
    if (text.isEmpty) return;
    setState(() {
      text = text.substring(0, text.length - 1);
    });
  },
  rightButtonLongPressFn: () {
    if (text.isEmpty) return;
    setState(() {
      text = '';
    });
  },
  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!

5
likes
150
points
52
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter plugin to display a simple numeric keyboard on Android & iOS. (Customized Onscreen-num-keyboard)

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, mediaquery_sizer

More

Packages that depend on sp_ios_num_keyboard