required static method

String? required(
  1. String? value, {
  2. String? message,
})

Check if any value is entered.

Implementation

static String? required(String? value, {String? message}) => value == null || value.isNotEmpty ? null : message ?? 'This field is required';