RegexModel.url constructor

RegexModel.url({
  1. String? title,
})

An http or https address with a domain, e.g. https://monsware.com.

Implementation

factory RegexModel.url({String? title}) => RegexModel(
  title: title ?? RegexLabels.current.url,
  test: (value) {
    final uri = Uri.tryParse(value.trim());
    return uri != null &&
        (uri.scheme == 'http' || uri.scheme == 'https') &&
        uri.host.contains('.');
  },
);