mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +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 {
|
class BookableSpaceModel {
|
||||||
final String uuid;
|
final String uuid;
|
||||||
final String spaceName;
|
final String spaceName;
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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>(
|
||||||
|
@ -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));
|
||||||
});
|
});
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user