isDigitsOnlyPattern function

bool isDigitsOnlyPattern(
  1. String? pattern
)

Reines Ziffernmuster -> die Kasse zeigt die Zifferntastatur.

Implementation

bool isDigitsOnlyPattern(String? pattern) {
  if (pattern == null || pattern.isEmpty || !isValidReferencePattern(pattern)) return false;
  final rest = pattern
      .replaceAll(r'\d', '')
      .replaceAll('[0-9]', '')
      .replaceAll(RegExp(r'\{\d+(,\d*)?\}'), '')
      .replaceAll('(?:', '')
      .replaceAll(RegExp(r'[()|?*+^$]'), '');
  return rest.isEmpty;
}