mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-12 02:05:29 +00:00
UserProfile
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
import 'package:InvenTree/settings/about.dart';
|
||||
import 'package:InvenTree/settings/login.dart';
|
||||
import 'package:InvenTree/settings/release.dart';
|
||||
import 'package:InvenTree/user_profile.dart';
|
||||
import 'package:InvenTree/preferences.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@ -58,6 +60,25 @@ class _InvenTreeSettingsState extends State<InvenTreeSettingsWidget> {
|
||||
leading: FaIcon(FontAwesomeIcons.bug),
|
||||
onTap: null,
|
||||
),
|
||||
ListTile(
|
||||
title: Text("Throw Error"),
|
||||
onTap: () {
|
||||
throw("My custom error");
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
title: Text("add profile"),
|
||||
onTap: () {
|
||||
UserProfileDBManager().addProfile(
|
||||
UserProfile(
|
||||
name: "My Profile",
|
||||
server: "https://127.0.0.1:8000",
|
||||
username: "Oliver",
|
||||
password: "hunter2",
|
||||
)
|
||||
);
|
||||
},
|
||||
)
|
||||
],
|
||||
)
|
||||
)
|
||||
@ -68,7 +89,9 @@ class _InvenTreeSettingsState extends State<InvenTreeSettingsWidget> {
|
||||
|
||||
var prefs = await SharedPreferences.getInstance();
|
||||
|
||||
Navigator.push(context, MaterialPageRoute(builder: (context) => InvenTreeLoginSettingsWidget(prefs)));
|
||||
List<UserProfile> profiles = await UserProfileDBManager().getAllProfiles();
|
||||
|
||||
Navigator.push(context, MaterialPageRoute(builder: (context) => InvenTreeLoginSettingsWidget(profiles, prefs)));
|
||||
}
|
||||
|
||||
void _about() async {
|
||||
|
Reference in New Issue
Block a user