locale property

Locale locale

Get the currently selected locale from state's data.

Throws an exception if not initialized.

Implementation

Locale get locale => state.maybeMap(
      initialized: (state) => state.locales
          .firstWhere(
            (x) => x.locale.toString() == data.locale,
            orElse: () => state.locales.first,
          )
          .locale,
      orElse: () => throw Exception('Not initialized'),
    );