StringExtension extension
- on
Properties
- asBool → bool
-
Available on String?, provided by the StringExtension extension
Returns true if the validate() method returns 'true', otherwise returns false.no setter - isApk → bool
-
Available on String?, provided by the StringExtension extension
Document regexno setter - isAudio → bool
-
Available on String?, provided by the StringExtension extension
Audio regexno setter - isDoc → bool
-
Available on String?, provided by the StringExtension extension
Document regexno setter - isEmptyOrNull → bool
-
Available on String?, provided by the StringExtension extension
Returns true if given String is null or isEmptyno setter - isExcel → bool
-
Available on String?, provided by the StringExtension extension
Excel regexno setter - isHtml → bool
-
Available on String?, provided by the StringExtension extension
HTML regexno setter - isImage → bool
-
Available on String?, provided by the StringExtension extension
Image regexno setter - isInt → bool
-
Available on String?, provided by the StringExtension extension
no setter - isNotBlank → bool
-
Available on String?, provided by the StringExtension extension
Returns true if this String is not null and contains at least one non-whitespace character.no setter - isNullOrBlank → bool
-
Available on String?, provided by the StringExtension extension
Returns true if this String is null, empty or consists of only whitespace characters.no setter - isPdf → bool
-
Available on String?, provided by the StringExtension extension
PDF regexno setter - isPPT → bool
-
Available on String?, provided by the StringExtension extension
PPT regexno setter - isTxt → bool
-
Available on String?, provided by the StringExtension extension
Txt regexno setter - isVideo → bool
-
Available on String?, provided by the StringExtension extension
Video regexno setter - renderHtml → String
-
Available on String?, provided by the StringExtension extension
Render a HTML Stringno setter - reverse → String
-
Available on String?, provided by the StringExtension extension
It reverses the Stringno setter
Methods
-
calculateReadTime(
{int wordsPerMinute = 200}) → double -
Available on String?, provided by the StringExtension extension
Return average read time duration of given String in seconds -
capitalizeEachWord(
) → String -
Available on String?, provided by the StringExtension extension
This function returns given string with each word capital -
capitalizeFirstLetter(
) → String -
Available on String?, provided by the StringExtension extension
Capitalize given String -
convertYouTubeUrlToId(
{bool trimWhitespaces = true}) → String -
Available on String?, provided by the StringExtension extension
Get YouTube Video ID -
copyToClipboard(
) → Future< void> -
Available on String?, provided by the StringExtension extension
-
countWords(
) → int -
Available on String?, provided by the StringExtension extension
Return number of words ina given String -
ellipsize(
int maxLength, {String ellipsis = "..."}) → String -
Available on String?, provided by the StringExtension extension
Truncates this String to a specifiedmaxLengthand appends anellipsisstring. Example: "This is a long string".ellipsize(10) returns "This is a..." -
equalsIgnoreCase(
String? other) → bool -
Available on String?, provided by the StringExtension extension
Compares this String to another String, ignoring case considerations. -
formatNumberWithComma(
{String seperator = ','}) → String -
Available on String?, provided by the StringExtension extension
for ex. add comma in price -
getBoolInt(
) → bool -
Available on String?, provided by the StringExtension extension
Returns true if given value is '1', else returns false -
getNumericOnly(
{bool aFirstWordOnly = false}) → String -
Available on String?, provided by the StringExtension extension
Returns only numbers from a string trim Whitespaces -
getYouTubeThumbnail(
{bool trimWhitespaces = true}) → String -
Available on String?, provided by the StringExtension extension
Returns YouTube thumbnail for given video id -
initials(
) → String -
Available on String?, provided by the StringExtension extension
Extracts initials from a string. Example: "John Doe" returns "JD". -
isAlpha(
) → bool -
Available on String?, provided by the StringExtension extension
Check weather String is alpha or not -
isDigit(
) → bool -
Available on String?, provided by the StringExtension extension
Return true if given String is Digit -
isJson(
) → bool -
Available on String?, provided by the StringExtension extension
-
mask(
{MaskType maskType = MaskType.auto, bool? isMaskingEnabled}) → String -
Available on String?, provided by the StringExtension extension
helper function to mask email and phone strings. -
maskEmail(
{bool? isMaskingEnabled}) → String -
Available on String?, provided by the StringExtension extension
Mask email (e.g., user@example.com -> u***@example.com) -
maskPhone(
{bool? isMaskingEnabled}) → String -
Available on String?, provided by the StringExtension extension
Mask phone (e.g., 1234567890 -> 12****7890) -
prefixText(
{required String value}) → String -
Available on String?, provided by the StringExtension extension
eg. Text("Dr. ${VARIABLE_NAME}"); => Text("VARIABLE_NAME.prefixText("Dr.")"); -
removeAllWhiteSpace(
) → String -
Available on String?, provided by the StringExtension extension
Removes white space from given String -
repeat(
int n, {String separator = ''}) → String -
Available on String?, provided by the StringExtension extension
Returns the given string n times -
setSearchParam(
) → List< String> -
Available on String?, provided by the StringExtension extension
returns searchable array for Firebase Database -
splitAfter(
Pattern pattern) → String -
Available on String?, provided by the StringExtension extension
Splits from apatternand returns remaining String after that -
splitBefore(
Pattern pattern) → String -
Available on String?, provided by the StringExtension extension
Splits from apatternand returns String before that -
splitBetween(
Pattern startPattern, Pattern endPattern) → String -
Available on String?, provided by the StringExtension extension
It matches the String and returns betweenstartPatternandendPattern -
suffixText(
{required String value}) → String -
Available on String?, provided by the StringExtension extension
eg. Text("${VARIABLE_NAME} /-"); => Text("VARIABLE_NAME.suffixText("/-")"); -
toastString(
) → void -
Available on String?, provided by the StringExtension extension
toast a String -
toBool(
) → bool -
Available on String?, provided by the StringExtension extension
Returns true if the validate() method returns 'true', otherwise returns false. -
toCamelCase(
) → String -
Available on String?, provided by the StringExtension extension
Converts this String to camel case. Example: "hello world" or "hello_world" or "hello-world" becomes "helloWorld". -
toColor(
{Color? defaultColor}) → Color -
Available on String?, provided by the StringExtension extension
Get Color from HEX String -
toDouble(
{double defaultValue = 0.0}) → double -
Available on String?, provided by the StringExtension extension
Return double value of given string -
toInt(
{int defaultValue = 0}) → int -
Available on String?, provided by the StringExtension extension
Return int value of given string -
toKebabCase(
) → String -
Available on String?, provided by the StringExtension extension
Converts this String to kebab-case. Example: "helloWorld" or "Hello World" becomes "hello-kebab". -
toList(
) → List< String> -
Available on String?, provided by the StringExtension extension
It return list of single character from String -
toPascalCase(
) → String -
Available on String?, provided by the StringExtension extension
Converts this String to PascalCase. Example: "hello world" or "hello_world" becomes "HelloWorld". -
toSlug(
{String delimiter = '_'}) → String -
Available on String?, provided by the StringExtension extension
Generate slug of a given String -
toSnakeCase(
) → String -
Available on String?, provided by the StringExtension extension
Converts this String to snake_case. Example: "helloWorld" or "Hello World" becomes "hello_world". -
toYouTubeId(
{bool trimWhitespaces = true}) → String -
Available on String?, provided by the StringExtension extension
Get YouTube Video ID -
validate(
{String value = ''}) → String -
Available on String?, provided by the StringExtension extension
-
validateEmail(
) → bool -
Available on String?, provided by the StringExtension extension
Check email validation -
validateEmailEnhanced(
) → bool -
Available on String?, provided by the StringExtension extension
Check email validation -
validatePhone(
) → bool -
Available on String?, provided by the StringExtension extension
Check phone validation -
validateURL(
) → bool -
Available on String?, provided by the StringExtension extension
Check URL validation