translateCode property
The translateCode method is called to convert error codes into text messages.
If you are using use the i18n_extension
, you may provide codeTranslations.
If you are NOT using the i18n_extension
, you can instead modify
the translateCode method to return a string from the code in any way you want.
Implementation
static String Function(int?) translateCode = (int? code) =>
(codeTranslations == null) ? (code?.toString() ?? '') : localize(code, codeTranslations!);