isSearchSameAsStored method
Implementation
Future<bool> isSearchSameAsStored() async {
if (!Requests.box.hasData('hasSearch') ||
Requests.box.read('hasSearch') != true) {
return false;
}
final tmp = Requests.box.read('searchType') == 'one_way'
? TripType.oneWay
: Requests.box.read('searchType') == 'round_trip'
? TripType.roundTrip
: TripType.multiCity;
return tmp == tripType.value &&
(Requests.box.read('searchAdults') ?? 0) == (searchAdults.value) &&
(Requests.box.read('searchChildren') ?? 0) ==
(searchChildren.value) &&
(Requests.box.read('searchInfantsInSeats') ?? 0) ==
(searchInfantsInSeats.value) &&
(Requests.box.read('searchInfantsInLap') ?? 0) ==
(searchInfantsInLap.value) &&
(Requests.box.read('searchFlexible') ?? false) ==
(isFlexibleDeparture.value) &&
(Requests.box.read('searchDeparture') ?? '') ==
(searchDepartureDate.value) &&
(Requests.box.read('searchReturn') ?? '') ==
(searchReturnDate.value) &&
(Requests.box.read('searchClass') ?? 0) ==
(searchClassIndex.value) &&
(Requests.box.read('allowedAdultPassengerLimit') ?? 0) ==
(allowedAdultPassengerLimit) &&
_compareAirports(Requests.box.read('searchFrom'),
searchFromAirport.value?.toJson()) &&
_compareAirports(
Requests.box.read('searchTo'), searchToAirport.value?.toJson());
}