validators property

Map<String, CellValidator> validators
final

Validators for various Columns. Displays SnackBar

validators: {
   'Product': (value) {
    if (value == null || value.isEmpty) {
      return 'No Empty field';
    }
   return null;
 },
  'Quantity': (value) {
    if (value == null || int.tryParse(value) == null) {
      return 'Number only';
    }
    if (int.parse(value) <= 0) {
      return '+ Number only';
    }
    return null;
  },
}

Implementation

final Map<String, CellValidator> validators;