endsWith<E> static method

Rule<String, E> endsWith<E>(
  1. String suffix, {
  2. required E error,
})

Validates that the string ends with suffix.

StringRules.endsWith('.com', error: 'Must end with .com')

Implementation

static Rule<String, E> endsWith<E>(String suffix, {required E error}) =>
    PredicateRule(predicate: (value) => value.endsWith(suffix), error: error);