mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-08-24 20:22:27 +00:00
param not params
This commit is contained in:
@ -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,
|
||||
|
@ -1,6 +1,6 @@
|
||||
class BookableSpacesParams {
|
||||
class BookableSpacesParam {
|
||||
final int currentPage;
|
||||
BookableSpacesParams({
|
||||
BookableSpacesParam({
|
||||
required this.currentPage,
|
||||
});
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ sealed class BookableSpacesEvent extends Equatable {
|
||||
}
|
||||
|
||||
class LoadBookableSpacesEvent extends BookableSpacesEvent {
|
||||
final BookableSpacesParams param;
|
||||
final BookableSpacesParam param;
|
||||
const LoadBookableSpacesEvent(this.param);
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ class _ManageBookableSpacesPageState extends State<ManageBookableSpacesPage> {
|
||||
RemoteBookableSpacesService(HTTPService()),
|
||||
)..add(
|
||||
LoadBookableSpacesEvent(
|
||||
BookableSpacesParams(currentPage: 1),
|
||||
BookableSpacesParam(currentPage: 1),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -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,
|
||||
|
@ -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),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
@ -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'))
|
||||
]);
|
||||
|
Reference in New Issue
Block a user