mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
Clean up booking system code: remove commented-out code and unnecessary variables for improved readability
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
// bookable_space_model.dart
|
||||
class BookableSpaceModel {
|
||||
final String uuid;
|
||||
final String spaceName;
|
||||
|
@ -9,7 +9,6 @@ class DebouncedBookingSystemService implements BookingSystemService {
|
||||
Timer? _debounceTimer;
|
||||
Completer<PaginatedBookableSpaces>? _lastCompleter;
|
||||
|
||||
// Store last parameters
|
||||
int? _lastPage;
|
||||
int? _lastSize;
|
||||
bool? _lastIncludeSpaces;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -216,7 +216,6 @@ class _BookingPageState extends State<BookingPage> {
|
||||
child: BlocBuilder<SelectedBookableSpaceBloc,
|
||||
SelectedBookableSpaceState>(
|
||||
builder: (context, roomState) {
|
||||
// NOTE: Assuming `SelectedBookableSpaceState` has a `selectedBookableSpace` property.
|
||||
final selectedRoom = roomState.selectedBookableSpace;
|
||||
return BlocBuilder<DateSelectionBloc,
|
||||
DateSelectionState>(
|
||||
|
@ -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<SidebarBloc>().add(SearchRoomsEvent(value));
|
||||
});
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user