import 'package:flutter/services.dart';

///页面输入格式限制
class PageInputFormatters {
  /// 禁止空格
  static final denyWhiteSpace =
      FilteringTextInputFormatter.deny(new RegExp(r'\b\s|\s\b'));

  /// 多样性账号(手机号/邮箱/用户名)
  static final multipleAccount = FilteringTextInputFormatter.allow(
      new RegExp(r'@|\.|[0-9A-Za-z\u4e00-\u9fa5]'));

  /// 字母或数字
  static final letterAndNumber =
      FilteringTextInputFormatter.allow(new RegExp(r'[0-9A-Za-z]'));

  /// 禁止字母或数字
  static final denyLetterAndNumber =
      FilteringTextInputFormatter.deny(new RegExp(r'[0-9A-Za-z]'));

  /// 纯数字
  static final number = FilteringTextInputFormatter.allow(new RegExp(r'[0-9]'));
}
