mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-08-25 14:29:41 +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';
|
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,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
class BookableSpacesParams {
|
class BookableSpacesParam {
|
||||||
final int currentPage;
|
final int currentPage;
|
||||||
BookableSpacesParams({
|
BookableSpacesParam({
|
||||||
required this.currentPage,
|
required this.currentPage,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ class _ManageBookableSpacesPageState extends State<ManageBookableSpacesPage> {
|
|||||||
RemoteBookableSpacesService(HTTPService()),
|
RemoteBookableSpacesService(HTTPService()),
|
||||||
)..add(
|
)..add(
|
||||||
LoadBookableSpacesEvent(
|
LoadBookableSpacesEvent(
|
||||||
BookableSpacesParams(currentPage: 1),
|
BookableSpacesParam(currentPage: 1),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -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,
|
||||||
|
@ -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),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -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'))
|
||||||
]);
|
]);
|
||||||
|
Reference in New Issue
Block a user