From 6cac94a1c4f16b45db1927e691e1fa6909648327 Mon Sep 17 00:00:00 2001 From: mohammad Date: Wed, 9 Jul 2025 16:23:39 +0300 Subject: [PATCH] Clean up booking system code: remove commented-out code and unnecessary variables for improved readability --- .../booking_system/domain/models/bookable_room.dart | 1 - .../booking_system/domain/models/product.dart | 0 .../domain/services/DebouncedBookingSystemService.dart | 1 - .../presentation/bloc/sidebar/sidebar_event.dart | 2 -- .../booking_system/presentation/view/booking_page.dart | 1 - .../presentation/view/widgets/booking_sidebar.dart | 3 --- .../presentation/view/widgets/weekly_calendar_page.dart | 2 +- 7 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 lib/pages/access_management/booking_system/domain/models/product.dart diff --git a/lib/pages/access_management/booking_system/domain/models/bookable_room.dart b/lib/pages/access_management/booking_system/domain/models/bookable_room.dart index b8aa58b9..c7dbd0aa 100644 --- a/lib/pages/access_management/booking_system/domain/models/bookable_room.dart +++ b/lib/pages/access_management/booking_system/domain/models/bookable_room.dart @@ -1,4 +1,3 @@ -// bookable_space_model.dart class BookableSpaceModel { final String uuid; final String spaceName; diff --git a/lib/pages/access_management/booking_system/domain/models/product.dart b/lib/pages/access_management/booking_system/domain/models/product.dart deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/pages/access_management/booking_system/domain/services/DebouncedBookingSystemService.dart b/lib/pages/access_management/booking_system/domain/services/DebouncedBookingSystemService.dart index 40e4e5ab..252810e2 100644 --- a/lib/pages/access_management/booking_system/domain/services/DebouncedBookingSystemService.dart +++ b/lib/pages/access_management/booking_system/domain/services/DebouncedBookingSystemService.dart @@ -9,7 +9,6 @@ class DebouncedBookingSystemService implements BookingSystemService { Timer? _debounceTimer; Completer? _lastCompleter; - // Store last parameters int? _lastPage; int? _lastSize; bool? _lastIncludeSpaces; diff --git a/lib/pages/access_management/booking_system/presentation/bloc/sidebar/sidebar_event.dart b/lib/pages/access_management/booking_system/presentation/bloc/sidebar/sidebar_event.dart index 5dd1a3c8..770e7b7e 100644 --- a/lib/pages/access_management/booking_system/presentation/bloc/sidebar/sidebar_event.dart +++ b/lib/pages/access_management/booking_system/presentation/bloc/sidebar/sidebar_event.dart @@ -14,12 +14,10 @@ class SearchRoomsEvent extends SidebarEvent { SearchRoomsEvent(this.query); } -// Add these to your sidebar_event.dart file class LoadMoreSpaces extends SidebarEvent {} class ResetSearch extends SidebarEvent {} -// Add to sidebar_event.dart class ExecuteSearch extends SidebarEvent { final String query; diff --git a/lib/pages/access_management/booking_system/presentation/view/booking_page.dart b/lib/pages/access_management/booking_system/presentation/view/booking_page.dart index 522b0f25..c1c81ef4 100644 --- a/lib/pages/access_management/booking_system/presentation/view/booking_page.dart +++ b/lib/pages/access_management/booking_system/presentation/view/booking_page.dart @@ -216,7 +216,6 @@ class _BookingPageState extends State { child: BlocBuilder( builder: (context, roomState) { - // NOTE: Assuming `SelectedBookableSpaceState` has a `selectedBookableSpace` property. final selectedRoom = roomState.selectedBookableSpace; return BlocBuilder( diff --git a/lib/pages/access_management/booking_system/presentation/view/widgets/booking_sidebar.dart b/lib/pages/access_management/booking_system/presentation/view/widgets/booking_sidebar.dart index 1796f331..778822f8 100644 --- a/lib/pages/access_management/booking_system/presentation/view/widgets/booking_sidebar.dart +++ b/lib/pages/access_management/booking_system/presentation/view/widgets/booking_sidebar.dart @@ -69,10 +69,7 @@ class __SidebarContentState extends State<_SidebarContent> { } void _handleSearch(String value) { - // Cancel previous debounce timer _searchDebounce?.cancel(); - - // Set up new debounce timer _searchDebounce = Timer(const Duration(milliseconds: 300), () { context.read().add(SearchRoomsEvent(value)); }); diff --git a/lib/pages/access_management/booking_system/presentation/view/widgets/weekly_calendar_page.dart b/lib/pages/access_management/booking_system/presentation/view/widgets/weekly_calendar_page.dart index d815ee2e..9b521368 100644 --- a/lib/pages/access_management/booking_system/presentation/view/widgets/weekly_calendar_page.dart +++ b/lib/pages/access_management/booking_system/presentation/view/widgets/weekly_calendar_page.dart @@ -253,8 +253,8 @@ int _parseHour(String? time, {required int defaultValue}) { } try { return int.parse(time.split(':')[0]); + } catch (e) { - // Optionally log the error, e.g., print('Error parsing time: $e'); return defaultValue; } }