TextUtils class

Constructors

TextUtils()

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

equals(String a, String b) bool
isEmpty(String? text) bool
isNotEmpty(String? text) bool
toHumanReadableByteCount(int bytes, {bool binarySystem = true, bool rightNotation = false, int decimals = 2}) String
@param bytes the amount of bytes to convert @param binarySystem true means to convert using Binary System (divide by 1024), false means International System (divide by 1000) @param rightNotation true means to show KiB, MiB, GiB, etc if system is false. false means to show kB, MB, GB, etc whatever value system is. @param decimals amount of decimals after float point @return
toHumanReadableDistanceCount(double distance, {bool advanced = false, Locale? locale, int decimals = 2}) String
@param distance: distance in meters @param advanced: true indicates distance from millimeters to kilometers, otherwise indicates distance in meters or kilometers depending on the distance; only for metric system @param locale: indicates the user locale to get the proper unit system: metric or imperial system @param decimals: amount of decimals after float point @return formatted: distance as String
toHumanReadableSpeedCount(double speed, int time, {Locale? locale, int decimals = 2}) String
The formula is speed m/time where the speed should be in meters and time is specified in seconds base for instance: to indicate 1000 m/seconds the call should be (1000, 1) to indicate 1000 m/minute the call should be (1000, 60) to indicate 1000 m/hour the call should be (1000, 3600) @param speed: in meters @param time: in seconds has to be 1s or 60s or 3600s; that indicates seconds, minute, hour @param locale: indicates the user locale to get the proper unit system: metric or imperial system @param decimals: amount of decimals after float point @return formatted: speed in km/h or mi/h according to metric as String
toHumanReadableTimeCount(int timeMillis) String
@param timeMillis the amount of time to convert in milliseconds @param decimals amount of decimals after float point when showing days, weeks, months and years @return