Yep, you can use the inputFormatters attribute and add the WhitelistingTextInputFormatter.digitsOnly expression
import 'package:flutter/services.dart';
TextFormField(
...
inputFormatters: [WhitelistingTextInputFormatter.digitsOnly],
)
You can find more info here: https://docs.flutter.io/flutter/services/TextInputFormatter-class.html
After flutter 1.12, WhitelistingTextInputFormatter was deprecated and you are running a newer version, use :
FilteringTextInputFormatter.digitsOnly
https://api.flutter.dev/flutter/services/FilteringTextInputFormatter-class.html