v1.1.0numeric_keyboard
Flutter 插件,可在 Android 與 iOS 上顯示一個簡單的數字鍵盤。
94喜歡 805近 30 天下載150Pub 分數
AndroidiOSWebmacOSWindowsLinux
Flutter 插件,用於在 Android 與 iOS 上顯示一個簡單的數字鍵盤
{"sdk":"flutter"}{"sdk":"flutter"}以下為英文專案原文快照,最新內容請造訪 GitHub。
A simple numeric keyboard widget
Add numeric_keyboard: ^1.1.0 in your pubspec.yaml dependencies. And import it:
import 'package:numeric_keyboard/numeric_keyboard.dart';
Simply create a NumericKeyboard widget and pass the required params:
NumericKeyboard(
onKeyboardTap: _onKeyboardTap
)
_onKeyboardTap(String value) {
setState(() {
text = text + value;
});
}
NumericKeyboard(
onKeyboardTap: _onKeyboardTap,
textColor: Colors.red,
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
)
For a more detail example please take a look at the example folder.
Numeric keyboard:
https://raw.githubusercontent.com/huextrat/numeric_keyboard/master/example/screenshot.pngIf something is missing, feel free to open a ticket or contribute!