param not params

This commit is contained in:
Rafeek-Khoudare
2025-07-21 16:39:59 +03:00
parent dd425236f4
commit 0c0f26bec7
8 changed files with 14 additions and 15 deletions

View File

@ -13,7 +13,7 @@ class RemoteBookableSpacesService implements BookableSpacesService {
static const _defaultErrorMessage = 'Failed to load Bookable Spaces';
@override
Future<PaginatedDataModel<BookableSpacemodel>> load(
BookableSpacesParams param) async {
BookableSpacesParam param) async {
try {
final response = await _httpService.get(
path: ApiEndpoints.bookableSpaces,

View File

@ -1,6 +1,6 @@
class BookableSpacesParams {
class BookableSpacesParam {
final int currentPage;
BookableSpacesParams({
BookableSpacesParam({
required this.currentPage,
});

View File

@ -4,5 +4,5 @@ import 'package:syncrow_web/pages/space_management_v2/main_module/shared/models/
abstract class BookableSpacesService {
Future<PaginatedDataModel<BookableSpacemodel>> load(
BookableSpacesParams param);
BookableSpacesParam param);
}

View File

@ -8,7 +8,7 @@ sealed class BookableSpacesEvent extends Equatable {
}
class LoadBookableSpacesEvent extends BookableSpacesEvent {
final BookableSpacesParams param;
final BookableSpacesParam param;
const LoadBookableSpacesEvent(this.param);
}

View File

@ -33,7 +33,7 @@ class _ManageBookableSpacesPageState extends State<ManageBookableSpacesPage> {
RemoteBookableSpacesService(HTTPService()),
)..add(
LoadBookableSpacesEvent(
BookableSpacesParams(currentPage: 1),
BookableSpacesParam(currentPage: 1),
),
),
),

View File

@ -71,7 +71,7 @@ class ButtonsDividerBottomDialogWidget extends StatelessWidget {
);
context.read<BookableSpacesBloc>().add(
LoadBookableSpacesEvent(
BookableSpacesParams(currentPage: 1),
BookableSpacesParam(currentPage: 1),
),
);
} else if (nonBookableState is NonBookableSpacesError) {
@ -79,8 +79,7 @@ class ButtonsDividerBottomDialogWidget extends StatelessWidget {
SnackBar(
content: Text(
nonBookableState.error,
style:
const TextStyle(color: ColorsManager.red),
style: const TextStyle(color: ColorsManager.red),
),
duration: const Duration(seconds: 2),
behavior: SnackBarBehavior.floating,

View File

@ -25,7 +25,7 @@ class PaginationButtonsWidget extends StatelessWidget {
onTap: () {
context.read<BookableSpacesBloc>().add(
LoadBookableSpacesEvent(
BookableSpacesParams(currentPage: currentPage - 2),
BookableSpacesParam(currentPage: currentPage - 2),
),
);
},
@ -41,7 +41,7 @@ class PaginationButtonsWidget extends StatelessWidget {
onTap: () {
context.read<BookableSpacesBloc>().add(
LoadBookableSpacesEvent(
BookableSpacesParams(currentPage: currentPage - 1),
BookableSpacesParam(currentPage: currentPage - 1),
),
);
},
@ -59,7 +59,7 @@ class PaginationButtonsWidget extends StatelessWidget {
if (i != currentPage) {
context.read<BookableSpacesBloc>().add(
LoadBookableSpacesEvent(
BookableSpacesParams(currentPage: i),
BookableSpacesParam(currentPage: i),
),
);
}
@ -97,7 +97,7 @@ class PaginationButtonsWidget extends StatelessWidget {
onTap: () {
context.read<BookableSpacesBloc>().add(
LoadBookableSpacesEvent(
BookableSpacesParams(currentPage: currentPage + 1),
BookableSpacesParam(currentPage: currentPage + 1),
),
);
},
@ -113,7 +113,7 @@ class PaginationButtonsWidget extends StatelessWidget {
onTap: () {
context.read<BookableSpacesBloc>().add(
LoadBookableSpacesEvent(
BookableSpacesParams(currentPage: currentPage + 2),
BookableSpacesParam(currentPage: currentPage + 2),
),
);
},

View File

@ -28,7 +28,7 @@ class TableOfBookableSpacesWidget extends StatelessWidget {
onPressed: () => context
.read<BookableSpacesBloc>()
.add(LoadBookableSpacesEvent(
BookableSpacesParams(currentPage: 1),
BookableSpacesParam(currentPage: 1),
)),
child: const Text('Try Again'))
]);