modules/app/utils/utils library

Classes

AppLocalizations
Callers can lookup localized strings with an instance of AppLocalizations returned by AppLocalizations.of(context).
BoolConverter
Implements serialization and deserialization for bool from bool and int and converts it to an int.
ContextColorMapper
A ColorMapper that uses the current context to resolve colors based on the active theme. Used in SvgUtils.themed to resolve colors in SVG images.
HexColorConverter
Implements serialization and deserialization for Color from and to String.
UnixTimestampConverter
Implements serialization and deserialization for DateTime from and to int.

Extensions

AnimateUtils on List<Widget>
Adds default animation to a list of widgets.
AnimateX on Widget
Adds default animation to a widget.
ButtonUtils on CircularProgressIndicator
Provides button extensions on CircularProgressIndicator.
ContextUtils on BuildContext
Adds a AppLocalizations getter to BuildContext.
ShimmerX on Widget
Adds shimmer animation to a widget.
StateUtils on State<StatefulWidget>
Adds a AppLocalizations getter to State.
SvgUtils on SvgGenImage
Utility class for theming SVG images.

Functions

captureEvent(String eventName, {Map<String, Object>? properties}) Future<void>
Captures a posthog event.
lookupAppLocalizations(Locale locale) AppLocalizations
showAlertDialog(BuildContext context, {required String title, required String message, String? confirmLabel}) Future<void>
Shows an alert dialog with the given title and message to the user. The dialog will have an OK button to dismiss it.
showAnimatedDialog<T>({required BuildContext context, required RoutePageBuilder pageBuilder}) Future<T?>
Shows a dialog with default animations.
showConfirmationDialog(BuildContext context, {required String title, required String message, String? confirmLabel, String? cancelLabel}) Future<bool>
Shows a confirmation dialog with the given title and message to the user.
showGenericDialog<T>(BuildContext context, {required String title, required Widget content, List<DialogAction>? actions, bool shrinkWrap = true}) Future<T?>
Shows a GenericDialog with the given title and content to the user.

Typedefs

Translator = String Function(BuildContext context)
A function that returns a translated string based on the BuildContext.