use thisinputFormatter: <TextInputFormatter>[WhitelistingTextInputFormatter(RegExp('[0-9]'))]
inputFormatter: <TextInputFormatter>[WhitelistingTextInputFormatter(RegExp('[0-9]'))]
This will accept only digits from 0 to 9