07-21-2023, 01:05 PM
I want to input only decimal number in `TextField` in `Flutter`. I tried below code but that's not working. It allows alpha (a-z) and special characters.
TextField(
controller:
new TextEditingController(text: listDisplay[position].getBlockQty(),
),
textAlign: TextAlign.center,
maxLines: 1,
keyboardType: TextInputType.numberWithOptions(
decimal: true,
signed: false),
),
TextField(
controller:
new TextEditingController(text: listDisplay[position].getBlockQty(),
),
textAlign: TextAlign.center,
maxLines: 1,
keyboardType: TextInputType.numberWithOptions(
decimal: true,
signed: false),
),