verifiedString method

String? verifiedString(
  1. String? value, {
  2. bool url = false,
  3. bool counterRef = false,
  4. bool objectRef = false,
})

Implementation

String? verifiedString(
  String? value, {
  bool url = false,
  bool counterRef = false,
  bool objectRef = false,
}) {
  if (value == null) return null;
  if (value.isEmpty) return null;
  if (url && !value.startsWith("https://")) return null;
  if (counterRef && !value.startsWith("#")) return null;
  if (objectRef && !value.startsWith("@")) return null;
  return value;
}