mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-08-25 14:29:41 +00:00
first notes requests
This commit is contained in:
@ -23,7 +23,7 @@ class BookableSpacesBloc
|
|||||||
LoadBookableSpacesEvent event, Emitter<BookableSpacesState> emit) async {
|
LoadBookableSpacesEvent event, Emitter<BookableSpacesState> emit) async {
|
||||||
emit(BookableSpacesLoading());
|
emit(BookableSpacesLoading());
|
||||||
try {
|
try {
|
||||||
final bookableSpaces = await bookableSpacesService.load(event.params);
|
final bookableSpaces = await bookableSpacesService.load(event.param);
|
||||||
emit(BookableSpacesLoaded(bookableSpacesList: bookableSpaces));
|
emit(BookableSpacesLoaded(bookableSpacesList: bookableSpaces));
|
||||||
} on APIException catch (e) {
|
} on APIException catch (e) {
|
||||||
emit(BookableSpacesError(error: e.message));
|
emit(BookableSpacesError(error: e.message));
|
||||||
|
@ -8,8 +8,8 @@ sealed class BookableSpacesEvent extends Equatable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class LoadBookableSpacesEvent extends BookableSpacesEvent {
|
class LoadBookableSpacesEvent extends BookableSpacesEvent {
|
||||||
final BookableSpacesParams params;
|
final BookableSpacesParams param;
|
||||||
const LoadBookableSpacesEvent(this.params);
|
const LoadBookableSpacesEvent(this.param);
|
||||||
}
|
}
|
||||||
|
|
||||||
class InsertUpdatedSpaceEvent extends BookableSpacesEvent {
|
class InsertUpdatedSpaceEvent extends BookableSpacesEvent {
|
||||||
|
@ -65,20 +65,21 @@ class ManageBookableSpacesWidget extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 10, child: TopPartWidget(pageController: pageController)),
|
flex: 10,
|
||||||
|
child: RowOfButtonsTitleWidget(pageController: pageController)),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 10,
|
height: 10,
|
||||||
),
|
),
|
||||||
const Expanded(
|
const Expanded(
|
||||||
flex: 85,
|
flex: 85,
|
||||||
child: TablePartWidget(),
|
child: TableOfBookableSpacesWidget(),
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 5,
|
height: 5,
|
||||||
),
|
),
|
||||||
const Expanded(
|
const Expanded(
|
||||||
flex: 5,
|
flex: 5,
|
||||||
child: BottomPaginationPartWidget(),
|
child: PaginationButtonsWidget(),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -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/services/api/http_service.dart';
|
||||||
import 'package:syncrow_web/utils/color_manager.dart';
|
import 'package:syncrow_web/utils/color_manager.dart';
|
||||||
|
|
||||||
class SetupBookableSpacesDialog extends StatelessWidget {
|
class SetupBookableSpacesDialog extends StatefulWidget {
|
||||||
final TextEditingController pointsController = TextEditingController();
|
|
||||||
final BookableSpacemodel? editingBookableSpace;
|
final BookableSpacemodel? editingBookableSpace;
|
||||||
SetupBookableSpacesDialog({
|
SetupBookableSpacesDialog({
|
||||||
super.key,
|
super.key,
|
||||||
this.editingBookableSpace,
|
this.editingBookableSpace,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<SetupBookableSpacesDialog> createState() =>
|
||||||
|
_SetupBookableSpacesDialogState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SetupBookableSpacesDialogState extends State<SetupBookableSpacesDialog> {
|
||||||
|
final TextEditingController pointsController = TextEditingController();
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
pointsController.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MultiBlocProvider(
|
return MultiBlocProvider(
|
||||||
providers: [
|
providers: [
|
||||||
BlocProvider<StepsCubit>(
|
BlocProvider<StepsCubit>(
|
||||||
create: editingBookableSpace == null
|
create: widget.editingBookableSpace == null
|
||||||
? (context) => StepsCubit()..initDialogValue()
|
? (context) => StepsCubit()..initDialogValue()
|
||||||
: (context) => StepsCubit()..editValueInit(),
|
: (context) => StepsCubit()..editValueInit(),
|
||||||
),
|
),
|
||||||
BlocProvider<NonBookableSpacesBloc>(
|
BlocProvider<NonBookableSpacesBloc>(
|
||||||
create: editingBookableSpace == null
|
create: widget.editingBookableSpace == null
|
||||||
? (context) => NonBookableSpacesBloc(
|
? (context) => NonBookableSpacesBloc(
|
||||||
RemoteNonBookableSpaces(HTTPService()),
|
RemoteNonBookableSpaces(HTTPService()),
|
||||||
)..add(
|
)..add(
|
||||||
@ -42,7 +55,7 @@ class SetupBookableSpacesDialog extends StatelessWidget {
|
|||||||
RemoteNonBookableSpaces(HTTPService()),
|
RemoteNonBookableSpaces(HTTPService()),
|
||||||
)..add(
|
)..add(
|
||||||
EditModeSelected(
|
EditModeSelected(
|
||||||
editingBookableSpace: editingBookableSpace!),
|
editingBookableSpace: widget.editingBookableSpace!),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -81,7 +94,7 @@ class SetupBookableSpacesDialog extends StatelessWidget {
|
|||||||
flex: 7,
|
flex: 7,
|
||||||
child: DetailsStepsWidget(
|
child: DetailsStepsWidget(
|
||||||
pointsController: pointsController,
|
pointsController: pointsController,
|
||||||
editingBookableSpace: editingBookableSpace,
|
editingBookableSpace: widget.editingBookableSpace,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@ -95,7 +108,7 @@ class SetupBookableSpacesDialog extends StatelessWidget {
|
|||||||
: SaveSecondStepButton(
|
: SaveSecondStepButton(
|
||||||
selectedSpaces: selectedSpaces,
|
selectedSpaces: selectedSpaces,
|
||||||
pointsController: pointsController,
|
pointsController: pointsController,
|
||||||
isEditingMode: editingBookableSpace != null,
|
isEditingMode: widget.editingBookableSpace != null,
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
@ -80,7 +80,7 @@ class ButtonsDividerBottomDialogWidget extends StatelessWidget {
|
|||||||
content: Text(
|
content: Text(
|
||||||
nonBookableState.error,
|
nonBookableState.error,
|
||||||
style:
|
style:
|
||||||
const TextStyle(color: ColorsManager.activeGreen),
|
const TextStyle(color: ColorsManager.red),
|
||||||
),
|
),
|
||||||
duration: const Duration(seconds: 2),
|
duration: const Duration(seconds: 2),
|
||||||
behavior: SnackBarBehavior.floating,
|
behavior: SnackBarBehavior.floating,
|
||||||
|
@ -18,20 +18,16 @@ class DetailsStepsWidget extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 20),
|
padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 20),
|
||||||
child: BlocBuilder<StepsCubit, StepsState>(
|
child: BlocBuilder<StepsCubit, StepsState>(builder: (context, state) {
|
||||||
builder: (context, state) {
|
return switch (state) {
|
||||||
if (state is StepOneState) {
|
StepOneState() => const SpacesStepDetailsWidget(),
|
||||||
return const SpacesStepDetailsWidget();
|
StepTwoState() => StepTwoDetailsWidget(
|
||||||
} else if (state is StepTwoState) {
|
|
||||||
return StepTwoDetailsWidget(
|
|
||||||
pointsController: pointsController,
|
pointsController: pointsController,
|
||||||
editingBookableSpace:editingBookableSpace
|
editingBookableSpace: editingBookableSpace,
|
||||||
);
|
),
|
||||||
} else {
|
StepsInitial() => const SizedBox(),
|
||||||
return const SizedBox();
|
};
|
||||||
}
|
}),
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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/pages/access_management/manage_bookable_spaces/presentation/blocs/bookable_spaces_bloc/bookable_spaces_bloc.dart';
|
||||||
import 'package:syncrow_web/utils/color_manager.dart';
|
import 'package:syncrow_web/utils/color_manager.dart';
|
||||||
|
|
||||||
class BottomPaginationPartWidget extends StatelessWidget {
|
class PaginationButtonsWidget extends StatelessWidget {
|
||||||
const BottomPaginationPartWidget({super.key});
|
const PaginationButtonsWidget({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -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/color_manager.dart';
|
||||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||||
|
|
||||||
class TablePartWidget extends StatelessWidget {
|
class TableOfBookableSpacesWidget extends StatelessWidget {
|
||||||
const TablePartWidget({
|
const TableOfBookableSpacesWidget({
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ class TablePartWidget extends StatelessWidget {
|
|||||||
.add(LoadBookableSpacesEvent(
|
.add(LoadBookableSpacesEvent(
|
||||||
BookableSpacesParams(currentPage: 1),
|
BookableSpacesParams(currentPage: 1),
|
||||||
)),
|
)),
|
||||||
child: const Text('try Again'))
|
child: const Text('Try Again'))
|
||||||
]);
|
]);
|
||||||
} else if (state is BookableSpacesLoaded) {
|
} else if (state is BookableSpacesLoaded) {
|
||||||
return CustomDataTable<BookableSpacemodel>(
|
return CustomDataTable<BookableSpacemodel>(
|
||||||
|
@ -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/color_manager.dart';
|
||||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||||
|
|
||||||
class TopPartWidget extends StatelessWidget {
|
class RowOfButtonsTitleWidget extends StatelessWidget {
|
||||||
const TopPartWidget({
|
const RowOfButtonsTitleWidget({
|
||||||
super.key,
|
super.key,
|
||||||
required this.pageController,
|
required this.pageController,
|
||||||
});
|
});
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:syncrow_web/utils/color_manager.dart';
|
||||||
|
|
||||||
class SearchUnbookableSpacesWidget extends StatelessWidget {
|
class SearchUnbookableSpacesWidget extends StatelessWidget {
|
||||||
final String title;
|
final String title;
|
||||||
@ -27,11 +28,11 @@ class SearchUnbookableSpacesWidget extends StatelessWidget {
|
|||||||
height: height ?? 30,
|
height: height ?? 30,
|
||||||
padding: const EdgeInsets.only(top: 4),
|
padding: const EdgeInsets.only(top: 4),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: ColorsManager.whiteColors,
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
boxShadow: const [
|
boxShadow: const [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Color(0x26000000),
|
color: ColorsManager.shadowOfSearchTextfield,
|
||||||
offset: Offset(0, 4),
|
offset: Offset(0, 4),
|
||||||
blurRadius: 5,
|
blurRadius: 5,
|
||||||
),
|
),
|
||||||
@ -45,14 +46,15 @@ class SearchUnbookableSpacesWidget extends StatelessWidget {
|
|||||||
contentPadding:
|
contentPadding:
|
||||||
const EdgeInsets.symmetric(vertical: 5, horizontal: 15),
|
const EdgeInsets.symmetric(vertical: 5, horizontal: 15),
|
||||||
hintText: title,
|
hintText: title,
|
||||||
hintStyle: const TextStyle(color: Colors.grey),
|
hintStyle: const TextStyle(color: ColorsManager.hintTextGrey),
|
||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
suffixIcon:
|
suffixIcon: suffix ??
|
||||||
suffix ?? const Icon(Icons.search, size: 20, color: Colors.grey),
|
const Icon(Icons.search,
|
||||||
|
size: 20, color: ColorsManager.hintTextGrey),
|
||||||
),
|
),
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: Colors.grey,
|
color: ColorsManager.hintTextGrey,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -80,7 +80,7 @@ class _SpacesStepDetailsWidgetState extends State<SpacesStepDetailsWidget> {
|
|||||||
borderRadius: BorderRadius.circular(20),
|
borderRadius: BorderRadius.circular(20),
|
||||||
boxShadow: const [
|
boxShadow: const [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Color(0x40000000),
|
color: ColorsManager.shadowOfDetailsContainer,
|
||||||
offset: Offset.zero,
|
offset: Offset.zero,
|
||||||
blurRadius: 5,
|
blurRadius: 5,
|
||||||
),
|
),
|
||||||
|
@ -87,4 +87,7 @@ abstract class ColorsManager {
|
|||||||
static const Color grey50 = Color(0xFF718096);
|
static const Color grey50 = Color(0xFF718096);
|
||||||
static const Color red100 = Color(0xFFFE0202);
|
static const Color red100 = Color(0xFFFE0202);
|
||||||
static const Color grey800 = Color(0xffF8F8F8);
|
static const Color grey800 = Color(0xffF8F8F8);
|
||||||
|
static const Color shadowOfSearchTextfield = Color(0x26000000);
|
||||||
|
static const Color hintTextGrey = Colors.grey;
|
||||||
|
static const Color shadowOfDetailsContainer = Color(0x40000000);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user