2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-13 18:55:34 +00:00

Add custom search context for "category"

This commit is contained in:
Oliver Walters
2021-02-13 00:40:21 +11:00
parent 36f0d7b120
commit 858464d301
4 changed files with 32 additions and 89 deletions

View File

@ -3,6 +3,7 @@ import 'package:InvenTree/api.dart';
import 'package:InvenTree/inventree/part.dart';
import 'package:InvenTree/preferences.dart';
import 'package:InvenTree/widget/progress.dart';
import 'package:InvenTree/widget/search.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
@ -44,6 +45,15 @@ class _CategoryDisplayState extends RefreshableState<CategoryDisplayWidget> {
icon: FaIcon(FontAwesomeIcons.edit),
tooltip: I18N.of(context).edit,
onPressed: _editCategoryDialog,
),
IconButton(
icon: FaIcon(FontAwesomeIcons.search),
onPressed: () {
showSearch(
context: context,
delegate: PartSearchDelegate(filters: {"category": "${category.pk}"})
);
}
)
];
}