first notes requests

This commit is contained in:
Rafeek-Khoudare
2025-07-16 10:35:16 +03:00
parent 6b8827f4d9
commit db157f30c5
12 changed files with 56 additions and 41 deletions

View File

@ -23,7 +23,7 @@ class BookableSpacesBloc
LoadBookableSpacesEvent event, Emitter<BookableSpacesState> emit) async {
emit(BookableSpacesLoading());
try {
final bookableSpaces = await bookableSpacesService.load(event.params);
final bookableSpaces = await bookableSpacesService.load(event.param);
emit(BookableSpacesLoaded(bookableSpacesList: bookableSpaces));
} on APIException catch (e) {
emit(BookableSpacesError(error: e.message));

View File

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

View File

@ -65,20 +65,21 @@ class ManageBookableSpacesWidget extends StatelessWidget {
child: Column(
children: [
Expanded(
flex: 10, child: TopPartWidget(pageController: pageController)),
flex: 10,
child: RowOfButtonsTitleWidget(pageController: pageController)),
const SizedBox(
height: 10,
),
const Expanded(
flex: 85,
child: TablePartWidget(),
child: TableOfBookableSpacesWidget(),
),
const SizedBox(
height: 5,
),
const Expanded(
flex: 5,
child: BottomPaginationPartWidget(),
child: PaginationButtonsWidget(),
),
],
),

View File

@ -12,24 +12,37 @@ import 'package:syncrow_web/pages/access_management/manage_bookable_spaces/prese
import 'package:syncrow_web/services/api/http_service.dart';
import 'package:syncrow_web/utils/color_manager.dart';
class SetupBookableSpacesDialog extends StatelessWidget {
final TextEditingController pointsController = TextEditingController();
class SetupBookableSpacesDialog extends StatefulWidget {
final BookableSpacemodel? editingBookableSpace;
SetupBookableSpacesDialog({
super.key,
this.editingBookableSpace,
});
@override
State<SetupBookableSpacesDialog> createState() =>
_SetupBookableSpacesDialogState();
}
class _SetupBookableSpacesDialogState extends State<SetupBookableSpacesDialog> {
final TextEditingController pointsController = TextEditingController();
@override
void dispose() {
pointsController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return MultiBlocProvider(
providers: [
BlocProvider<StepsCubit>(
create: editingBookableSpace == null
create: widget.editingBookableSpace == null
? (context) => StepsCubit()..initDialogValue()
: (context) => StepsCubit()..editValueInit(),
),
BlocProvider<NonBookableSpacesBloc>(
create: editingBookableSpace == null
create: widget.editingBookableSpace == null
? (context) => NonBookableSpacesBloc(
RemoteNonBookableSpaces(HTTPService()),
)..add(
@ -42,7 +55,7 @@ class SetupBookableSpacesDialog extends StatelessWidget {
RemoteNonBookableSpaces(HTTPService()),
)..add(
EditModeSelected(
editingBookableSpace: editingBookableSpace!),
editingBookableSpace: widget.editingBookableSpace!),
),
),
],
@ -81,7 +94,7 @@ class SetupBookableSpacesDialog extends StatelessWidget {
flex: 7,
child: DetailsStepsWidget(
pointsController: pointsController,
editingBookableSpace: editingBookableSpace,
editingBookableSpace: widget.editingBookableSpace,
),
)
],
@ -95,7 +108,7 @@ class SetupBookableSpacesDialog extends StatelessWidget {
: SaveSecondStepButton(
selectedSpaces: selectedSpaces,
pointsController: pointsController,
isEditingMode: editingBookableSpace != null,
isEditingMode: widget.editingBookableSpace != null,
);
}),
],

View File

@ -80,7 +80,7 @@ class ButtonsDividerBottomDialogWidget extends StatelessWidget {
content: Text(
nonBookableState.error,
style:
const TextStyle(color: ColorsManager.activeGreen),
const TextStyle(color: ColorsManager.red),
),
duration: const Duration(seconds: 2),
behavior: SnackBarBehavior.floating,

View File

@ -18,20 +18,16 @@ class DetailsStepsWidget extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 20),
child: BlocBuilder<StepsCubit, StepsState>(
builder: (context, state) {
if (state is StepOneState) {
return const SpacesStepDetailsWidget();
} else if (state is StepTwoState) {
return StepTwoDetailsWidget(
child: BlocBuilder<StepsCubit, StepsState>(builder: (context, state) {
return switch (state) {
StepOneState() => const SpacesStepDetailsWidget(),
StepTwoState() => StepTwoDetailsWidget(
pointsController: pointsController,
editingBookableSpace:editingBookableSpace
);
} else {
return const SizedBox();
}
},
),
editingBookableSpace: editingBookableSpace,
),
StepsInitial() => const SizedBox(),
};
}),
);
}
}

