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