Clean up booking system code: remove commented-out code and unnecessary variables for improved readability

This commit is contained in:
mohammad
2025-07-09 16:23:39 +03:00
parent 9f28e1ccef
commit 6cac94a1c4
7 changed files with 1 additions and 9 deletions

View File

@ -1,4 +1,3 @@
// bookable_space_model.dart
class BookableSpaceModel { class BookableSpaceModel {
final String uuid; final String uuid;
final String spaceName; final String spaceName;

View File

@ -9,7 +9,6 @@ class DebouncedBookingSystemService implements BookingSystemService {
Timer? _debounceTimer; Timer? _debounceTimer;
Completer<PaginatedBookableSpaces>? _lastCompleter; Completer<PaginatedBookableSpaces>? _lastCompleter;
// Store last parameters
int? _lastPage; int? _lastPage;
int? _lastSize; int? _lastSize;
bool? _lastIncludeSpaces; bool? _lastIncludeSpaces;

View File

@ -14,12 +14,10 @@ class SearchRoomsEvent extends SidebarEvent {
SearchRoomsEvent(this.query); SearchRoomsEvent(this.query);
} }
// Add these to your sidebar_event.dart file
class LoadMoreSpaces extends SidebarEvent {} class LoadMoreSpaces extends SidebarEvent {}
class ResetSearch extends SidebarEvent {} class ResetSearch extends SidebarEvent {}
// Add to sidebar_event.dart
class ExecuteSearch extends SidebarEvent { class ExecuteSearch extends SidebarEvent {
final String query; final String query;

View File

@ -216,7 +216,6 @@ class _BookingPageState extends State<BookingPage> {
child: BlocBuilder<SelectedBookableSpaceBloc, child: BlocBuilder<SelectedBookableSpaceBloc,
SelectedBookableSpaceState>( SelectedBookableSpaceState>(
builder: (context, roomState) { builder: (context, roomState) {
// NOTE: Assuming `SelectedBookableSpaceState` has a `selectedBookableSpace` property.
final selectedRoom = roomState.selectedBookableSpace; final selectedRoom = roomState.selectedBookableSpace;
return BlocBuilder<DateSelectionBloc, return BlocBuilder<DateSelectionBloc,
DateSelectionState>( DateSelectionState>(

View File

@ -69,10 +69,7 @@ class __SidebarContentState extends State<_SidebarContent> {
} }
void _handleSearch(String value) { void _handleSearch(String value) {
// Cancel previous debounce timer
_searchDebounce?.cancel(); _searchDebounce?.cancel();
// Set up new debounce timer
_searchDebounce = Timer(const Duration(milliseconds: 300), () { _searchDebounce = Timer(const Duration(milliseconds: 300), () {
context.read<SidebarBloc>().add(SearchRoomsEvent(value)); context.read<SidebarBloc>().add(SearchRoomsEvent(value));
}); });

View File

@ -253,8 +253,8 @@ int _parseHour(String? time, {required int defaultValue}) {
} }
try { try {
return int.parse(time.split(':')[0]); return int.parse(time.split(':')[0]);
} catch (e) { } catch (e) {
// Optionally log the error, e.g., print('Error parsing time: $e');
return defaultValue; return defaultValue;
} }
} }