From 786aa05b19514ce7ac9246ce7e9da0321695366d Mon Sep 17 00:00:00 2001 From: tahaalam Date: Thu, 2 Oct 2025 16:38:46 +0300 Subject: [PATCH] doctor list handled to be cleared when going back --- .../book_appointment/search_doctor_by_name.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/presentation/book_appointment/search_doctor_by_name.dart b/lib/presentation/book_appointment/search_doctor_by_name.dart index 233aff9..5949ef5 100644 --- a/lib/presentation/book_appointment/search_doctor_by_name.dart +++ b/lib/presentation/book_appointment/search_doctor_by_name.dart @@ -88,7 +88,7 @@ class _SearchDoctorByNameState extends State { ), ), Visibility( - visible: bookAppointmentsViewModel.doctorsList.isNotEmpty, + visible: context.watch().doctorsList.isNotEmpty, child: SizedBox( height: 56.h, width: 56.h, @@ -264,4 +264,9 @@ class _SearchDoctorByNameState extends State { ), ); } + @override + void dispose() { + bookAppointmentsViewModel.doctorsList.clear(); + super.dispose(); + } }