DateBefore.fromString constructor
Creates a new instance of the DateBefore validation rule from a string representation.
dateStr
: The date string to parse and compare against.format
: The format of the date string (default is 'yyyy-MM-dd').message
: A custom validation message (optional) to be displayed when the validation fails.
Implementation
DateBefore.fromString(String dateStr,
{String? format = 'yyyy-MM-dd', String? message})
: date = DateFormat(format).parse(dateStr),
super(message);