setLocale abstract method

Future<void> setLocale({
  1. required String locale,
})

Sets the browser's locale to locale (e.g. 'ar-SA', 'en-US').

Safe to call mid-flow: overrides the live page's navigator.language/ Intl via the Chromium DevTools Protocol and dispatches the DOM languagechange event the Flutter web engine listens for, so an already-booted app picks up the new locale without a reload and without depending on any app-internal locale state.

Implementation

Future<void> setLocale({required String locale});