DynamoCommons class

Constructors

DynamoCommons()

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 Properties

specialCharUnicodeMap Map<String, String>
getter/setter pair

Static Methods

asciiTag(String ch) int
get the ASCII value of a character
calculateCharactersThatFit(String text, double containerWidth, TextStyle textStyle) int
does a calculation to determine a Text widget height.
decodeUnicodeCharacters(String messageText) String
Replaces unicode characters with their corresponding special characters.
deleteFile(String filePath) Future<void>
delete file with path filePath.
encodeSpecialCharacters(String inputString) String
Replaces special characters with their unicode values.
getAsBool(String boolStr) bool
Get string as bool
getEnumStringValue(String enumStr) String
get enum field simple name
getFormattedAmount(String moneyStr) String
formats the decimal part of a floating point number
getIntegerFormatted(double amount) String
17500 =>> 17,500
getMoneyFormat(double amount, {bool removeZeroFraction = false}) String
17500 =>> 17,500.00
getPersonSet(int personCount) String
returns 'Person' if personCount is 1 otherwise it returns 'People'.
getSimilarity(String a, String b) double
calculate the similarity between the two strings a and b
getTextByLimitedLength(String? inputText, {int limitLength = 0}) String
trim inputText from the right to fit the length of limitLength.
getUnqualifiedEmailName(String emailAddress) String
strips off the domain name part of an email'.
hasCapitalLetter(String inputString) bool
check if String has a capital letter
hasNonZeroDigit(String digitSequence) bool
check if the string has a non-zero digit
isAlpha(String char) bool
check if character is an alphabet
isAlphaNum(String char) bool
check if character is an alphabet or number
isAlphaNumeric(String inputStr) bool
check if the inputStr is alpha-numeric
isAlphaNumericWithADot(String inputStr) bool
check if the inputStr is alpha-numeric with a single dot occurence
isAlphaNumericWithNonB2BDots(String inputStr) bool
is alpha-numeric String? with Non-back-to-back dot sequence example: lenon..traxo
isCapitalLetter(String char) bool
check if character is a capital letter
isDesktop(BuildContext context) bool
desktop >= 1100
isDigit(String char) bool
check if character is a number
isDigitSequence(String inputStr) bool
check if the inputStr is a digit sequence
isDigitSequenceWithADot(String inputStr) bool
check if the inputStr is a digit sequence with a single dot
isDigitSequenceWithDots(String inputStr) bool
check if the inputStr is a digit sequence with more than one dot
isEmailFormat(String? emailAddress) bool
checks if an email address is correctly formatted.
isEnterKey(String char) bool
check if character matches carriage return
isMobile(BuildContext context) bool
checks if a screen size is mobile.
isNumber(String inputStr) bool
check if the inputStr is a number
isSessionLostMessage(String errorMessage) bool
isSpace(String char) bool
check if character is a whaite space
isTablet(BuildContext context) bool
tablet >= 650
levenshtein(String a, String b) int
max(int x, int y) int
min(int x, int y) int
padString(String inputStr, String padString, int padLength, PadDirectionType directionType) String
pads the input text inputStr with the pad string padString, in the direction provided by directionType, until the padded string equals padLength.
parseStringToMap(String inputString) Map<String, dynamic>
A simple parser method that returns a specific definition of a map object: inputString = {key1=value1, key2=value2, ..., keyN=valueN}
readFileByte(String filePath) Future<Uint8List>
read the byte array of the file with path filePath.
removeLeading(String inputString, String leading) String
continuously remove the first character of the string inputString if it starts with the character held by leading.
showSimpleFileName(String fileName) String
strips off the nase URL leaving only the simple file name.
skipSpace(String inputString, int index) int
skip whitespace character in a character sequence.
unformatMoneyValue(String moneyStr) String
remove money-type formatting from a string before converting it to a number