Fix StyledToast
This commit is contained in:
parent
bed0d821e3
commit
12f4f6e192
|
@ -29,45 +29,48 @@ class App extends StatelessWidget {
|
|||
child: Builder(
|
||||
builder: (BuildContext context) => ThemeSwitcherWidget(
|
||||
child: Builder(
|
||||
builder: (BuildContext context) => StyledToast(
|
||||
duration: Duration(seconds: 5),
|
||||
child: MaterialApp(
|
||||
title: 'FluffyChat',
|
||||
theme: ThemeSwitcherWidget.of(context).themeData,
|
||||
localizationsDelegates: [
|
||||
AppLocalizationsDelegate(),
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
supportedLocales: [
|
||||
const Locale('en'), // English
|
||||
const Locale('de'), // German
|
||||
const Locale('hu'), // Hungarian
|
||||
const Locale('pl'), // Polish
|
||||
],
|
||||
locale: kIsWeb
|
||||
? Locale(html.window.navigator.language.split("-").first)
|
||||
: null,
|
||||
home: FutureBuilder<LoginState>(
|
||||
future: Matrix.of(context)
|
||||
.client
|
||||
.onLoginStateChanged
|
||||
.stream
|
||||
.first,
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData) {
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
}
|
||||
if (Matrix.of(context).client.isLogged()) {
|
||||
return ChatListView();
|
||||
}
|
||||
return HomeserverPicker();
|
||||
},
|
||||
// Workaround for: https://github.com/JackJonson/flutter_styled_toast/issues/7
|
||||
builder: (BuildContext context) => MaterialApp(
|
||||
home: StyledToast(
|
||||
duration: Duration(seconds: 5),
|
||||
child: MaterialApp(
|
||||
title: 'FluffyChat',
|
||||
theme: ThemeSwitcherWidget.of(context).themeData,
|
||||
localizationsDelegates: [
|
||||
AppLocalizationsDelegate(),
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
supportedLocales: [
|
||||
const Locale('en'), // English
|
||||
const Locale('de'), // German
|
||||
const Locale('hu'), // Hungarian
|
||||
const Locale('pl'), // Polish
|
||||
],
|
||||
locale: kIsWeb
|
||||
? Locale(html.window.navigator.language.split("-").first)
|
||||
: null,
|
||||
home: FutureBuilder<LoginState>(
|
||||
future: Matrix.of(context)
|
||||
.client
|
||||
.onLoginStateChanged
|
||||
.stream
|
||||
.first,
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData) {
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
}
|
||||
if (Matrix.of(context).client.isLogged()) {
|
||||
return ChatListView();
|
||||
}
|
||||
return HomeserverPicker();
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue