Reports
This commit is contained in:
parent
72156b5017
commit
3e7e34f15a
|
|
@ -553,8 +553,13 @@ class ReportResult {
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool matchString({String filter, String value}) =>
|
||||
matchesString(value, filter);
|
||||
static bool matchString({String filter, String value}) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return value.toLowerCase().contains(filter.toLowerCase());
|
||||
}
|
||||
|
||||
static bool matchAmount({String filter, double amount}) {
|
||||
final String range = filter.replaceAll(',', '-') + '-';
|
||||
|
|
|
|||
|
|
@ -44,7 +44,21 @@ String getLastName(String value) {
|
|||
return parts.last;
|
||||
}
|
||||
|
||||
bool matchesStrings(List<String> haystacks, String needle) {
|
||||
bool isMatch = false;
|
||||
haystacks.forEach((haystack) {
|
||||
if (matchesString(haystack, needle)) {
|
||||
isMatch = true;
|
||||
}
|
||||
});
|
||||
return isMatch;
|
||||
}
|
||||
|
||||
bool matchesString(String haystack, String needle) {
|
||||
if (needle == null || needle.isEmpty) {
|
||||
return true;
|
||||
}
|
||||
|
||||
String regExp = '';
|
||||
needle.toLowerCase().runes.forEach((int rune) {
|
||||
final character = String.fromCharCode(rune);
|
||||
|
|
|
|||
Loading…
Reference in New Issue