diff --git a/lib/ui/app/list_filter.dart b/lib/ui/app/list_filter.dart index 468dda5fc..f6f096a19 100644 --- a/lib/ui/app/list_filter.dart +++ b/lib/ui/app/list_filter.dart @@ -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 { ), */ border: InputBorder.none, - hintText: localization.filter), + hintText: widget.filterLabel ?? localization.filter), autofocus: true, autocorrect: false, onChanged: (value) { diff --git a/lib/ui/app/list_filter_button.dart b/lib/ui/app/list_filter_button.dart index 347809118..15e16104b 100644 --- a/lib/ui/app/list_filter_button.dart +++ b/lib/ui/app/list_filter_button.dart @@ -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 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), diff --git a/lib/ui/dashboard/dashboard_screen.dart b/lib/ui/dashboard/dashboard_screen.dart index ce8e18cd2..e4d6cb637 100644 --- a/lib/ui/dashboard/dashboard_screen.dart +++ b/lib/ui/dashboard/dashboard_screen.dart @@ -72,6 +72,7 @@ class _DashboardScreenState extends State onFilterChanged: (value) { store.dispatch(FilterCompany(value)); }, + filterLabel: localization.search, ), actions: [ ListFilterButton( @@ -79,6 +80,7 @@ class _DashboardScreenState extends State onFilterPressed: (String value) { store.dispatch(FilterCompany(value)); }, + filterLabel: localization.search, ), if (isMobile(context) || !state.prefState.isHistoryVisible) Builder(