Clarify filter/search labels
This commit is contained in:
parent
150a119455
commit
4af324566a
|
|
@ -7,14 +7,16 @@ import 'package:redux/redux.dart';
|
|||
class ListFilter extends StatefulWidget {
|
||||
const ListFilter({
|
||||
Key key,
|
||||
this.filter,
|
||||
this.title,
|
||||
this.onFilterChanged,
|
||||
@required this.filter,
|
||||
@required this.title,
|
||||
@required this.onFilterChanged,
|
||||
this.filterLabel,
|
||||
}) : super(key: key);
|
||||
|
||||
final String filter;
|
||||
final String title;
|
||||
final Function(String) onFilterChanged;
|
||||
final String filterLabel;
|
||||
|
||||
@override
|
||||
_ListFilterState createState() => new _ListFilterState();
|
||||
|
|
@ -71,7 +73,7 @@ class _ListFilterState extends State<ListFilter> {
|
|||
),
|
||||
*/
|
||||
border: InputBorder.none,
|
||||
hintText: localization.filter),
|
||||
hintText: widget.filterLabel ?? localization.filter),
|
||||
autofocus: true,
|
||||
autocorrect: false,
|
||||
onChanged: (value) {
|
||||
|
|
|
|||
|
|
@ -6,12 +6,14 @@ import 'package:invoiceninja_flutter/utils/localization.dart';
|
|||
|
||||
class ListFilterButton extends StatelessWidget {
|
||||
const ListFilterButton({
|
||||
this.filter,
|
||||
this.onFilterPressed,
|
||||
@required this.filter,
|
||||
@required this.onFilterPressed,
|
||||
this.filterLabel,
|
||||
});
|
||||
|
||||
final String filter;
|
||||
final Function onFilterPressed;
|
||||
final String filterLabel;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
@ -21,7 +23,9 @@ class ListFilterButton extends StatelessWidget {
|
|||
builder: (BuildContext context, Store<AppState> store) {
|
||||
return FlatButton(
|
||||
child: Text(
|
||||
filter == null ? localization.filter : localization.close,
|
||||
filter == null
|
||||
? (filterLabel ?? localization.filter)
|
||||
: localization.close,
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
onPressed: () => onFilterPressed(filter == null ? '' : null),
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ class _DashboardScreenState extends State<DashboardScreen>
|
|||
onFilterChanged: (value) {
|
||||
store.dispatch(FilterCompany(value));
|
||||
},
|
||||
filterLabel: localization.search,
|
||||
),
|
||||
actions: [
|
||||
ListFilterButton(
|
||||
|
|
@ -79,6 +80,7 @@ class _DashboardScreenState extends State<DashboardScreen>
|
|||
onFilterPressed: (String value) {
|
||||
store.dispatch(FilterCompany(value));
|
||||
},
|
||||
filterLabel: localization.search,
|
||||
),
|
||||
if (isMobile(context) || !state.prefState.isHistoryVisible)
|
||||
Builder(
|
||||
|
|
|
|||
Loading…
Reference in New Issue