tablexStrings function

TablexStrings tablexStrings(
  1. BuildContext context
)

Returns the TablexStrings instance for the current locale.

Locale resolution order:

  1. Localizations.maybeLocaleOf — the app's locale (set via MaterialApp.locale or a localization delegate).
  2. PlatformDispatcher.instance.locale — the device system locale.
  3. English, as a hard fallback.

Call this inside build() — it is a cheap map lookup.

@override
Widget build(BuildContext context) {
  final t = tablexStrings(context);
  return Text(t.noData);
}

Implementation

TablexStrings tablexStrings(BuildContext context) {
  final locale = Localizations.maybeLocaleOf(context) ??
      PlatformDispatcher.instance.locale;
  return TablexStrings.of(TablexLocale.fromLocale(locale));
}