isLinkedInProfile method

FieldValidator<String?, String?> isLinkedInProfile({
  1. MessageCallBack<String>? message,
  2. String? permalink,
})

Check string is linkedin profile url

Implementation

FieldValidator<String?, String?> isLinkedInProfile({
  MessageCallBack<String>? message,
  String? permalink,
}) {
  return next((messages, value) {
    if (value != null && !value.isLinkedInProfile(permalink: permalink)) {
      return message?.call(messages, value) ??
          messages.invalidLinkedInProfileUrl(permalink ?? 'empty');
    }
    return null;
  });
}