View File

@ -4,8 +4,8 @@ import 'package:syncrow_web/pages/access_management/manage_bookable_spaces/domai
import 'package:syncrow_web/pages/access_management/manage_bookable_spaces/presentation/blocs/bookable_spaces_bloc/bookable_spaces_bloc.dart';
import 'package:syncrow_web/utils/color_manager.dart';
class BottomPaginationPartWidget extends StatelessWidget {
const BottomPaginationPartWidget({super.key});
class PaginationButtonsWidget extends StatelessWidget {
const PaginationButtonsWidget({super.key});
@override
Widget build(BuildContext context) {

View File

@ -13,8 +13,8 @@ import 'package:syncrow_web/services/api/http_service.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/constants/assets.dart';
class TablePartWidget extends StatelessWidget {
const TablePartWidget({
class TableOfBookableSpacesWidget extends StatelessWidget {
const TableOfBookableSpacesWidget({
super.key,
});
@ -36,7 +36,7 @@ class TablePartWidget extends StatelessWidget {
.add(LoadBookableSpacesEvent(
BookableSpacesParams(currentPage: 1),
)),
child: const Text('try Again'))
child: const Text('Try Again'))
]);
} else if (state is BookableSpacesLoaded) {
return CustomDataTable<BookableSpacemodel>(

View File

@ -7,8 +7,8 @@ import 'package:syncrow_web/pages/access_management/manage_bookable_spaces/prese
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/constants/assets.dart';
class TopPartWidget extends StatelessWidget {
const TopPartWidget({
class RowOfButtonsTitleWidget extends StatelessWidget {
const RowOfButtonsTitleWidget({
super.key,
required this.pageController,
});

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:syncrow_web/utils/color_manager.dart';
class SearchUnbookableSpacesWidget extends StatelessWidget {
final String title;
@ -27,11 +28,11 @@ class SearchUnbookableSpacesWidget extends StatelessWidget {
height: height ?? 30,
padding: const EdgeInsets.only(top: 4),
decoration: BoxDecoration(
color: Colors.white,
color: ColorsManager.whiteColors,
borderRadius: BorderRadius.circular(12),
boxShadow: const [
BoxShadow(
color: Color(0x26000000),
color: ColorsManager.shadowOfSearchTextfield,
offset: Offset(0, 4),
blurRadius: 5,
),
@ -45,14 +46,15 @@ class SearchUnbookableSpacesWidget extends StatelessWidget {
contentPadding:
const EdgeInsets.symmetric(vertical: 5, horizontal: 15),
hintText: title,
hintStyle: const TextStyle(color: Colors.grey),
hintStyle: const TextStyle(color: ColorsManager.hintTextGrey),
border: InputBorder.none,
suffixIcon:
suffix ?? const Icon(Icons.search, size: 20, color: Colors.grey),
suffixIcon: suffix ??
const Icon(Icons.search,
size: 20, color: ColorsManager.hintTextGrey),
),
style: const TextStyle(
fontSize: 14,
color: Colors.grey,
color: ColorsManager.hintTextGrey,
),
),
);

View File

@ -80,7 +80,7 @@ class _SpacesStepDetailsWidgetState extends State<SpacesStepDetailsWidget> {
borderRadius: BorderRadius.circular(20),
boxShadow: const [
BoxShadow(
color: Color(0x40000000),
color: ColorsManager.shadowOfDetailsContainer,
offset: Offset.zero,
blurRadius: 5,
),

View File

@ -87,4 +87,7 @@ abstract class ColorsManager {
static const Color grey50 = Color(0xFF718096);
static const Color red100 = Color(0xFFFE0202);
static const Color grey800 = Color(0xffF8F8F8);
static const Color shadowOfSearchTextfield = Color(0x26000000);
static const Color hintTextGrey = Colors.grey;
static const Color shadowOfDetailsContainer = Color(0x40000000);
}