Fix web local

This commit is contained in:
Christian Pauly 2020-04-04 09:27:47 +02:00
parent dc678f9479
commit 251b5f26af

View file

@ -11,6 +11,7 @@ import 'views/sign_up.dart';
import 'components/theme_switcher.dart'; import 'components/theme_switcher.dart';
import 'components/matrix.dart'; import 'components/matrix.dart';
import 'views/chat_list.dart'; import 'views/chat_list.dart';
import 'package:universal_html/prefer_universal/html.dart' as html;
void main() { void main() {
SystemChrome.setSystemUIOverlayStyle( SystemChrome.setSystemUIOverlayStyle(
@ -40,6 +41,9 @@ class App extends StatelessWidget {
const Locale('en'), // English const Locale('en'), // English
const Locale('de'), // German const Locale('de'), // German
], ],
locale: kIsWeb
? Locale(html.window.navigator.language.split("-").first)
: null,
home: FutureBuilder<LoginState>( home: FutureBuilder<LoginState>(
future: future:
Matrix.of(context).client.onLoginStateChanged.stream.first, Matrix.of(context).client.onLoginStateChanged.stream.first,