2
0
mirror of https://github.com/inventree/inventree-app.git synced 2026-06-10 16:37:18 +00:00

User info (#826)

* Enhanced user information in "about" view

* Add user info to nav drawer

* Update release notes
This commit is contained in:
Oliver
2026-05-30 14:19:32 +10:00
committed by GitHub
parent c95d5dfa7f
commit ea075f35e8
5 changed files with 106 additions and 51 deletions
+46 -13
View File
@@ -93,19 +93,7 @@ class InvenTreeAboutWidget extends StatelessWidget {
: L10().notConnected,
),
leading: Icon(TablerIcons.globe),
trailing: InvenTreeAPI().isConnected()
? Icon(TablerIcons.circle_check, color: COLOR_SUCCESS)
: Icon(TablerIcons.circle_x, color: COLOR_DANGER),
),
);
tiles.add(
ListTile(
title: Text(L10().username),
subtitle: Text(InvenTreeAPI().username),
leading: InvenTreeAPI().username.isNotEmpty
? Icon(TablerIcons.user)
: Icon(TablerIcons.user_cancel, color: COLOR_DANGER),
trailing: Icon(TablerIcons.circle_check, color: COLOR_SUCCESS),
),
);
@@ -141,6 +129,51 @@ class InvenTreeAboutWidget extends StatelessWidget {
leading: Icon(TablerIcons.plug),
),
);
tiles.add(
ListTile(
title: Text(
L10().userDetails,
style: TextStyle(fontWeight: FontWeight.bold),
),
),
);
tiles.add(
ListTile(
title: Text(L10().username),
subtitle: Text(InvenTreeAPI().username),
leading: InvenTreeAPI().username.isNotEmpty
? Icon(TablerIcons.user)
: Icon(TablerIcons.user_cancel, color: COLOR_DANGER),
),
);
final String email = InvenTreeAPI().userEmail;
if (email.isNotEmpty) {
tiles.add(
ListTile(
title: Text(L10().email),
subtitle: Text(email),
leading: Icon(TablerIcons.at),
),
);
}
final String firstName = InvenTreeAPI().userFirstName;
final String lastName = InvenTreeAPI().userLastName;
final String fullName = "$firstName $lastName".trim();
if (fullName.isNotEmpty) {
tiles.add(
ListTile(
title: Text(L10().name),
subtitle: Text(fullName),
leading: Icon(TablerIcons.id_badge),
),
);
}
} else {
tiles.add(
ListTile(