global
library
Classes
-
FilterFunctions
-
A mixin that provides various filter functions for searching and filtering data.
Functions
-
categoryIcon(String category)
→ IconData
-
Returns the IconData associated with the given app
category
.
-
changeTo<R>(dynamic value, [String? locale])
→ R
-
Try change a value of any type into a value of type
R
.
-
consoleLog<T>(T message, {DateTime? time, int? sequenceNumber, int level = 0, String name = '', Zone? zone, Object? error, StackTrace? stackTrace})
→ T
-
Logs a object to the console if the app is running in debug mode.
-
flatString(dynamic value)
→ String
-
Converts a dynamic value to a flat string representation.
-
forceList(dynamic item)
→ List
-
Ensure the given
item
is a List.
-
forceListOf<T>(dynamic item)
→ List<T>
-
Ensure the given
item
is a List of type T
.
-
forceRecursiveList(dynamic item)
→ List
-
Ensure the given
item
is a List.
-
forceRecursiveListOf<T>(dynamic item)
→ List<T>
-
-
forceRecursiveSet(dynamic item)
→ Set
-
-
forceRecursiveSetOf<T>(dynamic item)
→ Set<T>
-
-
forceSet(dynamic item)
→ Set
-
Converts a dynamic value to a Set.
-
forceSetOf<T>(dynamic item)
→ Set<T>
-
Converts a dynamic value to a Set of type
T
.
-
forceWidget(dynamic item, {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, BoxFit? fit, AlignmentGeometry? alignment, ResponsiveColumn? columnSizes})
→ Widget?
-
A utility extension method that allows forcing a widget to be returned,
with optional customization of its properties.
-
generateKeyword(dynamic value, {bool splitCamelCase = true, bool removeWordSplitters = true, bool removeDiacritics = true, bool forceLowerCase = true})
→ String
-
Generates a keyword from the given
value
.
-
getBreakpointValue<V extends Comparable, T>(V value, Map<V, T> breakpoints)
→ T
-
Returns the value associated with the highest breakpoint that is less than or equal to the given
value
.
-
identArrow({required int length, String pattern = " "})
→ String
-
Generates a arrow or ident string with a specified length and pattern.
-
innerLibsInit()
→ Future<void>
-
Initializes the inner libraries.
-
isNotValid<T>(T object, {Iterable<bool> customValidator(T?)?})
→ bool
-
Checks if the given
object
is not valid (see isValid function).
-
isNullable<T>()
→ bool
-
Checks if the types
T
is nullable (equal T?)
-
isSameType<T, S>()
→ bool
-
Checks if the types
T
and S
are equal. Ignore nullability.
-
isValid<T>(T? object, {Iterable<bool> customValidator(T?)?})
→ bool
-
Checks if
object
has a valid value.
-
randomBool()
→ bool
-
-
randomBoolWithFactor([int trueFactor = 50])
→ bool
-
Generates a random boolean value based on the specified
trueFactor
.
The trueFactor
is a percentage value between 1 and 100 that determines the likelihood of the boolean being true.
-
randomDouble([double min = 0, double max = 999999])
→ double
-
Generates a random double between the specified
min
and max
values.
-
randomInt([int min = 0, int max = 999999])
→ int
-
Generates a random integer between the specified
min
and max
values.
-
randomPercent([int min = 0, int max = 100])
→ double
-
Generates a random double between the specified
min
and max
percent values.
-
randomString([int length = 10])
→ String
-
Generates a random string of the specified
length
.
The generated string consists of random alphanumeric and special characters.
-
randomWord([int length = 0])
→ String
-
Generates a random string of the specified
length
.
If the length
is not provided, a random length between 2 and 15 is used.
The generated string consists of random consonants and vowels in a pronounceable order.
-
sizeFromAspect({required String aspectRatio, double? width, double? height})
→ Size
-
Calculates the size based on the aspect ratio and optional width and height.
-
typeOf<T>()
→ Type
-
Returns the type of
T
.
-
valid<T>(T value, List<bool> validations(T?)?, [string? throwErrorMessage])
→ T?
-
Validates a value of type
T
using a list of validation functions.
The value
is considered valid if at least one of the validation functions returns true
.
If the value is valid, it is returned; otherwise, null
is returned.