RegexModel.endsWith constructor

RegexModel.endsWith(
  1. String text, {
  2. bool ignoreCase = true,
  3. String? title,
})

Ends with text, e.g. endsWith('@company.com').

Implementation

factory RegexModel.endsWith(
  String text, {
  bool ignoreCase = true,
  String? title,
}) => RegexModel(
  title: title ?? RegexLabels.current.endsWith(text),
  test: (value) => ignoreCase
      ? value.toLowerCase().endsWith(text.toLowerCase())
      : value.endsWith(text),
);