numpad_layout 0.0.3 numpad_layout: ^0.0.3 copied to clipboard
A new Flutter Package for numeric Keyboard with flexible customization as well as arabic digits support and many many more.
import 'package:flutter/material.dart';
import 'package:numpad_layout/widgets/numPad.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
String number = "";
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'NumPad Example',
home: Scaffold(
body: Padding(
padding: const EdgeInsets.only(top: 150),
child: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
number,
style: const TextStyle(
fontSize: 32,
fontWeight: FontWeight.bold,
),
),
const SizedBox(
height: 40,
),
NumPad(
arabicDigits: true,
onType: (value) {
number += value;
setState(() {});
},
rightWidget: IconButton(
icon: const Icon(Icons.backspace),
onPressed: () {
if (number.isNotEmpty) {
number = number.substring(0, number.length - 1);
setState(() {});
}
},
),
),
],
),
),
),
),
);
}
}