after function

String after (
  1. DateTime fieldValue,
  2. DateTime checkValue,
  3. {String message}
)

Contains standard validators which can be attached to an input field.

validators: [ (v) => NotNull(v), (v) => Min(v, 6, message: 'Must be at least 6' ) ],

Each validator returns null if there is no error. Otherwise it returns an error message which can be individually set with parameter message.

Validates that fieldValue (DateTime) is after checkValue.

Returns null if fieldValue > checkValue else an error message

Implementation

/// Validates that [fieldValue] (DateTime) is after [checkValue].
///
/// Returns `null` if [fieldValue] > [checkValue] else an error message
String after(
  DateTime fieldValue,
  DateTime checkValue, {
  String message,
}) {
  assert(checkValue != null);
  if ((fieldValue == null) || (fieldValue.isAfter(checkValue))) {
    return null;
  }
  return message ?? 'Please enter a value in the future of $checkValue';
}