endsWith static method
Validates that the input ends with a given string.
Implementation
static String? Function(String) endsWith(String suffix, {String? message}) {
final schema = string().endsWith(
suffix,
message: message ?? 'Must end with "$suffix".',
);
return (value) {
if (value.trim().isEmpty) return null;
return _validate(schema, value);
};
}