mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 11:36:24 +00:00
Simplify part filtering
This commit is contained in:
parent
2797bc1912
commit
f9dddfe3a2
1 changed files with 3 additions and 9 deletions
|
|
@ -101,14 +101,6 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||
|
||||
String _filter = '';
|
||||
|
||||
void _filterParts(String text) {
|
||||
// Filtering is case-insensitive
|
||||
_filter = text.trim().toLowerCase();
|
||||
|
||||
// Update state
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
List<InvenTreePart> get parts {
|
||||
|
||||
if (_filter.isNotEmpty) {
|
||||
|
|
@ -238,7 +230,9 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||
hintText: 'Filter Results',
|
||||
),
|
||||
onChanged: (text) {
|
||||
_filterParts(text);
|
||||
setState(() {
|
||||
_filter = text.trim().toLowerCase();
|
||||
});
|
||||
},
|
||||
),
|
||||
Text(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue