2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-04-28 21:46:46 +00:00

Allow "trailing" widget to be displayed on home screen entries

This commit is contained in:
Oliver Walters 2022-07-06 21:21:19 +10:00
parent bb73fb7400
commit 2e7abf8a1e

View File

@ -192,7 +192,7 @@ class _InvenTreeHomePageState extends State<InvenTreeHomePage> {
} }
Widget _listTile(BuildContext context, String label, IconData icon, {Function()? callback, String role = "", String permission = ""}) { Widget _listTile(BuildContext context, String label, IconData icon, {Function()? callback, String role = "", String permission = "", Widget? trailing}) {
bool connected = InvenTreeAPI().isConnected(); bool connected = InvenTreeAPI().isConnected();
@ -211,6 +211,7 @@ class _InvenTreeHomePageState extends State<InvenTreeHomePage> {
child: ListTile( child: ListTile(
leading: FaIcon(icon, color: connected && allowed ? COLOR_CLICK : Colors.grey), leading: FaIcon(icon, color: connected && allowed ? COLOR_CLICK : Colors.grey),
title: Text(label), title: Text(label),
trailing: trailing,
), ),
), ),
onTap: () { onTap: () {
@ -257,7 +258,7 @@ class _InvenTreeHomePageState extends State<InvenTreeHomePage> {
FontAwesomeIcons.shapes, FontAwesomeIcons.shapes,
callback: () { callback: () {
_showParts(context); _showParts(context);
} },
)); ));
// Starred parts // Starred parts