utils library

Classes

AkoPair<A, B>
AkoPair implements a simple Pair (2 element Tuple)
AkoPlatform
AkoPlatform provides a easy way to find out what the current device platform is.

Enums

AkoResponsiveDevice
AkoResponsiveDevice is an Enum that can be used to identify a width.
Any width from 0 to 480 is considered to be mobile.
Any width from 481 to 1024 is considered to be tablet.
Any width from 1025 to infinity is considered to be desktop.
All numbers above are inclusive.

Functions

fetchJsonAsOptional<T>({required FetchJsonParser fromJson, required FetchFunction fetch}) Future<Optional<T>>
fetchJsonAsOptional is a helper for fetching and parsing JSON data.
tryOptionalOrElse<T>(TryOptionalFutureFunction<T> future, {Optional<T> elseValue = const Optional.empty()}) Future<Optional<T>>
tryOptionalOrElse allows to get an elseValue when a optional future throws an error.
tryOrElse<T>(TryFutureFunction<T> future, {Optional<T> elseValue = const Optional.empty()}) Future<Optional<T>>
tryOrElse allows to get an elseValue when a future throws an error.

Typedefs

AkoErrorBuilder = Widget Function(Object error, StackTrace? stacktrace)
AkoFutureBuilder<T> = Widget Function(T data)
FetchFunction = Future<Map<String, dynamic>> Function()
FetchJsonParser<T> = T Function(Map<String, dynamic>)
TryFutureFunction<T> = Future<T> Function()
TryOptionalFutureFunction<T> = Future<Optional<T>> Function()