flutter_helper_utils
library
Classes
-
AsyncPaginator<T>
-
An asynchronous paginator that fetches pages using a provided fetchPage function.
-
BasePaginator<T>
-
Base class for paginators that provides shared logic, debouncing, and disposal checks.
-
Bidi
-
This provides utility methods for working with bidirectional text. All
of the methods are static, and are organized into a class primarily to
group them together for documentation and discoverability.
-
BidiFormatter
-
Bidi stands for Bi-directional text. According to
Wikipedia:
Bi-directional text is text containing text in both text directionalities,
both right-to-left (RTL) and left-to-right (LTR). It generally involves text
containing different types of alphabets, but may also refer to
boustrophedon, which is changing text directionality in each row.
-
BoolNotifier
-
allows to quickly create a ValueNotifier of type bool.
-
Breakpoint
-
Base class for defining breakpoints.
-
BreakpointLayoutBuilder
-
-
BrightnessNotifier
-
-
ColorNotifier
-
allows to quickly create a ValueNotifier of type Color.
-
ConvertObject
-
A utility class for converting objects to different types.
-
CountrySearchService
-
A service class that performs country searches based on a query string.
-
DateFormat
-
DateFormat is for formatting and parsing dates in a locale-sensitive
manner.
-
DatesHelper
-
-
DateTimeNotifier
-
create a ValueNotifier of type DateTime, which reacts just like normal DateTime,
but with notifier capabilities.
-
Debouncer
-
A versatile debouncer that helps consolidate rapid events by scheduling actions to run after a delay.
It features immediate execution, max-wait thresholds, pause/resume support, and reset functionality.
-
DebouncerState
-
An immutable snapshot of a debouncer's state.
-
DHUCountry
-
A class representing country information including names, codes, region, and other details.
-
DHUTimezone
-
A dart helper util class representing timezone information including the timezone name,
raw offset, abbreviation, and daylight saving time (DST) offset.
-
DoubleNotifier
-
allows to quickly create a ValueNotifier of type double.
-
DoublyLinkedList<E>
-
A doubly linked list implementation in Dart.
-
DoublyLinkedListNotifier<E>
-
-
DurationNotifier
-
create a ValueNotifier of type Duration, which reacts just like normal Duration,
but with notifier capabilities.
-
GradientWidget
-
A GradientWidget applies a gradient effect to its child widget
and offers extensive customization options for blending, alignment,
and opacity.
-
InfinitePaginator<T, C>
-
An infinite paginator that supports continuous loading of items.
-
Intl
-
The Intl class provides a common entry point for internationalization
related tasks. An Intl instance can be created for a particular locale
and used to create a date format via
anIntl.date()
. Static methods
on this class are also used in message formatting.
-
IntNotifier
-
allows to quickly create a ValueNotifier of type int.
-
IPaginator<T>
-
Basic interface that any paginator should implement.
-
ListenablesBuilder
-
ListenablesBuilder
-
ListNotifier<E>
-
create a ValueNotifier of type List, which reacts just like normal List,
but with notifier capabilities.
-
LRUCache<K, V>
-
A generic Least Recently Used (LRU) cache to store computed values (e.g. bigrams).
-
MapNotifier<K, V>
-
create a ValueNotifier of type Map, which reacts just like normal Map,
but with notifier capabilities.
-
MultiTapDetector
-
A widget that detects multiple taps on its child within a specified duration.
-
Node<E>
-
A node in a doubly linked list.
-
NumberFormat
-
Provides the ability to format a number in a locale-specific way.
-
NumbersHelper
-
A utility class for numerical helper methods.
-
NumNotifier
-
allows to quickly create a ValueNotifier of type num.
allows to quickly create a ValueNotifier of type num.
-
Configuration that allows tweaking retry logic, caching, and other pagination behaviors.
-
A generic "cursor" used for cursor-based pagination.
-
Paginator<T>
-
Synchronous, in-memory paginator that paginates a provided list of items.
-
PausableStream<T>
-
-
PlatformEnv
-
A platform-independent class providing information about the operating system,
with web compatibility considerations.
-
PlatformInfoLayoutBuilder
-
-
PlatformSizeInfo
-
Provides information about the current platform size and orientation.
-
PlatformTypeProvider
-
A widget that provides the current Breakpoint and Orientation to its descendants.
Wrap this around the root of your application to make platform and orientation information
available throughout the widget tree.
-
RenderSingleAxisWrap
-
The RenderObject that performs the “all or nothing” layout. It first attempts to lay
out the children in the preferredDirection (for example, horizontally) by summing up
their sizes plus the spacing. If that total exceeds the corresponding constraint, it
re-lays them out in the alternate direction.
-
SetNotifier<E>
-
create a ValueNotifier of type Set, which reacts just like normal Set,
but with notifier capabilities.
-
SingleAxisWrap
-
A widget that lays out its children either all in a row or all in a column,
depending on whether they fit in the preferred (main) direction. For example,
if preferredDirection is horizontal and the total width of the children plus
spacing is within the parent’s maxWidth, then the children are arranged as a Row.
Otherwise they are arranged as a Column. (The reverse applies when preferredDirection
is vertical.)
-
SingleAxisWrapParentData
-
ParentData for RenderSingleAxisWrap.
-
StringNotifier
-
allows to quickly create a ValueNotifier of type String.
-
StringSimilarity
-
Main utility class for string similarity calculations, reporting, and batch processing.
-
StringSimilarityBuilder
-
Builder for StringSimilarityConfig.
-
StringSimilarityConfig
-
Configuration class for string similarity operations.
-
ThemeModeNotifier
-
-
ThemeWithoutEffects
-
A widget that optionally removes various visual feedback effects from its child subtree.
-
TimeUtils
-
A utility class that provides helper methods for working with time.
-
TypedListView<E>
-
A type-safe ListView that allows for easy customization with headers,
footers, separators, and pagination.
-
UriNotifier
-
create a ValueNotifier of type Uri, which reacts just like normal Uri,
but with notifier capabilities.
Enums
-
PageState
-
Describes the current loading state of a page.
-
RoundingMode
-
An enum representing the rounding mode used to compute the current item index.
-
SimilarityAlgorithm
-
Supported similarity algorithms for string comparison.
Mixins
-
Mixin that provides analytics tracking for pagination operations.
Functions
-
edgeInsetsFlexible({double? all, double? horizontal, double? vertical, double? top, double? bottom, double? left, double? right})
→ EdgeInsets
-
-
getBreakpoint(Size size, List<Breakpoint> breakpoints)
→ Breakpoint
-
-
getRawCountriesData()
→ List<Map<String, dynamic>>
-
A list of raw data of countries.
-
getTimezonesList()
→ List<String>
-
List of timezones
-
getTimezonesRawData()
→ Map<String, Map<String, dynamic>>
-
This file contains the raw data of the timezones.
-
isEqual(dynamic a, dynamic b)
→ bool
-
-
isTypePrimitive<T>()
→ bool
-
-
isValuePrimitive(dynamic value)
→ bool
-
Determines whether a given value is of a primitive type for JSON serialization.
-
randomInRange(num min, num max, [int? seed])
→ int
-
Generates a random integer within the specified range.
-
toBigInt(dynamic object, {Object? mapKey, int? listIndex, BigInt? defaultValue})
→ BigInt
-
Converts an object to a BigInt.
mirroring the same static method in the ConvertObject, providing alternative easy less code usage options.
-
toBool(dynamic object, {Object? mapKey, int? listIndex, bool? defaultValue})
→ bool
-
Converts an object to a
bool
.
mirroring the same static method in the ConvertObject, providing alternative easy less code usage options.
-
toDateTime(dynamic object, {dynamic mapKey, int? listIndex, String? format, String? locale, bool autoDetectFormat = false, bool useCurrentLocale = false, bool utc = false, DateTime? defaultValue})
→ DateTime
-
Attempts to convert an object to a
bool
, or returns null
if the object is null
or conversion is not applicable.
mirroring the same static method in the ConvertObject, providing alternative easy less code usage options.
-
toDouble(dynamic object, {Object? mapKey, int? listIndex, String? format, String? locale, double? defaultValue})
→ double
-
Converts an object to a double.
mirroring the same static method in the ConvertObject, providing alternative easy less code usage options.
-
toInt(dynamic object, {Object? mapKey, int? listIndex, String? format, String? locale, int? defaultValue})
→ int
-
Converts an object to an int.
mirroring the same static method in the ConvertObject, providing alternative easy less code usage options.
-
toList<T>(dynamic object, {Object? mapKey, int? listIndex, List<T>? defaultValue})
→ List<T>
-
Converts an object to a List of type
T
.
mirroring the same static method in the ConvertObject, providing alternative easy less code usage options.
-
toMap<K, V>(dynamic object, {Object? mapKey, int? listIndex, Map<K, V>? defaultValue})
→ Map<K, V>
-
Converts an object to a Map with keys of type
K
and values of type V
.
mirroring the same static method in the ConvertObject, providing alternative easy less code usage options.
-
toNum(dynamic object, {Object? mapKey, int? listIndex, String? format, String? locale, num? defaultValue})
→ num
-
Converts an object to a num.
mirroring the same static method in the ConvertObject, providing alternative easy less code usage options.
-
toSet<T>(dynamic object, {Object? mapKey, int? listIndex, Set<T>? defaultValue})
→ Set<T>
-
Converts an object to a Set of type
T
.
mirroring the same static method in the ConvertObject, providing alternative easy less code usage options.
-
toString1(dynamic object, {Object? mapKey, int? listIndex, String? defaultValue})
→ String
-
Converts any object to a string if the object is not
null
.
mirroring the same static method in the ConvertObject, providing alternative easy less code usage options.
-
toType<T>(dynamic object)
→ T
-
Global function that allow Convert an object to a specified type.
-
toUri(dynamic object, {Object? mapKey, int? listIndex, Uri? defaultValue})
→ Uri
-
Converts an object to a Uri.
mirroring the same static method in the ConvertObject, providing alternative easy less code usage options.
-
tryToBigInt(dynamic object, {Object? mapKey, int? listIndex, BigInt? defaultValue})
→ BigInt?
-
Attempts to convert an object to a BigInt, or returns
null
if the object is null
or conversion fails.
mirroring the same static method in the ConvertObject, providing alternative easy less code usage options.
-
tryToBool(dynamic object, {Object? mapKey, int? listIndex, bool? defaultValue})
→ bool?
-
Attempts to convert an object to a
bool
, or returns null
if the object is null
or conversion is not applicable.
mirroring the same static method in the ConvertObject, providing alternative easy less code usage options.
-
tryToDateTime(dynamic object, {dynamic mapKey, int? listIndex, String? format, String? locale, bool autoDetectFormat = false, bool useCurrentLocale = false, bool utc = false, DateTime? defaultValue})
→ DateTime?
-
Attempts to convert an object to a DateTime, or returns
null
if the object is null
or conversion fails.
mirroring the same static method in the ConvertObject, providing alternative easy less code usage options.
-
tryToDouble(dynamic object, {Object? mapKey, int? listIndex, String? format, String? locale, double? defaultValue})
→ double?
-
Attempts to convert an object to a double, or returns
null
if the object is null
or conversion fails.
mirroring the same static method in the ConvertObject, providing alternative easy less code usage options.
-
tryToInt(dynamic object, {Object? mapKey, int? listIndex, String? format, String? locale, int? defaultValue})
→ int?
-
Attempts to convert an object to an int, or returns
null
if the object is null
or conversion fails.
mirroring the same static method in the ConvertObject, providing alternative easy less code usage options.
-
tryToList<T>(dynamic object, {Object? mapKey, int? listIndex, List<T>? defaultValue})
→ List<T>?
-
Attempts to convert an object to a List of type
T
, or returns null
if conversion is not possible.
mirroring the same static method in the ConvertObject, providing alternative easy less code usage options.
-
tryToMap<K, V>(dynamic object, {Object? mapKey, int? listIndex, Map<K, V>? defaultValue})
→ Map<K, V>?
-
Attempts to convert an object to a Map with keys of type
K
and values of type V
.
mirroring the same static method in the ConvertObject, providing alternative easy less code usage options.
-
tryToNum(dynamic object, {Object? mapKey, int? listIndex, String? format, String? locale, num? defaultValue})
→ num?
-
Attempts to convert an object to a num, or returns
null
if the object is null
or conversion fails.
mirroring the same static method in the ConvertObject, providing alternative easy less code usage options.
-
tryToSet<T>(dynamic object, {Object? mapKey, int? listIndex, Set<T>? defaultValue})
→ Set<T>?
-
Attempts to convert an object to a Set of type
T
, or returns null if conversion is not possible.
mirroring the same static method in the ConvertObject, providing alternative easy less code usage options.
-
tryToString(dynamic object, {Object? mapKey, int? listIndex, String? defaultValue})
→ String?
-
Converts any object to a string, or returns
null
if the object is null
.
mirroring the same static method in the ConvertObject, providing alternative easy less code usage options.
-
tryToType<T>(dynamic object)
→ T?
-
Global function that allow Convert an object to a specified type or return null.
-
tryToUri(dynamic object, {Object? mapKey, int? listIndex, Uri? defaultValue})
→ Uri?
-
Attempts to convert an object to a Uri, or returns
null
if the object is null
or conversion fails.
mirroring the same static method in the ConvertObject, providing alternative easy less code usage options.
Typedefs
-
AsyncAction
= FutureOr<void> Function()
-
A function signature for asynchronous actions.
-
Coordinates
= ({double latitude, double longitude})
-
Represents geographical coordinates with latitude and longitude.
For example, (latitude: -20.0, longitude: 30.0).
-
CountrySearchAlgorithm
= List<DHUCountry> Function(List<DHUCountry> countries, String query)
-
A type for country search algorithms that takes a list of countries and a query string,
and returns a filtered list of countries.
-
Currency
= ({String code, String name, String symbol})
-
Represents a currency with its code, name, and symbol.
For example, (code: "USD", name: "United States dollar", symbol: "$").
-
IndexedPredicate<T>
= bool Function(int index, T)
-
A type alias representing a predicate function that takes an index and a value of type
T
and returns a boolean value.
-
Language
= ({String code, String name})
-
Represents a language with its code and name.
For example, (code: "en", name: "English").
-
LoggerFunction
= void Function(String message)
-
A function signature for logging messages.
-
NativeName
= ({String common, String language, String official})
-
Represents a native name of the country in different languages.
For example, (language: "eng", official: "Republic of Zimbabwe", common: "Zimbabwe").
-
OnLayoutDirectionChanged
= void Function(Axis?)
-
-
Predicate<T>
= bool Function(T)
-
A type alias representing a predicate function that takes a value of type
T
and returns a boolean value.
-
TimerFactory
= Timer Function(Duration duration, void callback())
-
A function signature for creating timers.
timerFactory
allows customizing timer creation, useful for testing or
specialized timing behavior. Defaults to standard Timer.new.
-
TypedListViewBuilder<T>
= Widget Function(int index, T item)
-
Exceptions / Errors
-
InvalidConfigurationError
-
Exception for invalid configuration settings related to string similarity.
-
Exception thrown when pagination operations fail.
-
StringSimilarityError
-
Custom exception for string similarity issues.