utils library

Classes

DisposableController
Base class for controllers that need to manage their lifecycle.
Disposer
ImmediateValueNotifier<T>
A value notifier that calls each listener immediately when registered.
ImmutableList<T>
Wrapper for a list that prevents any modification of the list's content.
ListValueNotifier<T>
A ChangeNotifier that holds a list of data.

Mixins

AutoDisposeControllerMixin
Mixin to simplifying managing the lifetime of listeners used by a DisposableController.
AutoDisposeMixin<T extends StatefulWidget>
Mixin to simplifying managing the lifetime of listeners used by a StatefulWidget.
DisposerMixin
Provides functionality to simplify listening to streams and ValueNotifiers, and disposing FocusNodes.

Constants

defaultEpsilon → const double
A small double value, used to ensure that comparisons between double are valid.
tooltipWait → const Duration
tooltipWaitLong → const Duration

Properties

globals Map<Type, Object>
final

Functions

degToRad(num deg) double
equalsWithinEpsilon(double a, double b) bool
getWebUrl() String?
Gets the URL from the browser.
isPrivateMember(String member) bool
loadQueryParams() Map<String, String>
parseCssHexColor(String input) Color
Parses a 3 or 6 digit CSS Hex Color into a dart:ui Color.
pluralize(String word, int count, {String? plural}) String
Pluralizes a word, following english rules (1, many).
removeGlobal(Type clazz) → void
setGlobal(Type clazz, Object instance) → void
sortFieldsByName(String a, String b) int
Public properties first, then sort alphabetically
toCssHexColor(Color color) String
Converts a dart:ui Color into #RRGGBBAA format for use in CSS.
webRedirect(String url) → void
Performs a web redirect using window.location.replace().
whenValueNonNull<T>(ValueListenable<T> listenable, {Duration? timeout}) Future<T>