micha_core library
Classes
-
AsyncBuilder<
T> - BodyLargeLocator
- BodyMediumLocator
- BodySmallLocator
- CurrentPageLabel
- DisplayLargeLocator
- DisplayMediumLocator
- DisplaySmallLocator
- Gap
- GapThemeData
- HeadlineLargeLocator
- HeadlineMediumLocator
- HeadlineSmallLocator
- JumpToNextPage
- JumpToNumberedPage
- JumpToPreviousPage
- LabelLargeLocator
- LabelMediumLocator
- LabelSmallLocator
- Link
- LinkThemeData
-
Paginated<
T> -
Pagination<
T> -
PaginationController<
T> -
PaginationControls<
T> - PaginationThemeData
-
RateLimiter<
T> - Limits the execution rate of asynchronous operations.
- Spinner
- SpinnerThemeData
- TextStyleLocator
- ThemedText
- Avoid accessing ThemeData to apply styles. Call one of the named constructors of StyledText instad.
- TitleLargeLocator
- TitleMediumLocator
- TitleSmallLocator
-
Wrapper<
T>
Enums
- SgrCode
-
Select Graphic Rendition, applied in format:
CSI n m
Extensions
- AnsiFormatting on String
- String formatting methods using ANSI escape sequences. Primarily useful for logging to consoles. Bright colors are not included, because they are not supported by all terminals.
-
ByNameOrNull
on Iterable<
T> - Clamp on Duration
- IterableNullWhenEmpty on TIterable
-
IterableSeparated
on Iterable<
T> -
IterableSplit
on Iterable<
T> -
ListSeparated
on List<
T> - Functions are identical to those of IterableSeparated. Results are converted to lists, so the original list is not modified.
-
ListSplit
on List<
T> - Functions are identical to those of IterableSplit. Results are converted to lists, so the original list is not modified.
- MapNullWhenEmpty on TMap
- StringNullWhenEmpty on String
- Times on int
- Transform on TOrigin
- Wrapped on T
Constants
- ansiEscape → const String
- ANSI escape character, indicating the beginning of an ANSI escape sequence
- controlSequenceIntroducer → const String
Functions
-
createExponentialBackoff(
{Duration initialDelay = const Duration(seconds: 1), Duration maxDelay = const Duration(seconds: 30)}) → RetryStrategy -
Returns a function to calculate a delay that exponentially increases with each attempt.
The delay starts at
initialDelayand exponentially doubles untilmaxDelayis reached. -
createLogger(
Type t) → Logger -
Recommended way to create a new
Loggerfor a given type. -
createNamedLogger(
String name) → Logger -
Create a new
Loggerfor a given name. Not recommended. Use createLogger instead, if possible. -
initLogging(
{Level projectLogLevel = Level.ALL, Level dependenciesLogLevel = Level.WARNING}) → void - Initialize logging. Should be called before runApp, if logging is used.
-
retried<
T, TException extends Object> (FutureOr< T> operation(), {int? maxAttemptCount = 3, RetryStrategy? strategy, bool shouldRetry(TException exception)?, Future<void> waitForDuration(Duration duration) = Future<void>.delayed}) → Future<T> -
Retries a given
operationuntil it succeeds and forwards the return value. A call is attempted at least once and at mostmaxAttemptCounttimes. -
waitFor(
FutureOr< bool> condition(), {Duration? timeout, Duration interval = const Duration(milliseconds: 200), DateTime nowProvider() = DateTime.now, Future<void> waitForDuration(Duration duration) = Future<void>.delayed}) → Future<void> -
Repeatedly calls and waits until
conditionreturns true.
Typedefs
-
BuilderCallback<
T> = Widget Function(BuildContext context, T data) - RetryStrategy = Duration Function(int attemptCount)
-
TimesCallback<
T> = T Function(int index)
Exceptions / Errors
- RetryException
- Can be thrown with a custom delay that overrides the strategy in retried.