mirror of
https://github.com/inventree/inventree-app.git
synced 2025-05-11 11:48:52 +00:00
Add separate search icons from home page
This commit is contained in:
parent
5c7629d4d1
commit
135b752d51
2
lib/l10n
2
lib/l10n
@ -1 +1 @@
|
|||||||
Subproject commit 045288ea2a1d6b2248de084fdbacafc2256e1313
|
Subproject commit cf76a2a70e96e49991a63bbde6d45911caaaf05f
|
@ -41,7 +41,7 @@ class _InvenTreeHomePageState extends State<InvenTreeHomePage> {
|
|||||||
|
|
||||||
BuildContext _context;
|
BuildContext _context;
|
||||||
|
|
||||||
void _search() {
|
void _searchParts() {
|
||||||
if (!InvenTreeAPI().checkConnection(context)) return;
|
if (!InvenTreeAPI().checkConnection(context)) return;
|
||||||
|
|
||||||
showSearch(
|
showSearch(
|
||||||
@ -50,6 +50,15 @@ class _InvenTreeHomePageState extends State<InvenTreeHomePage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _searchStock() {
|
||||||
|
if (!InvenTreeAPI().checkConnection(context)) return;
|
||||||
|
|
||||||
|
showSearch(
|
||||||
|
context: context,
|
||||||
|
delegate: StockSearchDelegate()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
void _scan(BuildContext context) {
|
void _scan(BuildContext context) {
|
||||||
if (!InvenTreeAPI().checkConnection(context)) return;
|
if (!InvenTreeAPI().checkConnection(context)) return;
|
||||||
|
|
||||||
@ -207,11 +216,13 @@ class _InvenTreeHomePageState extends State<InvenTreeHomePage> {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text(I18N.of(context).appTitle),
|
title: Text(I18N.of(context).appTitle),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
|
/*
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: FaIcon(FontAwesomeIcons.search),
|
icon: FaIcon(FontAwesomeIcons.search),
|
||||||
tooltip: I18N.of(context).search,
|
tooltip: I18N.of(context).search,
|
||||||
onPressed: _search,
|
onPressed: _searchParts,
|
||||||
),
|
),
|
||||||
|
*/
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
drawer: new InvenTreeDrawer(context),
|
drawer: new InvenTreeDrawer(context),
|
||||||
@ -225,17 +236,6 @@ class _InvenTreeHomePageState extends State<InvenTreeHomePage> {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Column(
|
|
||||||
children: <Widget>[
|
|
||||||
|
|
||||||
IconButton(
|
|
||||||
icon: new FaIcon(FontAwesomeIcons.search),
|
|
||||||
tooltip: I18N.of(context).search,
|
|
||||||
onPressed: _search,
|
|
||||||
),
|
|
||||||
Text(I18N.of(context).search),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Column(
|
Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
IconButton(
|
IconButton(
|
||||||
@ -262,6 +262,19 @@ class _InvenTreeHomePageState extends State<InvenTreeHomePage> {
|
|||||||
Text(I18N.of(context).parts),
|
Text(I18N.of(context).parts),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Column(
|
||||||
|
children: <Widget>[
|
||||||
|
|
||||||
|
IconButton(
|
||||||
|
icon: new FaIcon(FontAwesomeIcons.search),
|
||||||
|
tooltip: I18N.of(context).searchParts,
|
||||||
|
onPressed: _searchParts,
|
||||||
|
),
|
||||||
|
Text(I18N.of(context).searchParts),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
// TODO - Re-add starred parts link
|
||||||
|
/*
|
||||||
Column(
|
Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
IconButton(
|
IconButton(
|
||||||
@ -273,6 +286,13 @@ class _InvenTreeHomePageState extends State<InvenTreeHomePage> {
|
|||||||
Text("Starred Parts"),
|
Text("Starred Parts"),
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
|
*/
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Spacer(),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: <Widget>[
|
||||||
Column(
|
Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
IconButton(
|
IconButton(
|
||||||
@ -283,7 +303,17 @@ class _InvenTreeHomePageState extends State<InvenTreeHomePage> {
|
|||||||
Text(I18N.of(context).stock),
|
Text(I18N.of(context).stock),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
Column(
|
||||||
|
children: <Widget>[
|
||||||
|
IconButton(
|
||||||
|
icon: new FaIcon(FontAwesomeIcons.search),
|
||||||
|
tooltip: I18N.of(context).searchStock,
|
||||||
|
onPressed: _searchStock,
|
||||||
|
),
|
||||||
|
Text(I18N.of(context).searchStock),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
]
|
||||||
),
|
),
|
||||||
Spacer(),
|
Spacer(),
|
||||||
// TODO - Re-add these when the features actually do something..
|
// TODO - Re-add these when the features actually do something..
|
||||||
|
@ -267,7 +267,7 @@ class StockSearchDelegate extends SearchDelegate<InvenTreeStockItem> {
|
|||||||
|
|
||||||
return ListTile(
|
return ListTile(
|
||||||
title: Text(item.partName),
|
title: Text(item.partName),
|
||||||
subtitle: Text(item.partDescription),
|
subtitle: Text(item.locationName),
|
||||||
leading: InvenTreeAPI().getImage(
|
leading: InvenTreeAPI().getImage(
|
||||||
item.partThumbnail,
|
item.partThumbnail,
|
||||||
width: 40,
|
width: 40,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user