diff --git a/lib/models/visits/visits_search.dart b/lib/models/visits/visits_search.dart index 4e6159f2..aa91d444 100644 --- a/lib/models/visits/visits_search.dart +++ b/lib/models/visits/visits_search.dart @@ -29,7 +29,7 @@ class VisitsSearch { this.expectedDateTo, this.deviceNumber, this.deviceName, - this.mostRecent, + this.mostRecent = true, }); fromSearch(VisitsSearch newSearch) { @@ -58,6 +58,10 @@ class VisitsSearch { _search["siteId"] = hospital.id; } + if (mostRecent != null) { + _search["mostRecent"] = mostRecent; + } + if (brand != null && brand.isNotEmpty) { // todo get new key _search[""] = brand; diff --git a/lib/views/pages/user/visits/regular_visits_page.dart b/lib/views/pages/user/visits/regular_visits_page.dart index c9d16a45..c2ded666 100644 --- a/lib/views/pages/user/visits/regular_visits_page.dart +++ b/lib/views/pages/user/visits/regular_visits_page.dart @@ -107,7 +107,7 @@ class _RegularVisitsPageState extends State with TickerProvid ), ), Visibility( - visible: _visitsProvider.visitsSearch.toMap().isNotEmpty, + visible: (_visitsProvider.visitsSearch.toMap()..remove("mostRecent")).isNotEmpty, child: Padding( padding: const EdgeInsets.all(8.0), child: AButton(