diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index a21ea567..cf9a2753 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -640,6 +640,9 @@ "quantityPositive": "Quantity must be positive", "@quantityPositive": {}, + "queryEmpty": "Enter search query", + "@queryEmpty": {}, + "queryNoResults": "No results for query", "@queryNoResults": {}, diff --git a/lib/widget/home.dart b/lib/widget/home.dart index f9c3c256..d526339d 100644 --- a/lib/widget/home.dart +++ b/lib/widget/home.dart @@ -378,11 +378,11 @@ class _InvenTreeHomePageState extends State { icon: _notificationCounter == 0 ? FaIcon(FontAwesomeIcons.bell) : Stack( children: [ FaIcon(FontAwesomeIcons.bell), - new Positioned( + Positioned( right: 0, - child: new Container( + child: Container( padding: EdgeInsets.all(2), - decoration: new BoxDecoration( + decoration: BoxDecoration( color: Colors.red, borderRadius: BorderRadius.circular(20), ), @@ -390,9 +390,9 @@ class _InvenTreeHomePageState extends State { minWidth: 12, minHeight: 12, ), - child: new Text( + child: Text( "${_notificationCounter}", - style: new TextStyle( + style: TextStyle( color: Colors.white, fontSize: 9, ), diff --git a/lib/widget/notifications.dart b/lib/widget/notifications.dart index a37d9d3d..8c03343b 100644 --- a/lib/widget/notifications.dart +++ b/lib/widget/notifications.dart @@ -1,6 +1,4 @@ - -import "package:flutter/cupertino.dart"; import "package:flutter/material.dart"; import "package:font_awesome_flutter/font_awesome_flutter.dart"; diff --git a/lib/widget/search.dart b/lib/widget/search.dart index 0705ea5c..2d21fc66 100644 --- a/lib/widget/search.dart +++ b/lib/widget/search.dart @@ -21,7 +21,7 @@ import "package:inventree/widget/location_list.dart"; // Widget for performing database-wide search class SearchWidget extends StatefulWidget { - SearchWidget(this.hasAppbar); + const SearchWidget(this.hasAppbar); final bool hasAppbar; @@ -172,12 +172,15 @@ class _SearchDisplayState extends RefreshableState { child: ListTile( title: TextField( readOnly: false, + decoration: InputDecoration( + helperText: L10().queryEmpty, + ), controller: searchController, onChanged: (String text) { onSearchTextChanged(text); }, ), - leading: IconButton( + trailing: IconButton( icon: FaIcon(FontAwesomeIcons.backspace, color: Colors.red), onPressed: () { searchController.clear(); @@ -332,7 +335,7 @@ class _SearchDisplayState extends RefreshableState { ); } - if (results.isEmpty) { + if (results.isEmpty && searchController.text.isNotEmpty) { tiles.add( ListTile( title: Text(L10().queryNoResults),