2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-13 10:45:29 +00:00
Oliver Walters
2021-02-09 21:38:50 +11:00
parent 90072904a0
commit 33bb6148de
11 changed files with 162 additions and 167 deletions

View File

@ -19,6 +19,8 @@ class InvenTreeLoginSettingsWidget extends StatefulWidget {
class _InvenTreeLoginSettingsState extends State<InvenTreeLoginSettingsWidget> {
final GlobalKey<_InvenTreeLoginSettingsState> _loginKey = GlobalKey<_InvenTreeLoginSettingsState>();
final GlobalKey<FormState> _formKey = new GlobalKey<FormState>();
final GlobalKey<FormState> _addProfileKey = new GlobalKey<FormState>();
@ -176,7 +178,7 @@ class _InvenTreeLoginSettingsState extends State<InvenTreeLoginSettingsWidget> {
_reload();
// Attempt server login (this will load the newly selected profile
InvenTreeAPI().connectToServer(context).then((result) {
InvenTreeAPI().connectToServer(_loginKey.currentContext).then((result) {
_reload();
});
@ -209,7 +211,7 @@ class _InvenTreeLoginSettingsState extends State<InvenTreeLoginSettingsWidget> {
if (InvenTreeAPI().isConnected() && profile.key == InvenTreeAPI().profile.key) {
// Attempt server login (this will load the newly selected profile
InvenTreeAPI().connectToServer(context).then((result) {
InvenTreeAPI().connectToServer(_loginKey.currentContext).then((result) {
_reload();
});
}
@ -262,8 +264,6 @@ class _InvenTreeLoginSettingsState extends State<InvenTreeLoginSettingsWidget> {
final Size screenSize = MediaQuery.of(context).size;
print("Building!");
List<Widget> children = [];
if (profiles != null && profiles.length > 0) {
@ -333,6 +333,7 @@ class _InvenTreeLoginSettingsState extends State<InvenTreeLoginSettingsWidget> {
}
return Scaffold(
key: _loginKey,
appBar: AppBar(
title: Text(I18N.of(context).profileSelect),
),