Refactor color management and UI components for consistency

- Updated color references in various widgets to use the new `opaquePrimary` color for better visual consistency.
- Refactored `ColorsManager` to improve color definitions and removed redundant color declarations.
- Enhanced UI elements across multiple dialogs and widgets to ensure a cohesive design language.

This change promotes maintainability and aligns with the updated color scheme.
This commit is contained in:
Faris Armoush
2025-07-24 10:27:17 +03:00
parent 04d1c37308
commit 99924c1e62
164 changed files with 911 additions and 997 deletions

View File

@ -1,6 +1,7 @@
import 'package:calendar_view/calendar_view.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:calendar_view/calendar_view.dart';
import 'package:syncrow_web/pages/access_management/booking_system/data/services/memory_bookable_space_service.dart';
import 'package:syncrow_web/pages/access_management/booking_system/data/services/remote_calendar_service.dart';
import 'package:syncrow_web/pages/access_management/booking_system/domain/LoadEventsParam.dart';
import 'package:syncrow_web/pages/access_management/booking_system/presentation/bloc/calendar/events_bloc.dart';
@ -8,7 +9,6 @@ import 'package:syncrow_web/pages/access_management/booking_system/presentation/
import 'package:syncrow_web/pages/access_management/booking_system/presentation/bloc/date_selection/date_selection_event.dart';
import 'package:syncrow_web/pages/access_management/booking_system/presentation/bloc/date_selection/date_selection_state.dart';
import 'package:syncrow_web/pages/access_management/booking_system/presentation/bloc/selected_bookable_space_bloc/selected_bookable_space_bloc.dart';
import 'package:syncrow_web/pages/access_management/booking_system/data/services/memory_bookable_space_service.dart';
import 'package:syncrow_web/pages/access_management/booking_system/presentation/view/widgets/booking_sidebar.dart';
import 'package:syncrow_web/pages/access_management/booking_system/presentation/view/widgets/custom_calendar_page.dart';
import 'package:syncrow_web/pages/access_management/booking_system/presentation/view/widgets/icon_text_button.dart';
@ -114,7 +114,7 @@ class _BookingPageContentState extends State<_BookingPageContent> {
Expanded(
child: Container(
decoration: BoxDecoration(
color: ColorsManager.whiteColors,
color: ColorsManager.white,
boxShadow: [
BoxShadow(
color: ColorsManager.blackColor.withOpacity(0.1),
@ -142,8 +142,7 @@ class _BookingPageContentState extends State<_BookingPageContent> {
),
),
Expanded(
child:
BlocBuilder<DateSelectionBloc, DateSelectionState>(
child: BlocBuilder<DateSelectionBloc, DateSelectionState>(
builder: (context, dateState) {
return CustomCalendarPage(
selectedDate: dateState.selectedDate,
@ -152,8 +151,9 @@ class _BookingPageContentState extends State<_BookingPageContent> {
context
.read<DateSelectionBloc>()
.add(SelectDate(newDate));
context.read<DateSelectionBloc>().add(
SelectDateFromSidebarCalendar(newDate));
context
.read<DateSelectionBloc>()
.add(SelectDateFromSidebarCalendar(newDate));
},
);
},
@ -193,8 +193,7 @@ class _BookingPageContentState extends State<_BookingPageContent> {
BlocBuilder<DateSelectionBloc, DateSelectionState>(
builder: (context, state) {
final weekStart = state.weekStart;
final weekEnd =
weekStart.add(const Duration(days: 6));
final weekEnd = weekStart.add(const Duration(days: 6));
return WeekNavigation(
weekStart: weekStart,
weekEnd: weekEnd,
@ -204,9 +203,7 @@ class _BookingPageContentState extends State<_BookingPageContent> {
.add(PreviousWeek());
},
onNextWeek: () {
context
.read<DateSelectionBloc>()
.add(NextWeek());
context.read<DateSelectionBloc>().add(NextWeek());
},
);
},
@ -219,8 +216,7 @@ class _BookingPageContentState extends State<_BookingPageContent> {
child: BlocBuilder<SelectedBookableSpaceBloc,
SelectedBookableSpaceState>(
builder: (context, roomState) {
final selectedRoom =
roomState.selectedBookableSpace;
final selectedRoom = roomState.selectedBookableSpace;
return BlocBuilder<DateSelectionBloc,
DateSelectionState>(
builder: (context, dateState) {
@ -228,12 +224,10 @@ class _BookingPageContentState extends State<_BookingPageContent> {
CalendarEventState>(
builder: (context, eventState) {
return WeeklyCalendarPage(
key: ValueKey(
selectedRoom?.uuid ?? 'no-room'),
startTime: selectedRoom
?.bookableConfig.startTime,
endTime:
selectedRoom?.bookableConfig.endTime,
key: ValueKey(selectedRoom?.uuid ?? 'no-room'),
startTime:
selectedRoom?.bookableConfig.startTime,
endTime: selectedRoom?.bookableConfig.endTime,
weekStart: dateState.weekStart,
selectedDate: dateState.selectedDate,
eventController: _eventController,

View File

@ -80,7 +80,7 @@ class __SidebarContentState extends State<_SidebarContent> {
padding: const EdgeInsets.only(top: 10.0, bottom: 10.0),
child: Container(
decoration: BoxDecoration(
color: ColorsManager.whiteColors,
color: ColorsManager.white,
boxShadow: [
BoxShadow(
color: ColorsManager.blackColor.withOpacity(0.1),
@ -94,7 +94,7 @@ class __SidebarContentState extends State<_SidebarContent> {
),
Container(
decoration: BoxDecoration(
color: ColorsManager.whiteColors,
color: ColorsManager.white,
boxShadow: [
BoxShadow(
color: ColorsManager.blackColor.withOpacity(0.1),
@ -108,8 +108,8 @@ class __SidebarContentState extends State<_SidebarContent> {
padding: const EdgeInsets.all(8.0),
child: Container(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0, vertical: 8.0),
padding:
const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
child: Container(
decoration: BoxDecoration(
color: ColorsManager.counterBackgroundColor,
@ -119,12 +119,10 @@ class __SidebarContentState extends State<_SidebarContent> {
children: [
Expanded(
child: TextField(
style: Theme.of(context)
.textTheme
.bodyMedium
?.copyWith(
color: ColorsManager.blackColor,
),
style:
Theme.of(context).textTheme.bodyMedium?.copyWith(
color: ColorsManager.blackColor,
),
controller: searchController,
onChanged: _handleSearch,
decoration: InputDecoration(
@ -174,8 +172,7 @@ class __SidebarContentState extends State<_SidebarContent> {
Expanded(
child: ListView.builder(
controller: _scrollController,
itemCount:
state.displayedRooms.length + (state.hasMore ? 1 : 0),
itemCount: state.displayedRooms.length + (state.hasMore ? 1 : 0),
itemBuilder: (context, index) {
if (index == state.displayedRooms.length) {
return _buildLoadMoreIndicator(state);
@ -186,9 +183,7 @@ class __SidebarContentState extends State<_SidebarContent> {
room: room,
isSelected: state.selectedRoomId == room.uuid,
onTap: () {
context
.read<SidebarBloc>()
.add(SelectRoomEvent(room.uuid));
context.read<SidebarBloc>().add(SelectRoomEvent(room.uuid));
widget.onRoomSelected(room);
},
);