I have a TextFiled in a Flatter app and I need it to only be able to enter a number from 1 to 49. Thanks in advance for all the tips.
TextField(
controller: TextEditingController()
..text = (quantity ?? "").toString()
..selection = TextSelection.collapsed(offset: (quantity ?? "").toString().length),
inputFormatters: <TextInputFormatter>[
LengthLimitingTextInputFormatter(2),
FilteringTextInputFormatter.digitsOnly,
],
enabled: true,
),