Skip to content

Commit

Permalink
Change rendering of part parameter
Browse files Browse the repository at this point in the history
Closes #358
  • Loading branch information
SchrodingersGat committed Nov 25, 2023
1 parent 1ec1a86 commit ac54996
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/widget/part/part_parameter_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,14 @@ class _PaginatedParameterState extends PaginatedSearchState<PaginatedParameterLi

InvenTreePartParameter parameter = model as InvenTreePartParameter;

String title = parameter.name;

if (parameter.units.isNotEmpty) {
title += " [${parameter.units}]";
}

return ListTile(
title: Text(parameter.name),
title: Text(title),
subtitle: Text(parameter.description),
trailing: parameter.is_checkbox
? Switch(
Expand All @@ -132,7 +138,7 @@ class _PaginatedParameterState extends PaginatedSearchState<PaginatedParameterLi
});
}
},
) : Text(parameter.valueString),
) : Text(parameter.value),
onTap: parameter.is_checkbox ? null : () async {
if (parameter.canEdit) {
editParameter(parameter);
Expand Down

0 comments on commit ac54996

Please sign in to comment.