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'; static const _defaultErrorMessage = 'Failed to load Bookable Spaces';
@override @override
Future<PaginatedDataModel<BookableSpacemodel>> load( Future<PaginatedDataModel<BookableSpacemodel>> load(
BookableSpacesParams param) async { BookableSpacesParam param) async {
try { try {
final response = await _httpService.get( final response = await _httpService.get(
path: ApiEndpoints.bookableSpaces, path: ApiEndpoints.bookableSpaces,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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