mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Cleanup
This commit is contained in:
parent
74e6315a57
commit
d918079440
5 changed files with 80 additions and 78 deletions
|
|
@ -83,24 +83,4 @@ class InvenTreePreferences {
|
|||
}
|
||||
|
||||
InvenTreePreferences._internal();
|
||||
|
||||
// Load saved login details, and attempt connection
|
||||
void loadLoginDetails(BuildContext context) async {
|
||||
|
||||
print("Loading login details");
|
||||
|
||||
await InvenTreeAPI().connectToServer(context);
|
||||
}
|
||||
|
||||
void saveLoginDetails(BuildContext context, String server, String username, String password) async {
|
||||
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
|
||||
await prefs.setString(_SERVER, server);
|
||||
await prefs.setString(_USERNAME, username);
|
||||
await prefs.setString(_PASSWORD, password);
|
||||
|
||||
// Reconnect the API
|
||||
await InvenTreeAPI().connectToServer(context);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue