You can specify the number as keyboardType for the TextField using: keyboardType: TextInputType.number // Learn Flutter inside VS Code at sideguide.dev/courses/flutter?ref=grepper