ObjectExtensions<T extends Object?> extension

on
  • T

Properties

asFlat string

Available on T, provided by the ObjectExtensions extension

Returns flat representation string by calling toString() and removing diacritics, converting to lowercase, and trimming all whitespace.
no setter
isNullable bool

Available on T, provided by the ObjectExtensions extension

no setter

Methods

asBool({bool everythingIsTrue = true}) bool

Available on T, provided by the ObjectExtensions extension

Converts the current object to a boolean value.
asNullableBool({bool everythingIsTrue = true}) bool?

Available on T, provided by the ObjectExtensions extension

Converts the current object to a nullable boolean value.
asNullableText({TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, Locale? locale, bool? softWrap, TextOverflow? overflow, TextScaler? textScaler, int? maxLines, String? semanticsLabel, TextWidthBasis? textWidthBasis, bool validate = true, String? defaultText, string dateFormat = ""}) Text?

Available on T, provided by the ObjectExtensions extension

Converts the object to a nullable Text widget with the specified properties.
asSqlValue([bool nullAsBlank = false, bool quoteStrings = true]) String

Available on T, provided by the ObjectExtensions extension

asText({TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, Locale? locale, bool? softWrap, TextOverflow? overflow, TextScaler? textScaler, int? maxLines, String? semanticsLabel, TextWidthBasis? textWidthBasis, String defaultText = "", bool validate = true}) Text

Available on T, provided by the ObjectExtensions extension

Converts the object to a Text widget with the specified properties.
changeTo<R>() → R

Available on T, provided by the ObjectExtensions extension

Converts a value of type Object to a specified type T.
flatContains<V>(V value) bool

Available on T, provided by the ObjectExtensions extension

Checks if the current string contains the given value when both are flattened. If the current string is blank, it returns true only if the value is also blank. If the value is blank, it returns true. Otherwise, it checks if the current string contains the value when both are flattened. Returns true if the current string contains the value, false otherwise.
flatContainsAny<V>(Iterable<V> values) bool

Available on T, provided by the ObjectExtensions extension

Checks if the string contains any of the specified texts.
flatEqual<V>(V value) bool

Available on T, provided by the ObjectExtensions extension

Checks if the current string is equal to the given value when both are flattened. Returns true if they are equal, false otherwise.
flatEqualAny<V>(Iterable<V> values) bool

Available on T, provided by the ObjectExtensions extension

Checks if any of the strings in the given values iterable is equal to the current string. Returns true if any string is equal, otherwise returns false.
isIn(dynamic items) bool

Available on T, provided by the ObjectExtensions extension

Checks if the current object is present in the given list, map or string. Returns true if the current object is not null and is present in the list, otherwise returns false.
isNotIn(dynamic items) bool

Available on T, provided by the ObjectExtensions extension

isNotValid([List<bool> customValidator(T?)?]) bool

Available on T, provided by the ObjectExtensions extension

Checks if object has a invalid value. See isValid for more details.
isValid([List<bool> customValidator(T?)?]) bool

Available on T, provided by the ObjectExtensions extension

Checks if Object has a valid value.
keywordContainsAny(Iterable<T> value, {bool forceLowerCase = true, bool removeDiacritics = true, bool removeWordSplitters = true, bool splitCamelCase = true}) bool

Available on T, provided by the ObjectExtensions extension

keywordEqual(T value, {bool forceLowerCase = true, bool removeDiacritics = true, bool removeWordSplitters = true, bool splitCamelCase = true}) bool

Available on T, provided by the ObjectExtensions extension

nullIf(bool test(T)) → T?

Available on T, provided by the ObjectExtensions extension

nullIfBool(bool value) → T?

Available on T, provided by the ObjectExtensions extension

nullIfValue(T value) → T?

Available on T, provided by the ObjectExtensions extension

valid(List<bool> validations(T?)?, [string? throwErrorMessage]) → T?

Available on T, provided by the ObjectExtensions extension