core.common library Null safety

Common classes, interfaces, widgets and some utils.

Classes

AlertUtils
An util to create message dialogs (for info, warning and error messages)
CacheFailure
To use when CacheException has been encountered
DbFailure
To use when it's impossible to operate (CRUD) on database for some reason
Failure
Failure base class (contains an error message)
Feature
Feature configuration base class
IErrorState
Error generic state (having a message and optional details)
IRestService
Base data source interface (using httpClient)
KitActionButton
Widget: Action button (rounded with an icon)
KitAppBar
Widget: Top app bar
KitDrawer
Widget: App drawer
KitNoData
Widget: No data illustration
KitNoNotifications
Widget: No notifications illustration
KitSelectableCard
Widget: Selectable card
KitShowError
Widget: Error illustration with an error message
KitSwitch
Widget: Switch
KitTagCheck
Widget: Checkable (icon and a title)
KitTextInput
Widget: Custom text input based on KitTextInput material widget
NoParams
To use when the use case does not need parameters
RestService
Base data source implementation of IRestService
ServerFailure
To use when a network exception has been encountered
UseCase<Type, Params>
Base use case class

Constants

faIconNameMapping → const Map<String, IconData>
Icon name to icon mapping for font awesome icons [...]
{'brands 500px' : FontAwesomeIcons.fiveHundredPx, 'brands accessible-icon' : FontAwesomeIcons.accessibleIcon, 'brands accusoft' : FontAwesomeIcons.accusoft, 'brands acquisi…

Functions

formatDate(DateTime dateTime) String
Format DateTime and return a String having this format : MM/dd/y
formatDistance(double? meters) String
Convert the distance (as double) and return it as formatted string
formatTime(TimeOfDay? timeOfDay) String
Format TimeOfDay and return a String having this format : kk:mm
formatTimeFromDt(DateTime? dateTime) String
Extract time from DateTime and return a String having this format : kk:mm
getIconFromCss(String cssClasses) IconData
Utility function retrieve icons based on their css classes [...]

Exceptions / Errors

AuthException
Thrown when an authentication error has occurred (due to server failure or incorrect credentials)
CacheException
Thrown when an error occurred when reading from local storage (preferences or db)
DefaultLanguageNotFound
Thrown when the default language is not configured (see AppLanguage)