flutter textfield to accept only numbers code example
Example 1: flutter textfield number only
import 'package:flutter/services.dart';
keyboardType: TextInputType.number,
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
Example 2: how to allow only characters and numbers in textfield flutter
inputFormatters: [new WhitelistingTextInputFormatter(RegExp("[a-zA-Z0-9]")),],