StringUtils class

Constructors

StringUtils()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

capitalizeFirstLetter(String input) → String
Capitalizes the first letter of the given string. Returns the original string if it's empty.
formatDob(String raw) → String
Normalizes a DOB string from any upstream source (DigiLocker sends unpadded "10-9-2026" or "2026-9-10") into the "dd/mm/yyyy" format the date picker produces, so prefilled and picked values look consistent.
isDobField(String? name, List<String>? regexPatterns) → bool
True when the pii field is a date of birth, so it should get a date picker instead of free text. Matched either by label name (e.g. "DOB", "Date of Birth") or by the API's regex_pattern looking date-shaped (dd-mm-yyyy), since the label alone isn't always reliable.
stripCountryCode(String? name, String value) → String
Undoes the "+91" prefix a value may already carry, for a field that renders its own separate "+91" chip. For a phone label that stops it showing twice; for any other label ("+91user@mail.com") the prefix is junk a caller attached, and is dropped rather than displayed or sent.
stripStrayCountryCode(String value) → String
Drops a "+91" that can't belong to the value, judged on shape alone — used before the pii label names are known. What follows a real country code is all digits, so "+91user@mail.com" is stripped while "+919891737651" is left intact.
styleTableHeaders(String html, {String? bgColor, String? textColor}) → String
Applies table header colours to <th> tags in html. The colours are appended to each tag's inline style because inline styles beat HtmlWidget.customStylesBuilder, and the API's own th styles would win.
validateLabelName(String name) → bool
True when the pii label names a phone-like identity, so the field gets a "+91" chip and its value the matching prefix. Matched case-insensitively — labels come from customer configuration ("Mobile Number", "phone no").
withCountryCode(String? name, String value) → String
Adds the "+91" prefix to a phone value that doesn't already have it.
withCountryCodeByShape(String value) → String
Prefixes "+91" using only the shape of the value, for the case where the PII label name isn't known yet (the first display call goes out before the form config that names the identity types comes back). Anything that doesn't look like a bare Indian mobile is left untouched.

Constants

keywords → const List<String>