Compare commits

..

1 Commits

177 changed files with 1187 additions and 1177 deletions

View File

@ -66,7 +66,7 @@ class _DialogDropdownState extends State<DialogDropdown> {
child: Material( child: Material(
elevation: 4.0, elevation: 4.0,
child: Container( child: Container(
color: ColorsManager.white, color: ColorsManager.whiteColors,
constraints: const BoxConstraints( constraints: const BoxConstraints(
maxHeight: 200.0, // Set max height for dropdown maxHeight: 200.0, // Set max height for dropdown
), ),
@ -87,10 +87,12 @@ class _DialogDropdownState extends State<DialogDropdown> {
child: ListTile( child: ListTile(
title: Text( title: Text(
item, item,
style: style: Theme.of(context)
Theme.of(context).textTheme.bodyMedium?.copyWith( .textTheme
color: ColorsManager.textPrimaryColor, .bodyMedium
), ?.copyWith(
color: ColorsManager.textPrimaryColor,
),
), ),
onTap: () { onTap: () {
widget.onSelected(item); widget.onSelected(item);

View File

@ -14,7 +14,7 @@ class EditChip extends StatelessWidget {
this.label = 'Edit', this.label = 'Edit',
required this.onTap, required this.onTap,
this.labelColor = ColorsManager.spaceColor, this.labelColor = ColorsManager.spaceColor,
this.backgroundColor = ColorsManager.white, this.backgroundColor = ColorsManager.whiteColors,
this.borderColor = ColorsManager.spaceColor, this.borderColor = ColorsManager.spaceColor,
this.borderRadius = 16.0, this.borderRadius = 16.0,
}) : super(key: key); }) : super(key: key);
@ -24,9 +24,10 @@ class EditChip extends StatelessWidget {
return GestureDetector( return GestureDetector(
onTap: onTap, onTap: onTap,
child: Chip( child: Chip(
label: Text(label, label: Text(
style: label,
Theme.of(context).textTheme.bodySmall!.copyWith(color: labelColor)), style: Theme.of(context).textTheme.bodySmall!.copyWith(color: labelColor)
),
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(borderRadius), borderRadius: BorderRadius.circular(borderRadius),

View File

@ -17,7 +17,8 @@ class TagDialogTextfieldDropdown extends StatefulWidget {
}) : super(key: key); }) : super(key: key);
@override @override
_DialogTextfieldDropdownState createState() => _DialogTextfieldDropdownState(); _DialogTextfieldDropdownState createState() =>
_DialogTextfieldDropdownState();
} }
class _DialogTextfieldDropdownState extends State<TagDialogTextfieldDropdown> { class _DialogTextfieldDropdownState extends State<TagDialogTextfieldDropdown> {
@ -96,7 +97,7 @@ class _DialogTextfieldDropdownState extends State<TagDialogTextfieldDropdown> {
child: Material( child: Material(
elevation: 4.0, elevation: 4.0,
child: Container( child: Container(
color: ColorsManager.white, color: ColorsManager.whiteColors,
constraints: const BoxConstraints(maxHeight: 200.0), constraints: const BoxConstraints(maxHeight: 200.0),
child: StatefulBuilder( child: StatefulBuilder(
builder: (context, setStateDropdown) { builder: (context, setStateDropdown) {
@ -121,7 +122,8 @@ class _DialogTextfieldDropdownState extends State<TagDialogTextfieldDropdown> {
.textTheme .textTheme
.bodyMedium .bodyMedium
?.copyWith( ?.copyWith(
color: ColorsManager.textPrimaryColor)), color: ColorsManager
.textPrimaryColor)),
onTap: () { onTap: () {
_controller.text = tag.tag ?? ''; _controller.text = tag.tag ?? '';
widget.onSelected(tag); widget.onSelected(tag);

View File

@ -5,20 +5,19 @@ class CustomExpansionTile extends StatefulWidget {
final String title; final String title;
final List<Widget>? children; final List<Widget>? children;
final bool initiallyExpanded; final bool initiallyExpanded;
final bool isSelected; final bool isSelected; // Add this to track selection
final bool? isExpanded; final bool? isExpanded; // External control over expansion
final ValueChanged<bool>? onExpansionChanged; final ValueChanged<bool>? onExpansionChanged; // Notify when expansion changes
final VoidCallback? onItemSelected; final VoidCallback? onItemSelected; // Callback for selecting the item
const CustomExpansionTile({ CustomExpansionTile({
super.key,
required this.title, required this.title,
this.children, this.children,
this.initiallyExpanded = false, this.initiallyExpanded = false,
this.isExpanded, this.isExpanded, // Allow external control over expansion
this.onExpansionChanged, this.onExpansionChanged, // Notify when expansion changes
this.onItemSelected, this.onItemSelected, // Trigger item selection when name is tapped
required this.isSelected, required this.isSelected, // Add this to initialize selection state
}); });
@override @override
@ -26,7 +25,7 @@ class CustomExpansionTile extends StatefulWidget {
} }
class CustomExpansionTileState extends State<CustomExpansionTile> { class CustomExpansionTileState extends State<CustomExpansionTile> {
bool _isExpanded = false; bool _isExpanded = false; // Local expansion state
@override @override
void initState() { void initState() {
@ -37,6 +36,7 @@ class CustomExpansionTileState extends State<CustomExpansionTile> {
@override @override
void didUpdateWidget(CustomExpansionTile oldWidget) { void didUpdateWidget(CustomExpansionTile oldWidget) {
super.didUpdateWidget(oldWidget); super.didUpdateWidget(oldWidget);
// Sync local state with external control of expansion state
if (widget.isExpanded != null && widget.isExpanded != _isExpanded) { if (widget.isExpanded != null && widget.isExpanded != _isExpanded) {
setState(() { setState(() {
_isExpanded = widget.isExpanded!; _isExpanded = widget.isExpanded!;
@ -44,6 +44,7 @@ class CustomExpansionTileState extends State<CustomExpansionTile> {
} }
} }
// Utility function to capitalize the first letter of the title
String _capitalizeFirstLetter(String text) { String _capitalizeFirstLetter(String text) {
if (text.isEmpty) return text; if (text.isEmpty) return text;
return text[0].toUpperCase() + text.substring(1); return text[0].toUpperCase() + text.substring(1);
@ -55,6 +56,7 @@ class CustomExpansionTileState extends State<CustomExpansionTile> {
children: [ children: [
Row( Row(
children: [ children: [
// Expand/collapse icon, now wrapped in a GestureDetector for specific onTap
if (widget.children != null && widget.children!.isNotEmpty) if (widget.children != null && widget.children!.isNotEmpty)
GestureDetector( GestureDetector(
onTap: () { onTap: () {
@ -68,33 +70,38 @@ class CustomExpansionTileState extends State<CustomExpansionTile> {
? Icons.keyboard_arrow_down ? Icons.keyboard_arrow_down
: Icons.keyboard_arrow_right, : Icons.keyboard_arrow_right,
color: ColorsManager.lightGrayColor, color: ColorsManager.lightGrayColor,
size: 16, size: 16.0, // Adjusted size for better alignment
), ),
), ),
// The title text, wrapped in GestureDetector to handle selection
Expanded( Expanded(
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
if (widget.onItemSelected != null) { if (widget.onItemSelected != null) {
widget.onItemSelected!.call(); widget.onItemSelected!();
} }
}, },
child: Text( child: Text(
_capitalizeFirstLetter(widget.title), _capitalizeFirstLetter(widget.title),
style: TextStyle( style: TextStyle(
color: widget.isSelected color: widget.isSelected
? ColorsManager.blackColor ? ColorsManager
: ColorsManager.lightGrayColor, .blackColor // Change color to black when selected
fontWeight: : ColorsManager
widget.isSelected ? FontWeight.w600 : FontWeight.w400, .lightGrayColor, // Gray when not selected
fontWeight: FontWeight.w400,
), ),
), ),
), ),
), ),
], ],
), ),
if (_isExpanded && widget.children != null && widget.children!.isNotEmpty) // The expanded section (children) that shows when the tile is expanded
if (_isExpanded &&
widget.children != null &&
widget.children!.isNotEmpty)
Padding( Padding(
padding: const EdgeInsets.only(left: 24), padding: const EdgeInsets.only(left: 24.0), // Indented children
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: widget.children!, children: widget.children!,

View File

@ -7,7 +7,7 @@ class CustomSearchBar extends StatefulWidget {
final TextEditingController? controller; final TextEditingController? controller;
final String hintText; final String hintText;
final String? searchQuery; final String? searchQuery;
final void Function(String)? onSearchChanged; final Function(String)? onSearchChanged; // Callback for search input changes
const CustomSearchBar({ const CustomSearchBar({
super.key, super.key,
@ -34,10 +34,10 @@ class _CustomSearchBarState extends State<CustomSearchBar> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: ColorsManager.white, color: ColorsManager.whiteColors,
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: ColorsManager.shadowBlackColor.withValues(alpha: 0.1), color: Colors.black.withOpacity(0.2),
spreadRadius: 0, spreadRadius: 0,
blurRadius: 8, blurRadius: 8,
offset: const Offset(0, 4), offset: const Offset(0, 4),
@ -57,7 +57,7 @@ class _CustomSearchBarState extends State<CustomSearchBar> {
style: const TextStyle( style: const TextStyle(
color: Colors.black, color: Colors.black,
), ),
onChanged: widget.onSearchChanged, onChanged: widget.onSearchChanged, // Call the callback on text change
decoration: InputDecoration( decoration: InputDecoration(
filled: true, filled: true,
fillColor: ColorsManager.textFieldGreyColor, fillColor: ColorsManager.textFieldGreyColor,

View File

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

View File

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

View File

@ -52,20 +52,21 @@ class _SetupBookableSpacesDialogState extends State<SetupBookableSpacesDialog> {
), ),
)..add( )..add(
LoadUnBookableSpacesEvent( LoadUnBookableSpacesEvent(
nonBookableSpacesParams: NonBookableSpacesParams(currentPage: 1), nonBookableSpacesParams:
NonBookableSpacesParams(currentPage: 1),
), ),
), ),
), ),
BlocProvider<SetupBookableSpacesBloc>( BlocProvider<SetupBookableSpacesBloc>(
create: widget.editingBookableSpace == null create: widget.editingBookableSpace == null
? (context) => ? (context) => SetupBookableSpacesBloc(
SetupBookableSpacesBloc(RemoteNonBookableSpaces(HTTPService())) RemoteNonBookableSpaces(HTTPService()))
: (context) => : (context) => SetupBookableSpacesBloc(
SetupBookableSpacesBloc(RemoteNonBookableSpaces(HTTPService())) RemoteNonBookableSpaces(HTTPService()))
..add( ..add(
EditModeSelected( EditModeSelected(
editingBookableSpace: widget.editingBookableSpace!), editingBookableSpace: widget.editingBookableSpace!),
), ),
), ),
BlocProvider( BlocProvider(
create: (context) => SendBookableSpacesBloc( create: (context) => SendBookableSpacesBloc(
@ -74,7 +75,7 @@ class _SetupBookableSpacesDialogState extends State<SetupBookableSpacesDialog> {
) )
], ],
child: AlertDialog( child: AlertDialog(
backgroundColor: ColorsManager.white, backgroundColor: ColorsManager.whiteColors,
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
title: Center( title: Center(
child: Text( child: Text(

View File

@ -21,14 +21,16 @@ class BookableSpaceSwitchActivationWidget extends StatelessWidget {
return Center( return Center(
child: Transform.scale( child: Transform.scale(
scale: 0.7, scale: 0.7,
child: BlocConsumer<UpdateBookableSpacesBloc, UpdateBookableSpacesState>( child:
BlocConsumer<UpdateBookableSpacesBloc, UpdateBookableSpacesState>(
listener: (context, updateState) { listener: (context, updateState) {
if (updateState is UpdateBookableSpaceSuccess) { if (updateState is UpdateBookableSpaceSuccess) {
context.read<BookableSpacesBloc>().add( context.read<BookableSpacesBloc>().add(
InsertUpdatedSpaceEvent( InsertUpdatedSpaceEvent(
bookableSpaces: bookableSpaces, bookableSpaces: bookableSpaces,
bookableSpace: space, bookableSpace: space,
updatedBookableSpaceConfig: updateState.bookableSpaceConfig, updatedBookableSpaceConfig:
updateState.bookableSpaceConfig,
), ),
); );
} }
@ -40,16 +42,16 @@ class BookableSpaceSwitchActivationWidget extends StatelessWidget {
return const Center(child: CircularProgressIndicator()); return const Center(child: CircularProgressIndicator());
} }
return Switch( return Switch(
trackOutlineColor: trackOutlineColor: WidgetStateProperty.resolveWith<Color>(
WidgetStateProperty.resolveWith<Color>((Set<WidgetState> states) { (Set<WidgetState> states) {
return ColorsManager.white; return ColorsManager.whiteColors;
}), }),
value: space.spaceConfig!.availability, value: space.spaceConfig!.availability,
activeTrackColor: ColorsManager.dialogBlueTitle, activeTrackColor: ColorsManager.dialogBlueTitle,
inactiveTrackColor: ColorsManager.grayBorder, inactiveTrackColor: ColorsManager.grayBorder,
thumbColor: thumbColor: WidgetStateProperty.resolveWith<Color>(
WidgetStateProperty.resolveWith<Color>((Set<WidgetState> states) { (Set<WidgetState> states) {
return ColorsManager.white; return ColorsManager.whiteColors;
}), }),
onChanged: (value) { onChanged: (value) {
context.read<UpdateBookableSpacesBloc>().add( context.read<UpdateBookableSpacesBloc>().add(

View File

@ -68,7 +68,7 @@ class PaginationButtonsWidget extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: i == currentPage color: i == currentPage
? ColorsManager.dialogBlueTitle ? ColorsManager.dialogBlueTitle
: ColorsManager.white, : ColorsManager.whiteColors,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: Border.all( border: Border.all(
color: ColorsManager.lightGrayBorderColor, color: ColorsManager.lightGrayBorderColor,
@ -77,8 +77,9 @@ class PaginationButtonsWidget extends StatelessWidget {
'$i', '$i',
style: TextStyle( style: TextStyle(
color: i == currentPage ? Colors.white : Colors.black, color: i == currentPage ? Colors.white : Colors.black,
fontWeight: fontWeight: i == currentPage
i == currentPage ? FontWeight.bold : FontWeight.normal, ? FontWeight.bold
: FontWeight.normal,
), ),
), ),
), ),
@ -128,7 +129,8 @@ class PaginationButtonsWidget extends StatelessWidget {
); );
} }
Widget _buildArrowButton({required String label, required VoidCallback onTap}) { Widget _buildArrowButton(
{required String label, required VoidCallback onTap}) {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 4), padding: const EdgeInsets.symmetric(horizontal: 4),
child: GestureDetector( child: GestureDetector(
@ -138,7 +140,7 @@ class PaginationButtonsWidget extends StatelessWidget {
height: 30, height: 30,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: ColorsManager.white, color: ColorsManager.whiteColors,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: Border.all( border: Border.all(
color: ColorsManager.lightGrayBorderColor, color: ColorsManager.lightGrayBorderColor,

View File

@ -62,13 +62,16 @@ class _PointsPartWidgetState extends State<PointsPartWidget> {
scale: 0.7, scale: 0.7,
child: Switch( child: Switch(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
trackOutlineColor: WidgetStateProperty.all(ColorsManager.white), trackOutlineColor:
WidgetStateProperty.all(ColorsManager.whiteColors),
activeTrackColor: ColorsManager.dialogBlueTitle, activeTrackColor: ColorsManager.dialogBlueTitle,
inactiveTrackColor: ColorsManager.lightGrayBorderColor, inactiveTrackColor: ColorsManager.lightGrayBorderColor,
thumbColor: WidgetStateProperty.all(ColorsManager.white), thumbColor:
WidgetStateProperty.all(ColorsManager.whiteColors),
value: isSwitchOn, value: isSwitchOn,
onChanged: (value) { onChanged: (value) {
final toggleCubit = context.read<TogglePointsSwitchCubit>(); final toggleCubit =
context.read<TogglePointsSwitchCubit>();
final bloc = context.read<SetupBookableSpacesBloc>(); final bloc = context.read<SetupBookableSpacesBloc>();
final updatedCost = value ? -1 : 0; final updatedCost = value ? -1 : 0;

View File

@ -36,11 +36,12 @@ class SearchUnbookableSpacesWidget extends StatelessWidget {
height: height ?? 40, height: height ?? 40,
padding: const EdgeInsets.only(top: 4), padding: const EdgeInsets.only(top: 4),
decoration: BoxDecoration( decoration: BoxDecoration(
color: ColorsManager.white, color: ColorsManager.whiteColors,
borderRadius: BorderRadius.circular(raduis ?? 15), borderRadius: BorderRadius.circular(raduis ?? 15),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: ColorsManager.shadowOfSearchTextfield.withValues(alpha: 0.15), color:
ColorsManager.shadowOfSearchTextfield.withValues(alpha: 0.15),
offset: Offset.zero, offset: Offset.zero,
blurRadius: blur ?? 5, blurRadius: blur ?? 5,
spreadRadius: 0, spreadRadius: 0,

View File

@ -33,7 +33,7 @@ class StepperPartWidget extends StatelessWidget {
const CircleTitleStepperWidget( const CircleTitleStepperWidget(
title: 'Settings', title: 'Settings',
titleColor: ColorsManager.softGray, titleColor: ColorsManager.softGray,
circleColor: ColorsManager.white, circleColor: ColorsManager.whiteColors,
borderColor: ColorsManager.textGray, borderColor: ColorsManager.textGray,
) )
], ],
@ -49,7 +49,7 @@ class StepperPartWidget extends StatelessWidget {
titleColor: ColorsManager.softGray, titleColor: ColorsManager.softGray,
cicleIcon: Icon( cicleIcon: Icon(
Icons.check, Icons.check,
color: ColorsManager.white, color: ColorsManager.whiteColors,
size: 12, size: 12,
), ),
circleColor: ColorsManager.trueIconGreen, circleColor: ColorsManager.trueIconGreen,

View File

@ -104,7 +104,7 @@ abstract final class RangeOfAqiChartsHelper {
) { ) {
return LineTouchData( return LineTouchData(
touchTooltipData: LineTouchTooltipData( touchTooltipData: LineTouchTooltipData(
getTooltipColor: (touchTooltipItem) => ColorsManager.white, getTooltipColor: (touchTooltipItem) => ColorsManager.whiteColors,
tooltipBorder: const BorderSide( tooltipBorder: const BorderSide(
color: ColorsManager.semiTransparentBlack, color: ColorsManager.semiTransparentBlack,
), ),

View File

@ -77,7 +77,7 @@ class AqiDistributionChart extends StatelessWidget {
BarTouchData _barTouchData(BuildContext context) { BarTouchData _barTouchData(BuildContext context) {
return BarTouchData( return BarTouchData(
touchTooltipData: BarTouchTooltipData( touchTooltipData: BarTouchTooltipData(
getTooltipColor: (_) => ColorsManager.white, getTooltipColor: (_) => ColorsManager.whiteColors,
tooltipBorder: const BorderSide( tooltipBorder: const BorderSide(
color: ColorsManager.semiTransparentBlack, color: ColorsManager.semiTransparentBlack,
), ),

View File

@ -65,7 +65,7 @@ class AqiGauge extends StatelessWidget {
pointer: GaugePointer.circle( pointer: GaugePointer.circle(
position: const GaugePointerPosition.surface(), position: const GaugePointerPosition.surface(),
radius: MediaQuery.sizeOf(context).width * 0.004, radius: MediaQuery.sizeOf(context).width * 0.004,
color: ColorsManager.white, color: ColorsManager.whiteColors,
border: GaugePointerBorder( border: GaugePointerBorder(
width: 6, width: 6,
color: statusColor, color: statusColor,

View File

@ -20,7 +20,7 @@ class AqiLocationInfoCell extends StatelessWidget {
return Expanded( return Expanded(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: ColorsManager.white, color: ColorsManager.whiteColors,
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
), ),
child: Stack( child: Stack(

View File

@ -62,7 +62,7 @@ class AqiSubValueWidget extends StatelessWidget {
child: Container( child: Container(
padding: const EdgeInsetsDirectional.all(10), padding: const EdgeInsetsDirectional.all(10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: ColorsManager.white, color: ColorsManager.whiteColors,
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
), ),
child: Row( child: Row(

View File

@ -46,7 +46,7 @@ class _AqiTypeDropdownState extends State<AqiTypeDropdown> {
value: widget.selectedAqiType, value: widget.selectedAqiType,
isDense: true, isDense: true,
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
dropdownColor: ColorsManager.white, dropdownColor: ColorsManager.whiteColors,
underline: const SizedBox.shrink(), underline: const SizedBox.shrink(),
icon: const RotatedBox( icon: const RotatedBox(
quarterTurns: 1, quarterTurns: 1,

View File

@ -107,7 +107,7 @@ class RangeOfAqiChart extends StatelessWidget {
show: true, show: true,
getDotPainter: (_, __, ___, ____) => FlDotCirclePainter( getDotPainter: (_, __, ___, ____) => FlDotCirclePainter(
radius: 2, radius: 2,
color: ColorsManager.white, color: ColorsManager.whiteColors,
strokeWidth: 2, strokeWidth: 2,
strokeColor: color, strokeColor: color,
), ),

View File

@ -45,7 +45,7 @@ class _MonthPickerWidgetState extends State<MonthPickerWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Dialog( return Dialog(
backgroundColor: ColorsManager.white, backgroundColor: ColorsManager.whiteColors,
child: Container( child: Container(
padding: const EdgeInsetsDirectional.all(20), padding: const EdgeInsetsDirectional.all(20),
width: 320, width: 320,
@ -108,7 +108,7 @@ class _MonthPickerWidgetState extends State<MonthPickerWidget> {
style: context.textTheme.titleSmall?.copyWith( style: context.textTheme.titleSmall?.copyWith(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: ColorsManager.white, color: ColorsManager.whiteColors,
), ),
), ),
), ),
@ -217,7 +217,7 @@ class _MonthPickerWidgetState extends State<MonthPickerWidget> {
style: context.textTheme.titleSmall?.copyWith( style: context.textTheme.titleSmall?.copyWith(
fontSize: 12, fontSize: 12,
color: isSelected color: isSelected
? ColorsManager.white ? ColorsManager.whiteColors
: isFutureMonth : isFutureMonth
? ColorsManager.blackColor.withValues(alpha: 0.3) ? ColorsManager.blackColor.withValues(alpha: 0.3)
: ColorsManager.blackColor.withValues(alpha: 0.8), : ColorsManager.blackColor.withValues(alpha: 0.8),

View File

@ -59,7 +59,7 @@ class _AnalyticsSpaceTreeViewState extends State<AnalyticsSpaceTreeView> {
: state.communityList; : state.communityList;
return Container( return Container(
height: MediaQuery.sizeOf(context).height, height: MediaQuery.sizeOf(context).height,
decoration: const BoxDecoration(color: ColorsManager.white), decoration: const BoxDecoration(color: ColorsManager.whiteColors),
child: state is SpaceTreeLoadingState child: state is SpaceTreeLoadingState
? const Center(child: CircularProgressIndicator()) ? const Center(child: CircularProgressIndicator())
: Column( : Column(

View File

@ -33,7 +33,7 @@ class _YearPickerWidgetState extends State<YearPickerWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Dialog( return Dialog(
backgroundColor: ColorsManager.white, backgroundColor: ColorsManager.whiteColors,
child: Container( child: Container(
padding: const EdgeInsetsDirectional.all(20), padding: const EdgeInsetsDirectional.all(20),
width: 320, width: 320,
@ -92,7 +92,7 @@ class _YearPickerWidgetState extends State<YearPickerWidget> {
style: context.textTheme.titleSmall?.copyWith( style: context.textTheme.titleSmall?.copyWith(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: ColorsManager.white, color: ColorsManager.whiteColors,
), ),
), ),
), ),
@ -144,7 +144,7 @@ class _YearPickerWidgetState extends State<YearPickerWidget> {
style: context.textTheme.titleSmall?.copyWith( style: context.textTheme.titleSmall?.copyWith(
fontSize: 12, fontSize: 12,
color: isSelected color: isSelected
? ColorsManager.white ? ColorsManager.whiteColors
: ColorsManager.blackColor.withValues(alpha: 0.8), : ColorsManager.blackColor.withValues(alpha: 0.8),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),

View File

@ -81,7 +81,7 @@ abstract final class EnergyManagementChartsHelper {
static LineTouchTooltipData lineTouchTooltipData() { static LineTouchTooltipData lineTouchTooltipData() {
return LineTouchTooltipData( return LineTouchTooltipData(
getTooltipColor: (touchTooltipItem) => ColorsManager.white, getTooltipColor: (touchTooltipItem) => ColorsManager.whiteColors,
tooltipBorder: const BorderSide(color: ColorsManager.semiTransparentBlack), tooltipBorder: const BorderSide(color: ColorsManager.semiTransparentBlack),
tooltipRoundedRadius: 16, tooltipRoundedRadius: 16,
showOnTopOfTheChartBoxArea: false, showOnTopOfTheChartBoxArea: false,

View File

@ -72,7 +72,7 @@ class AnalyticsDeviceDropdown extends StatelessWidget {
value: state.selectedDevice, value: state.selectedDevice,
isDense: true, isDense: true,
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
dropdownColor: ColorsManager.white, dropdownColor: ColorsManager.whiteColors,
underline: const SizedBox.shrink(), underline: const SizedBox.shrink(),
icon: const RotatedBox( icon: const RotatedBox(
quarterTurns: 1, quarterTurns: 1,

View File

@ -18,6 +18,7 @@ class EnergyConsumptionByPhasesChart extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BarChart( return BarChart(
BarChartData( BarChartData(
gridData: EnergyManagementChartsHelper.gridData().copyWith( gridData: EnergyManagementChartsHelper.gridData().copyWith(
checkToShowHorizontalLine: (value) => true, checkToShowHorizontalLine: (value) => true,
horizontalInterval: 250, horizontalInterval: 250,
@ -73,7 +74,7 @@ class EnergyConsumptionByPhasesChart extends StatelessWidget {
BarTouchData _barTouchData(BuildContext context) { BarTouchData _barTouchData(BuildContext context) {
return BarTouchData( return BarTouchData(
touchTooltipData: BarTouchTooltipData( touchTooltipData: BarTouchTooltipData(
getTooltipColor: (touchTooltipItem) => ColorsManager.white, getTooltipColor: (touchTooltipItem) => ColorsManager.whiteColors,
tooltipBorder: const BorderSide( tooltipBorder: const BorderSide(
color: ColorsManager.semiTransparentBlack, color: ColorsManager.semiTransparentBlack,
), ),

View File

@ -34,7 +34,7 @@ class HeatMapTooltip extends StatelessWidget {
style: context.textTheme.bodySmall?.copyWith( style: context.textTheme.bodySmall?.copyWith(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: ColorsManager.white, color: ColorsManager.whiteColors,
), ),
), ),
const Divider(height: 2, thickness: 1), const Divider(height: 2, thickness: 1),
@ -43,7 +43,7 @@ class HeatMapTooltip extends StatelessWidget {
style: context.textTheme.bodySmall?.copyWith( style: context.textTheme.bodySmall?.copyWith(
fontSize: 10, fontSize: 10,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: ColorsManager.white, color: ColorsManager.whiteColors,
), ),
), ),
], ],

View File

@ -64,7 +64,7 @@ class OccupancyChart extends StatelessWidget {
BarTouchData _barTouchData(BuildContext context) { BarTouchData _barTouchData(BuildContext context) {
return BarTouchData( return BarTouchData(
touchTooltipData: BarTouchTooltipData( touchTooltipData: BarTouchTooltipData(
getTooltipColor: (touchTooltipItem) => ColorsManager.white, getTooltipColor: (touchTooltipItem) => ColorsManager.whiteColors,
tooltipBorder: const BorderSide( tooltipBorder: const BorderSide(
color: ColorsManager.semiTransparentBlack, color: ColorsManager.semiTransparentBlack,
), ),

View File

@ -121,8 +121,7 @@ class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout
const Spacer(), const Spacer(),
Expanded( Expanded(
flex: 2, flex: 2,
child: child: _buildLoginFormFields(context, loginBloc, size),
_buildLoginFormFields(context, loginBloc, size),
), ),
const Spacer(), const Spacer(),
], ],
@ -148,8 +147,8 @@ class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout
child: Form( child: Form(
key: loginBloc.loginFormKey, key: loginBloc.loginFormKey,
child: Padding( child: Padding(
padding: EdgeInsets.symmetric( padding:
horizontal: size.width * 0.02, vertical: size.width * 0.003), EdgeInsets.symmetric(horizontal: size.width * 0.02, vertical: size.width * 0.003),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -304,8 +303,10 @@ class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout
decoration: textBoxDecoration()!.copyWith( decoration: textBoxDecoration()!.copyWith(
errorStyle: const TextStyle(height: 0), errorStyle: const TextStyle(height: 0),
hintText: 'Enter your email address', hintText: 'Enter your email address',
hintStyle: Theme.of(context).textTheme.bodySmall!.copyWith( hintStyle: Theme.of(context)
color: ColorsManager.grayColor, fontWeight: FontWeight.w400)), .textTheme
.bodySmall!
.copyWith(color: ColorsManager.grayColor, fontWeight: FontWeight.w400)),
style: const TextStyle(color: Colors.black), style: const TextStyle(color: Colors.black),
), ),
), ),
@ -337,7 +338,7 @@ class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout
controller: loginBloc.loginPasswordController, controller: loginBloc.loginPasswordController,
onFieldSubmitted: (value) { onFieldSubmitted: (value) {
if (loginBloc.loginFormKey.currentState!.validate()) { if (loginBloc.loginFormKey.currentState!.validate()) {
loginBloc.add(LoginButtonPressed( loginBloc.add(LoginButtonPressed(
username: loginBloc.loginEmailController.text, username: loginBloc.loginEmailController.text,
password: value, password: value,
)); ));
@ -347,18 +348,17 @@ class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout
}, },
decoration: textBoxDecoration()!.copyWith( decoration: textBoxDecoration()!.copyWith(
hintText: 'At least 8 characters', hintText: 'At least 8 characters',
hintStyle: Theme.of(context).textTheme.bodySmall!.copyWith( hintStyle: Theme.of(context)
color: ColorsManager.grayColor, fontWeight: FontWeight.w400), .textTheme
.bodySmall!
.copyWith(color: ColorsManager.grayColor, fontWeight: FontWeight.w400),
suffixIcon: IconButton( suffixIcon: IconButton(
onPressed: () { onPressed: () {
loginBloc loginBloc.add(PasswordVisibleEvent(newValue: loginBloc.obscureText));
.add(PasswordVisibleEvent(newValue: loginBloc.obscureText));
}, },
icon: SizedBox( icon: SizedBox(
child: SvgPicture.asset( child: SvgPicture.asset(
loginBloc.obscureText loginBloc.obscureText ? Assets.visiblePassword : Assets.invisiblePassword,
? Assets.visiblePassword
: Assets.invisiblePassword,
height: 15, height: 15,
width: 15, width: 15,
), ),
@ -386,8 +386,10 @@ class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout
}, },
child: Text( child: Text(
"Forgot Password?", "Forgot Password?",
style: Theme.of(context).textTheme.bodySmall!.copyWith( style: Theme.of(context)
color: Colors.black, fontSize: 14, fontWeight: FontWeight.w400), .textTheme
.bodySmall!
.copyWith(color: Colors.black, fontSize: 14, fontWeight: FontWeight.w400),
), ),
), ),
], ],
@ -464,8 +466,8 @@ class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout
style: Theme.of(context).textTheme.labelLarge!.copyWith( style: Theme.of(context).textTheme.labelLarge!.copyWith(
fontSize: 14, fontSize: 14,
color: loginBloc.checkValidate color: loginBloc.checkValidate
? ColorsManager.white ? ColorsManager.whiteColors
: ColorsManager.white.withOpacity(0.2), : ColorsManager.whiteColors.withOpacity(0.2),
)), )),
onPressed: () { onPressed: () {
if (loginBloc.loginFormKey.currentState!.validate()) { if (loginBloc.loginFormKey.currentState!.validate()) {
@ -492,8 +494,7 @@ class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout
SizedBox( SizedBox(
child: Text( child: Text(
loginBloc.validate, loginBloc.validate,
style: const TextStyle( style: const TextStyle(fontWeight: FontWeight.w700, color: ColorsManager.red),
fontWeight: FontWeight.w700, color: ColorsManager.red),
), ),
) )
], ],

View File

@ -56,7 +56,7 @@ class SearchResetButtons extends StatelessWidget {
decoration: containerDecoration, decoration: containerDecoration,
child: Center( child: Center(
child: DefaultButton( child: DefaultButton(
backgroundColor: ColorsManager.white, backgroundColor: ColorsManager.whiteColors,
borderRadius: 9, borderRadius: 9,
onPressed: onReset, onPressed: onReset,
child: Text( child: Text(

View File

@ -35,7 +35,7 @@ class CurtainToggle extends StatelessWidget {
children: [ children: [
ClipOval( ClipOval(
child: Container( child: Container(
color: ColorsManager.white, color: ColorsManager.whiteColors,
child: SvgPicture.asset( child: SvgPicture.asset(
Assets.curtainIcon, Assets.curtainIcon,
width: 60, width: 60,

View File

@ -127,11 +127,13 @@ class _DynamicTableState extends State<DynamicTable> {
controller: _horizontalScrollController, controller: _horizontalScrollController,
thumbVisibility: true, thumbVisibility: true,
trackVisibility: true, trackVisibility: true,
notificationPredicate: (notif) => notif.metrics.axis == Axis.horizontal, notificationPredicate: (notif) =>
notif.metrics.axis == Axis.horizontal,
child: SingleChildScrollView( child: SingleChildScrollView(
controller: _horizontalScrollController, controller: _horizontalScrollController,
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
physics: widget.isEmpty ? const NeverScrollableScrollPhysics() : null, physics:
widget.isEmpty ? const NeverScrollableScrollPhysics() : null,
child: SizedBox( child: SizedBox(
width: _totalTableWidth, width: _totalTableWidth,
child: Column( child: Column(
@ -193,25 +195,29 @@ class _DynamicTableState extends State<DynamicTable> {
widget.headers[colIndex] == 'Settings' widget.headers[colIndex] == 'Settings'
? buildSettingsIcon( ? buildSettingsIcon(
width: _settingsColumnWidth, width: _settingsColumnWidth,
onTap: () => widget.onSettingsPressed onTap: () => widget
.onSettingsPressed
?.call(rowIndex), ?.call(rowIndex),
) )
: _buildTableCell( : _buildTableCell(
row[colIndex].toString(), row[colIndex].toString(),
width: widget.headers[colIndex] == width: widget.headers[
colIndex] ==
'Settings' 'Settings'
? _settingsColumnWidth ? _settingsColumnWidth
: (_totalTableWidth - : (_totalTableWidth -
(widget.withCheckBox (widget.withCheckBox
? _checkboxColumnWidth ? _checkboxColumnWidth
: 0) - : 0) -
(widget.headers.contains( (widget.headers
'Settings') .contains(
'Settings')
? _settingsColumnWidth ? _settingsColumnWidth
: 0)) / : 0)) /
(widget.headers.length - (widget.headers.length -
(widget.headers.contains( (widget.headers
'Settings') .contains(
'Settings')
? 1 ? 1
: 0)), : 0)),
rowIndex: rowIndex, rowIndex: rowIndex,
@ -235,7 +241,7 @@ class _DynamicTableState extends State<DynamicTable> {
Widget _buildEmptyState() => Container( Widget _buildEmptyState() => Container(
height: widget.size.height, height: widget.size.height,
color: ColorsManager.white, color: ColorsManager.whiteColors,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
@ -275,8 +281,9 @@ class _DynamicTableState extends State<DynamicTable> {
), ),
child: Checkbox( child: Checkbox(
value: _selectAll, value: _selectAll,
onChanged: onChanged: widget.withSelectAll && widget.data.isNotEmpty
widget.withSelectAll && widget.data.isNotEmpty ? _toggleSelectAll : null, ? _toggleSelectAll
: null,
), ),
); );
} }
@ -293,7 +300,7 @@ class _DynamicTableState extends State<DynamicTable> {
width: 1.0, width: 1.0,
), ),
), ),
color: ColorsManager.white, color: ColorsManager.whiteColors,
), ),
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Center( child: Center(
@ -334,7 +341,9 @@ class _DynamicTableState extends State<DynamicTable> {
} }
Widget _buildTableCell(String content, Widget _buildTableCell(String content,
{required double width, required int rowIndex, required int columnIndex}) { {required double width,
required int rowIndex,
required int columnIndex}) {
bool isBatteryLevel = content.endsWith('%'); bool isBatteryLevel = content.endsWith('%');
double? batteryLevel; double? batteryLevel;
@ -406,7 +415,7 @@ class _DynamicTableState extends State<DynamicTable> {
height: _fixedRowHeight, height: _fixedRowHeight,
padding: const EdgeInsets.only(left: 15, top: 10, bottom: 10), padding: const EdgeInsets.only(left: 15, top: 10, bottom: 10),
decoration: const BoxDecoration( decoration: const BoxDecoration(
color: ColorsManager.white, color: ColorsManager.whiteColors,
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
color: ColorsManager.boxDivider, color: ColorsManager.boxDivider,

View File

@ -27,8 +27,8 @@ class BatchAcMode extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
_buildIconContainer( _buildIconContainer(context, TempModes.cold, Assets.freezing,
context, TempModes.cold, Assets.freezing, value == TempModes.cold), value == TempModes.cold),
_buildIconContainer( _buildIconContainer(
context, TempModes.hot, Assets.acSun, value == TempModes.hot), context, TempModes.hot, Assets.acSun, value == TempModes.hot),
_buildIconContainer(context, TempModes.wind, Assets.acAirConditioner, _buildIconContainer(context, TempModes.wind, Assets.acAirConditioner,
@ -56,7 +56,7 @@ class BatchAcMode extends StatelessWidget {
height: 50, height: 50,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: ColorsManager.white, color: ColorsManager.whiteColors,
border: Border.all( border: Border.all(
color: isSelected ? Colors.blue : Colors.transparent, color: isSelected ? Colors.blue : Colors.transparent,
width: 2.0, width: 2.0,

View File

@ -32,8 +32,8 @@ class BatchFanSpeedControl extends StatelessWidget {
children: [ children: [
_buildIconContainer(context, FanSpeeds.auto, Assets.acFanAuto, _buildIconContainer(context, FanSpeeds.auto, Assets.acFanAuto,
value == FanSpeeds.auto), value == FanSpeeds.auto),
_buildIconContainer( _buildIconContainer(context, FanSpeeds.low, Assets.acFanLow,
context, FanSpeeds.low, Assets.acFanLow, value == FanSpeeds.low), value == FanSpeeds.low),
], ],
), ),
const SizedBox(height: 8), const SizedBox(height: 8),
@ -52,8 +52,8 @@ class BatchFanSpeedControl extends StatelessWidget {
); );
} }
Widget _buildIconContainer( Widget _buildIconContainer(BuildContext context, FanSpeeds speed,
BuildContext context, FanSpeeds speed, String assetPath, bool isSelected) { String assetPath, bool isSelected) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
context.read<AcBloc>().add( context.read<AcBloc>().add(
@ -69,7 +69,7 @@ class BatchFanSpeedControl extends StatelessWidget {
height: 50, height: 50,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: ColorsManager.white, color: ColorsManager.whiteColors,
border: Border.all( border: Border.all(
color: isSelected ? Colors.blue : Colors.transparent, color: isSelected ? Colors.blue : Colors.transparent,
width: 2.0, width: 2.0,

View File

@ -27,8 +27,8 @@ class AcMode extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
_buildIconContainer( _buildIconContainer(context, TempModes.cold, Assets.freezing,
context, TempModes.cold, Assets.freezing, value == TempModes.cold), value == TempModes.cold),
_buildIconContainer( _buildIconContainer(
context, TempModes.hot, Assets.acSun, value == TempModes.hot), context, TempModes.hot, Assets.acSun, value == TempModes.hot),
_buildIconContainer(context, TempModes.wind, Assets.acAirConditioner, _buildIconContainer(context, TempModes.wind, Assets.acAirConditioner,
@ -56,7 +56,7 @@ class AcMode extends StatelessWidget {
height: 50, height: 50,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: ColorsManager.white, color: ColorsManager.whiteColors,
border: Border.all( border: Border.all(
color: isSelected ? Colors.blue : Colors.transparent, color: isSelected ? Colors.blue : Colors.transparent,
width: 2.0, width: 2.0,

View File

@ -38,7 +38,7 @@ class AcToggle extends StatelessWidget {
height: 60, height: 60,
decoration: const BoxDecoration( decoration: const BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: ColorsManager.white, color: ColorsManager.whiteColors,
), ),
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
child: ClipOval( child: ClipOval(

View File

@ -31,8 +31,8 @@ class FanSpeedControl extends StatelessWidget {
children: [ children: [
_buildIconContainer(context, FanSpeeds.auto, Assets.acFanAuto, _buildIconContainer(context, FanSpeeds.auto, Assets.acFanAuto,
value == FanSpeeds.auto), value == FanSpeeds.auto),
_buildIconContainer( _buildIconContainer(context, FanSpeeds.low, Assets.acFanLow,
context, FanSpeeds.low, Assets.acFanLow, value == FanSpeeds.low), value == FanSpeeds.low),
], ],
), ),
const SizedBox(height: 8), const SizedBox(height: 8),
@ -51,8 +51,8 @@ class FanSpeedControl extends StatelessWidget {
); );
} }
Widget _buildIconContainer( Widget _buildIconContainer(BuildContext context, FanSpeeds speed,
BuildContext context, FanSpeeds speed, String assetPath, bool isSelected) { String assetPath, bool isSelected) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
context.read<AcBloc>().add( context.read<AcBloc>().add(
@ -68,7 +68,7 @@ class FanSpeedControl extends StatelessWidget {
height: 50, height: 50,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: ColorsManager.white, color: ColorsManager.whiteColors,
border: Border.all( border: Border.all(
color: isSelected ? Colors.blue : Colors.transparent, color: isSelected ? Colors.blue : Colors.transparent,
width: 2.0, width: 2.0,

View File

@ -35,7 +35,8 @@ class _DeviceManagementPageState extends State<DeviceManagementPage> {
return MultiBlocProvider( return MultiBlocProvider(
providers: [ providers: [
BlocProvider( BlocProvider(
create: (context) => DeviceManagementBloc()..add(FetchDevices(context)), create: (context) =>
DeviceManagementBloc()..add(FetchDevices(context)),
), ),
], ],
child: WebScaffold( child: WebScaffold(
@ -58,9 +59,8 @@ class _DeviceManagementPageState extends State<DeviceManagementPage> {
BlocProvider.of<CreateRoutineBloc>(context) BlocProvider.of<CreateRoutineBloc>(context)
.add(const ResetSelectedEvent()); .add(const ResetSelectedEvent());
context context.read<RoutineBloc>().add(
.read<RoutineBloc>() const TriggerSwitchTabsEvent(isRoutineTab: false));
.add(const TriggerSwitchTabsEvent(isRoutineTab: false));
context context
.read<DeviceManagementBloc>() .read<DeviceManagementBloc>()
.add(FetchDevices(context)); .add(FetchDevices(context));
@ -69,7 +69,7 @@ class _DeviceManagementPageState extends State<DeviceManagementPage> {
'Devices', 'Devices',
style: context.textTheme.titleMedium?.copyWith( style: context.textTheme.titleMedium?.copyWith(
color: !state.routineTab color: !state.routineTab
? ColorsManager.white ? ColorsManager.whiteColors
: ColorsManager.grayColor, : ColorsManager.grayColor,
fontWeight: fontWeight:
!state.routineTab ? FontWeight.w700 : FontWeight.w400, !state.routineTab ? FontWeight.w700 : FontWeight.w400,
@ -86,17 +86,17 @@ class _DeviceManagementPageState extends State<DeviceManagementPage> {
BlocProvider.of<CreateRoutineBloc>(context) BlocProvider.of<CreateRoutineBloc>(context)
.add(const ResetSelectedEvent()); .add(const ResetSelectedEvent());
context context.read<RoutineBloc>().add(
.read<RoutineBloc>() const TriggerSwitchTabsEvent(isRoutineTab: true));
.add(const TriggerSwitchTabsEvent(isRoutineTab: true));
}, },
child: Text( child: Text(
'Workflow Automation', 'Workflow Automation',
style: context.textTheme.titleMedium?.copyWith( style: context.textTheme.titleMedium?.copyWith(
color: state.routineTab color: state.routineTab
? ColorsManager.white ? ColorsManager.whiteColors
: ColorsManager.grayColor, : ColorsManager.grayColor,
fontWeight: state.routineTab ? FontWeight.w700 : FontWeight.w400, fontWeight:
state.routineTab ? FontWeight.w700 : FontWeight.w400,
), ),
), ),
), ),
@ -120,7 +120,8 @@ class _DeviceManagementPageState extends State<DeviceManagementPage> {
} else if (deviceState is DeviceManagementLoaded) { } else if (deviceState is DeviceManagementLoaded) {
return DeviceManagementBody(devices: deviceState.devices); return DeviceManagementBody(devices: deviceState.devices);
} else if (deviceState is DeviceManagementFiltered) { } else if (deviceState is DeviceManagementFiltered) {
return DeviceManagementBody(devices: deviceState.filteredDevices); return DeviceManagementBody(
devices: deviceState.filteredDevices);
} else { } else {
return const DeviceManagementBody(devices: []); return const DeviceManagementBody(devices: []);
} }

View File

@ -120,7 +120,8 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
content: Text( content: Text(
'This Device is Offline', 'This Device is Offline',
), ),
duration: Duration(seconds: 2), duration:
Duration(seconds: 2),
), ),
); );
return; return;
@ -134,11 +135,13 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
device: selectedDevices.first, device: selectedDevices.first,
), ),
); );
} else if (selectedDevices.length > 1) { } else if (selectedDevices.length >
final productTypes = selectedDevices 1) {
.map( final productTypes =
(device) => device.productType) selectedDevices
.toSet(); .map((device) =>
device.productType)
.toSet();
if (productTypes.length == 1) { if (productTypes.length == 1) {
showDialog( showDialog(
context: context, context: context,
@ -221,11 +224,13 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
device.batteryLevel != null device.batteryLevel != null
? '${device.batteryLevel}%' ? '${device.batteryLevel}%'
: '-', : '-',
formatDateTime(DateTime.fromMillisecondsSinceEpoch( formatDateTime(
(device.createTime ?? 0) * 1000)), DateTime.fromMillisecondsSinceEpoch(
(device.createTime ?? 0) * 1000)),
device.online == true ? 'Online' : 'Offline', device.online == true ? 'Online' : 'Offline',
formatDateTime(DateTime.fromMillisecondsSinceEpoch( formatDateTime(
(device.updateTime ?? 0) * 1000)), DateTime.fromMillisecondsSinceEpoch(
(device.updateTime ?? 0) * 1000)),
'Settings', 'Settings',
]; ];
}).toList(), }).toList(),
@ -268,7 +273,7 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
child: Material( child: Material(
child: Container( child: Container(
width: MediaQuery.of(context).size.width * 0.3, width: MediaQuery.of(context).size.width * 0.3,
color: ColorsManager.white, color: ColorsManager.whiteColors,
child: DeviceSettingsPanel( child: DeviceSettingsPanel(
device: device, device: device,
onClose: () => Navigator.of(context).pop(), onClose: () => Navigator.of(context).pop(),

View File

@ -18,7 +18,7 @@ class AccurteCalibratingDialog extends StatelessWidget {
@override @override
Widget build(_) { Widget build(_) {
return AlertDialog( return AlertDialog(
backgroundColor: ColorsManager.white, backgroundColor: ColorsManager.whiteColors,
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
content: AccurateDialogWidget( content: AccurateDialogWidget(
title: 'Calibrating', title: 'Calibrating',

View File

@ -16,7 +16,7 @@ class AccurateCalibrationDialog extends StatelessWidget {
@override @override
Widget build(_) { Widget build(_) {
return AlertDialog( return AlertDialog(
backgroundColor: ColorsManager.white, backgroundColor: ColorsManager.whiteColors,
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
content: AccurateDialogWidget( content: AccurateDialogWidget(
title: 'Accurate Calibration', title: 'Accurate Calibration',

View File

@ -17,7 +17,7 @@ class CalibrateCompletedDialog extends StatelessWidget {
@override @override
Widget build(_) { Widget build(_) {
return AlertDialog( return AlertDialog(
backgroundColor: ColorsManager.white, backgroundColor: ColorsManager.whiteColors,
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
content: SizedBox( content: SizedBox(
height: 250, height: 250,

View File

@ -20,7 +20,7 @@ class CurtainActionWidget extends StatelessWidget {
height: 60, height: 60,
width: 60, width: 60,
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
color: ColorsManager.white, color: ColorsManager.whiteColors,
child: ClipOval( child: ClipOval(
child: Container( child: Container(
height: 60, height: 60,

View File

@ -164,7 +164,7 @@ class _CurtainSliderWidgetState extends State<CurtainSliderWidget> {
divisions: 10, // 10% step divisions: 10, // 10% step
activeColor: ColorsManager.minBlueDot, activeColor: ColorsManager.minBlueDot,
thumbColor: ColorsManager.primaryColor, thumbColor: ColorsManager.primaryColor,
inactiveColor: ColorsManager.white, inactiveColor: ColorsManager.whiteColors,
// Start dragging — use local control // Start dragging — use local control
onChangeStart: (_) { onChangeStart: (_) {

View File

@ -47,9 +47,10 @@ class PrefReversCardWidget extends StatelessWidget {
child: Container( child: Container(
padding: const EdgeInsets.all(3), padding: const EdgeInsets.all(3),
decoration: BoxDecoration( decoration: BoxDecoration(
color: ColorsManager.white, color: ColorsManager.whiteColors,
borderRadius: const BorderRadius.horizontal( borderRadius: const BorderRadius.horizontal(
left: Radius.circular(10), right: Radius.circular(10)), left: Radius.circular(10),
right: Radius.circular(10)),
border: Border.all(color: ColorsManager.grayBorder)), border: Border.all(color: ColorsManager.grayBorder)),
child: SvgPicture.asset( child: SvgPicture.asset(
Assets.reverseArrows, Assets.reverseArrows,

View File

@ -22,7 +22,7 @@ class CurtainModulePrefrencesDialog extends StatelessWidget {
@override @override
Widget build(_) { Widget build(_) {
return AlertDialog( return AlertDialog(
backgroundColor: ColorsManager.circleImageBackground, backgroundColor: ColorsManager.CircleImageBackground,
contentPadding: const EdgeInsets.all(20), contentPadding: const EdgeInsets.all(20),
title: Center( title: Center(
child: Text( child: Text(

View File

@ -63,7 +63,7 @@ class _QuickCalibratingDialogState extends State<QuickCalibratingDialog> {
@override @override
Widget build(_) { Widget build(_) {
return AlertDialog( return AlertDialog(
backgroundColor: ColorsManager.white, backgroundColor: ColorsManager.whiteColors,
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
content: AccurateDialogWidget( content: AccurateDialogWidget(
title: 'Calibrating', title: 'Calibrating',

View File

@ -18,7 +18,7 @@ class QuickCalibrationDialog extends StatelessWidget {
@override @override
Widget build(_) { Widget build(_) {
return AlertDialog( return AlertDialog(
backgroundColor: ColorsManager.white, backgroundColor: ColorsManager.whiteColors,
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
content: AccurateDialogWidget( content: AccurateDialogWidget(
title: 'Quick Calibration', title: 'Quick Calibration',

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/bloc/device_mgmt_bloc/device_managment_bloc.dart'; import 'package:syncrow_web/pages/device_managment/all_devices/bloc/device_mgmt_bloc/device_managment_bloc.dart';
@ -46,8 +47,8 @@ class DeviceSettingsPanel extends StatelessWidget {
return BlocBuilder<SettingDeviceBloc, DeviceSettingsState>( return BlocBuilder<SettingDeviceBloc, DeviceSettingsState>(
builder: (context, state) { builder: (context, state) {
final _bloc = context.read<SettingDeviceBloc>(); final _bloc = context.read<SettingDeviceBloc>();
final iconPath = final iconPath = DeviceIconTypeHelper.getDeviceIconByTypeCode(
DeviceIconTypeHelper.getDeviceIconByTypeCode(device.productType); device.productType);
final deviceInfo = state is DeviceSettingsUpdate final deviceInfo = state is DeviceSettingsUpdate
? state.deviceInfo ?? DeviceInfoModel.empty() ? state.deviceInfo ?? DeviceInfoModel.empty()
: DeviceInfoModel.empty(); : DeviceInfoModel.empty();
@ -76,9 +77,11 @@ class DeviceSettingsPanel extends StatelessWidget {
children: [ children: [
Text( Text(
'Device Settings', 'Device Settings',
style: context.theme.textTheme.titleLarge!.copyWith( style: context.theme.textTheme.titleLarge!
.copyWith(
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: ColorsManager.vividBlue.withOpacity(0.7), color: ColorsManager.vividBlue
.withOpacity(0.7),
fontSize: 24), fontSize: 24),
), ),
], ],
@ -95,7 +98,7 @@ class DeviceSettingsPanel extends StatelessWidget {
backgroundColor: backgroundColor:
ColorsManager.grayBorder.withOpacity(0.5), ColorsManager.grayBorder.withOpacity(0.5),
child: CircleAvatar( child: CircleAvatar(
backgroundColor: ColorsManager.white, backgroundColor: ColorsManager.whiteColors,
radius: 36, radius: 36,
child: SvgPicture.asset( child: SvgPicture.asset(
iconPath, iconPath,
@ -113,7 +116,8 @@ class DeviceSettingsPanel extends StatelessWidget {
const SizedBox(height: 15), const SizedBox(height: 15),
Text( Text(
'Device Name:', 'Device Name:',
style: context.textTheme.bodyMedium!.copyWith( style: context.textTheme.bodyMedium!
.copyWith(
color: ColorsManager.grayColor, color: ColorsManager.grayColor,
), ),
), ),
@ -139,13 +143,13 @@ class DeviceSettingsPanel extends StatelessWidget {
_bloc.add(const ChangeNameEvent( _bloc.add(const ChangeNameEvent(
value: false)); value: false));
deviceManagementBloc deviceManagementBloc
..add(UpdateDeviceName( ..add(UpdateDeviceName(
deviceId: device.uuid!, deviceId: device.uuid!,
newName: newName: _bloc
_bloc.nameController.text)) .nameController
..add(ResetSelectedDevices()); .text))..add(ResetSelectedDevices());
}, },
decoration: const InputDecoration( decoration:const InputDecoration(
isDense: true, isDense: true,
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
border: InputBorder.none, border: InputBorder.none,
@ -160,16 +164,18 @@ class DeviceSettingsPanel extends StatelessWidget {
width: 15, width: 15,
height: 25, height: 25,
child: Visibility( child: Visibility(
visible: _bloc.editName != true, visible:
_bloc.editName != true,
replacement: const SizedBox(), replacement: const SizedBox(),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
_bloc.add( _bloc.add(
const ChangeNameEvent( const ChangeNameEvent(
value: true)); value: true));
}, },
child: SvgPicture.asset( child: SvgPicture.asset(
Assets.editNameIconSettings, Assets
.editNameIconSettings,
color: ColorsManager color: ColorsManager
.lightGrayBorderColor, .lightGrayBorderColor,
height: 15, height: 15,

View File

@ -32,7 +32,7 @@ class _SubSpaceDialogState extends State<SubSpaceDialog> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Dialog( return Dialog(
backgroundColor: ColorsManager.white, backgroundColor: ColorsManager.whiteColors,
insetPadding: const EdgeInsets.symmetric(horizontal: 24, vertical: 60), insetPadding: const EdgeInsets.symmetric(horizontal: 24, vertical: 60),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(28), borderRadius: BorderRadius.circular(28),

View File

@ -100,6 +100,7 @@ class _DeviceItem extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return DeviceControlsContainer( return DeviceControlsContainer(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -109,7 +110,7 @@ class _DeviceItem extends StatelessWidget {
height: 60, height: 60,
width: 60, width: 60,
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
color: ColorsManager.white, color: ColorsManager.whiteColors,
child: SvgPicture.asset( child: SvgPicture.asset(
device.icon ?? 'assets/icons/gateway.svg', device.icon ?? 'assets/icons/gateway.svg',
width: 35, width: 35,

View File

@ -36,7 +36,7 @@ class _EnergyConsumptionPageState extends State<EnergyConsumptionPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
color: ColorsManager.white, color: ColorsManager.whiteColors,
child: Column( child: Column(
children: [ children: [
const Row( const Row(

View File

@ -22,7 +22,7 @@ class PowerClampInfoCard extends StatelessWidget {
child: Container( child: Container(
margin: const EdgeInsets.symmetric(horizontal: 6), margin: const EdgeInsets.symmetric(horizontal: 6),
decoration: BoxDecoration( decoration: BoxDecoration(
color: ColorsManager.white, color: ColorsManager.whiteColors,
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
), ),
height: 55, height: 55,

View File

@ -12,7 +12,8 @@ import 'package:syncrow_web/utils/constants/assets.dart';
import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart'; import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_layout_helper.dart';
//Smart Power Clamp //Smart Power Clamp
class SmartPowerDeviceControl extends StatelessWidget with HelperResponsiveLayout { class SmartPowerDeviceControl extends StatelessWidget
with HelperResponsiveLayout {
final String deviceId; final String deviceId;
const SmartPowerDeviceControl({super.key, required this.deviceId}); const SmartPowerDeviceControl({super.key, required this.deviceId});
@ -128,7 +129,7 @@ class SmartPowerDeviceControl extends StatelessWidget with HelperResponsiveLayou
bottom: 10, bottom: 10,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: ColorsManager.white, color: ColorsManager.whiteColors,
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
), ),
height: 300, height: 300,
@ -148,7 +149,8 @@ class SmartPowerDeviceControl extends StatelessWidget with HelperResponsiveLayou
onPressed: blocProvider.currentPage <= 0 onPressed: blocProvider.currentPage <= 0
? null ? null
: () { : () {
blocProvider.add(SmartPowerArrowPressedEvent(-1)); blocProvider
.add(SmartPowerArrowPressedEvent(-1));
pageController.previousPage( pageController.previousPage(
duration: const Duration(milliseconds: 300), duration: const Duration(milliseconds: 300),
curve: Curves.easeInOut, curve: Curves.easeInOut,
@ -170,7 +172,8 @@ class SmartPowerDeviceControl extends StatelessWidget with HelperResponsiveLayou
onPressed: blocProvider.currentPage >= 3 onPressed: blocProvider.currentPage >= 3
? null ? null
: () { : () {
blocProvider.add(SmartPowerArrowPressedEvent(1)); blocProvider
.add(SmartPowerArrowPressedEvent(1));
pageController.nextPage( pageController.nextPage(
duration: const Duration(milliseconds: 300), duration: const Duration(milliseconds: 300),
curve: Curves.easeInOut, curve: Curves.easeInOut,
@ -199,8 +202,8 @@ class SmartPowerDeviceControl extends StatelessWidget with HelperResponsiveLayou
blocProvider.add(SelectDateEvent(context: context)); blocProvider.add(SelectDateEvent(context: context));
blocProvider.add(FilterRecordsByDateEvent( blocProvider.add(FilterRecordsByDateEvent(
selectedDate: blocProvider.dateTime!, selectedDate: blocProvider.dateTime!,
viewType: viewType: blocProvider
blocProvider.views[blocProvider.currentIndex])); .views[blocProvider.currentIndex]));
}, },
widget: blocProvider.dateSwitcher(), widget: blocProvider.dateSwitcher(),
chartData: blocProvider.energyDataList.isNotEmpty chartData: blocProvider.energyDataList.isNotEmpty

View File

@ -30,7 +30,7 @@ class ScheduleControlButton extends StatelessWidget {
height: 60, height: 60,
decoration: const BoxDecoration( decoration: const BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: ColorsManager.white, color: ColorsManager.whiteColors,
), ),
margin: const EdgeInsets.symmetric(horizontal: 4), margin: const EdgeInsets.symmetric(horizontal: 4),
padding: const EdgeInsets.all(12), padding: const EdgeInsets.all(12),

View File

@ -13,7 +13,7 @@ class ScheduleHeader extends StatelessWidget {
Text( Text(
'Scheduling', 'Scheduling',
style: TextStyle( style: TextStyle(
color: ColorsManager.opaquePrimary, color: ColorsManager.primaryColorWithOpacity,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 30, fontSize: 30,
), ),

View File

@ -76,7 +76,7 @@ class _FactoryResetWidgetState extends State<FactoryResetWidget> {
child: Text( child: Text(
'Reset', 'Reset',
style: context.textTheme.bodyMedium!.copyWith( style: context.textTheme.bodyMedium!.copyWith(
color: ColorsManager.white, color: ColorsManager.whiteColors,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontSize: 12, fontSize: 12,
), ),
@ -95,7 +95,7 @@ class _FactoryResetWidgetState extends State<FactoryResetWidget> {
children: [ children: [
ClipOval( ClipOval(
child: Container( child: Container(
color: ColorsManager.white, color: ColorsManager.whiteColors,
height: 60, height: 60,
width: 60, width: 60,
child: Padding( child: Padding(

View File

@ -45,7 +45,7 @@ class IconNameStatusContainer extends StatelessWidget {
height: 60, height: 60,
width: 60, width: 60,
padding: EdgeInsets.all(paddingAmount ?? 8), padding: EdgeInsets.all(paddingAmount ?? 8),
color: ColorsManager.white, color: ColorsManager.whiteColors,
child: SvgPicture.asset( child: SvgPicture.asset(
icon, icon,
width: 35, width: 35,

View File

@ -1,10 +1,10 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_web/pages/device_managment/ceiling_sensor/model/ceiling_sensor_model.dart';
import 'package:syncrow_web/pages/device_managment/shared/device_controls_container.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';
import 'package:syncrow_web/utils/extension/build_context_x.dart'; import 'package:syncrow_web/utils/extension/build_context_x.dart';
import 'package:syncrow_web/pages/device_managment/shared/device_controls_container.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/pages/device_managment/ceiling_sensor/model/ceiling_sensor_model.dart';
class PresenceSpaceType extends StatelessWidget { class PresenceSpaceType extends StatelessWidget {
const PresenceSpaceType({ const PresenceSpaceType({
@ -59,7 +59,7 @@ class PresenceSpaceType extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100), borderRadius: BorderRadius.circular(100),
color: value == spaceType color: value == spaceType
? ColorsManager.opaquePrimary ? ColorsManager.primaryColorWithOpacity
: ColorsManager.textGray, : ColorsManager.textGray,
), ),
child: SvgPicture.asset( child: SvgPicture.asset(

View File

@ -52,7 +52,7 @@ class ToggleWidget extends StatelessWidget {
height: 60, height: 60,
width: 60, width: 60,
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
color: ColorsManager.white, color: ColorsManager.whiteColors,
child: SvgPicture.asset( child: SvgPicture.asset(
icon ?? Assets.lightPulp, icon ?? Assets.lightPulp,
width: 35, width: 35,

View File

@ -1,4 +1,5 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:syncrow_web/pages/device_managment/three_gang_switch/bloc/living_room_bloc.dart'; import 'package:syncrow_web/pages/device_managment/three_gang_switch/bloc/living_room_bloc.dart';
@ -6,8 +7,7 @@ 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 CeilingLight extends StatelessWidget { class CeilingLight extends StatelessWidget {
const CeilingLight( const CeilingLight({super.key, required this.value, required this.code, required this.deviceId});
{super.key, required this.value, required this.code, required this.deviceId});
final bool value; final bool value;
final String code; final String code;
@ -24,7 +24,7 @@ class CeilingLight extends StatelessWidget {
children: [ children: [
ClipOval( ClipOval(
child: Container( child: Container(
color: ColorsManager.white, color: ColorsManager.whiteColors,
child: SvgPicture.asset( child: SvgPicture.asset(
Assets.lightPulp, Assets.lightPulp,
width: 60, width: 60,

View File

@ -1,4 +1,5 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:syncrow_web/pages/device_managment/three_gang_switch/bloc/living_room_bloc.dart'; import 'package:syncrow_web/pages/device_managment/three_gang_switch/bloc/living_room_bloc.dart';
@ -6,8 +7,7 @@ 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 SpotLight extends StatelessWidget { class SpotLight extends StatelessWidget {
const SpotLight( const SpotLight({super.key, required this.value, required this.code, required this.deviceId});
{super.key, required this.value, required this.code, required this.deviceId});
final bool value; final bool value;
final String code; final String code;
@ -24,7 +24,7 @@ class SpotLight extends StatelessWidget {
children: [ children: [
ClipOval( ClipOval(
child: Container( child: Container(
color: ColorsManager.white, color: ColorsManager.whiteColors,
child: SvgPicture.asset( child: SvgPicture.asset(
Assets.lightPulp, Assets.lightPulp,
width: 60, width: 60,

View File

@ -1,4 +1,5 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:syncrow_web/pages/device_managment/three_gang_switch/bloc/living_room_bloc.dart'; import 'package:syncrow_web/pages/device_managment/three_gang_switch/bloc/living_room_bloc.dart';
@ -6,8 +7,7 @@ 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 WallLight extends StatelessWidget { class WallLight extends StatelessWidget {
const WallLight( const WallLight({super.key, required this.value, required this.code, required this.deviceId});
{super.key, required this.value, required this.code, required this.deviceId});
final bool value; final bool value;
final String code; final String code;
@ -24,7 +24,7 @@ class WallLight extends StatelessWidget {
children: [ children: [
ClipOval( ClipOval(
child: Container( child: Container(
color: ColorsManager.white, color: ColorsManager.whiteColors,
child: SvgPicture.asset( child: SvgPicture.asset(
Assets.lightPulp, Assets.lightPulp,
width: 60, width: 60,

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
import 'package:syncrow_web/pages/device_managment/schedule_device/schedule_widgets/schedule_mode_buttons.dart'; import 'package:syncrow_web/pages/device_managment/schedule_device/schedule_widgets/schedule_mode_buttons.dart';
import 'package:syncrow_web/pages/device_managment/water_heater/models/schedule_entry.dart'; import 'package:syncrow_web/pages/device_managment/water_heater/models/schedule_entry.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_status.dart';
import 'package:syncrow_web/utils/color_manager.dart'; import 'package:syncrow_web/utils/color_manager.dart';
class ScheduleDialogHelper { class ScheduleDialogHelper {
@ -58,7 +58,7 @@ class ScheduleDialogHelper {
Text( Text(
isEdit ? 'Edit Schedule' : 'Add Schedule', isEdit ? 'Edit Schedule' : 'Add Schedule',
style: Theme.of(context).textTheme.titleLarge!.copyWith( style: Theme.of(context).textTheme.titleLarge!.copyWith(
color: ColorsManager.opaquePrimary, color: ColorsManager.primaryColorWithOpacity,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 30, fontSize: 30,
), ),
@ -171,8 +171,8 @@ class ScheduleDialogHelper {
return result; return result;
} }
static Widget _buildDayCheckboxes( static Widget _buildDayCheckboxes(BuildContext ctx, List<bool> selectedDays,
BuildContext ctx, List<bool> selectedDays, Function(int, bool) onChanged) { Function(int, bool) onChanged) {
final dayLabels = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; final dayLabels = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -197,7 +197,8 @@ class ScheduleDialogHelper {
children: [ children: [
Text( Text(
'Function:', 'Function:',
style: Theme.of(ctx).textTheme.bodySmall!.copyWith(color: Colors.grey), style:
Theme.of(ctx).textTheme.bodySmall!.copyWith(color: Colors.grey),
), ),
const SizedBox(width: 10), const SizedBox(width: 10),
Radio<bool>( Radio<bool>(
@ -212,6 +213,7 @@ class ScheduleDialogHelper {
Radio<bool>( Radio<bool>(
activeColor: ColorsManager.secondaryColor, activeColor: ColorsManager.secondaryColor,
focusColor: ColorsManager.secondaryColor, focusColor: ColorsManager.secondaryColor,
value: false, value: false,
groupValue: isOn, groupValue: isOn,
onChanged: (val) => onChanged(false), onChanged: (val) => onChanged(false),

View File

@ -17,7 +17,7 @@ Future<void> showPopUpFilterMenu({
await showMenu( await showMenu(
context: context, context: context,
position: position, position: position,
color: ColorsManager.white, color: ColorsManager.whiteColors,
shape: const RoundedRectangleBorder( shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(10)), borderRadius: BorderRadius.all(Radius.circular(10)),
), ),

View File

@ -51,7 +51,7 @@ class _RoleDropdownState extends State<RoleDropdown> {
const SizedBox(height: 8), const SizedBox(height: 8),
SizedBox( SizedBox(
child: DropdownButtonFormField<String>( child: DropdownButtonFormField<String>(
dropdownColor: ColorsManager.white, dropdownColor: ColorsManager.whiteColors,
// alignment: Alignment., // alignment: Alignment.,
focusColor: Colors.white, focusColor: Colors.white,
autofocus: true, autofocus: true,

View File

@ -28,7 +28,9 @@ class RolesAndPermission extends StatelessWidget {
Text( Text(
'Role & Permissions', 'Role & Permissions',
style: context.textTheme.bodyLarge?.copyWith( style: context.textTheme.bodyLarge?.copyWith(
fontWeight: FontWeight.w700, fontSize: 20, color: Colors.black), fontWeight: FontWeight.w700,
fontSize: 20,
color: Colors.black),
), ),
const SizedBox( const SizedBox(
height: 15, height: 15,
@ -65,18 +67,21 @@ class RolesAndPermission extends StatelessWidget {
border: Border.all( border: Border.all(
color: ColorsManager.grayBorder)), color: ColorsManager.grayBorder)),
child: TextFormField( child: TextFormField(
style: const TextStyle(color: Colors.black), style:
controller: _blocRole.roleSearchController, const TextStyle(color: Colors.black),
controller:
_blocRole.roleSearchController,
onChanged: (value) { onChanged: (value) {
_blocRole.add(SearchPermission( _blocRole.add(SearchPermission(
nodes: _blocRole.permissions, nodes: _blocRole.permissions,
searchTerm: value)); searchTerm: value));
}, },
decoration: decoration: textBoxDecoration(radios: 20)!
textBoxDecoration(radios: 20)!.copyWith( .copyWith(
fillColor: Colors.white, fillColor: Colors.white,
suffixIcon: Padding( suffixIcon: Padding(
padding: const EdgeInsets.only(right: 16), padding:
const EdgeInsets.only(right: 16),
child: SvgPicture.asset( child: SvgPicture.asset(
Assets.textFieldSearch, Assets.textFieldSearch,
width: 24, width: 24,
@ -103,7 +108,7 @@ class RolesAndPermission extends StatelessWidget {
color: ColorsManager.circleRolesBackground, color: ColorsManager.circleRolesBackground,
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Container( child: Container(
color: ColorsManager.white, color: ColorsManager.whiteColors,
child: PermissionManagement( child: PermissionManagement(
bloc: _blocRole, bloc: _blocRole,
)))) ))))

View File

@ -23,7 +23,7 @@ Future<void> showDateFilterMenu({
await showMenu( await showMenu(
context: context, context: context,
position: position, position: position,
color: ColorsManager.white, color: ColorsManager.whiteColors,
shape: const RoundedRectangleBorder( shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
bottomRight: Radius.circular(10), bottomRight: Radius.circular(10),
@ -41,8 +41,9 @@ Future<void> showDateFilterMenu({
title: Text( title: Text(
"Sort from newest to oldest", "Sort from newest to oldest",
style: TextStyle( style: TextStyle(
color: color: isSelected == "NewestToOldest"
isSelected == "NewestToOldest" ? Colors.black : Colors.blueGrey), ? Colors.black
: Colors.blueGrey),
), ),
), ),
), ),
@ -56,8 +57,9 @@ Future<void> showDateFilterMenu({
title: Text( title: Text(
"Sort from oldest to newest", "Sort from oldest to newest",
style: TextStyle( style: TextStyle(
color: color: isSelected == "OldestToNewest"
isSelected == "OldestToNewest" ? Colors.black : Colors.blueGrey), ? Colors.black
: Colors.blueGrey),
), ),
), ),
), ),

View File

@ -23,7 +23,7 @@ Future<void> showDeActivateFilterMenu({
await showMenu( await showMenu(
context: context, context: context,
position: position, position: position,
color: ColorsManager.white, color: ColorsManager.whiteColors,
shape: const RoundedRectangleBorder( shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
bottomRight: Radius.circular(10), bottomRight: Radius.circular(10),
@ -41,8 +41,9 @@ Future<void> showDeActivateFilterMenu({
title: Text( title: Text(
"Sort A to Z", "Sort A to Z",
style: TextStyle( style: TextStyle(
color: color: isSelected == "NewestToOldest"
isSelected == "NewestToOldest" ? Colors.black : Colors.blueGrey), ? Colors.black
: Colors.blueGrey),
), ),
), ),
), ),
@ -56,8 +57,9 @@ Future<void> showDeActivateFilterMenu({
title: Text( title: Text(
"Sort Z to A", "Sort Z to A",
style: TextStyle( style: TextStyle(
color: color: isSelected == "OldestToNewest"
isSelected == "OldestToNewest" ? Colors.black : Colors.blueGrey), ? Colors.black
: Colors.blueGrey),
), ),
), ),
), ),

View File

@ -23,7 +23,7 @@ Future<void> showNameMenu({
await showMenu( await showMenu(
context: context, context: context,
position: position, position: position,
color: ColorsManager.white, color: ColorsManager.whiteColors,
shape: const RoundedRectangleBorder( shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
bottomRight: Radius.circular(10), bottomRight: Radius.circular(10),

View File

@ -83,7 +83,8 @@ class _TableRow extends StatelessWidget {
for (int i = 0; i < cells.length; i++) for (int i = 0; i < cells.length; i++)
Container( Container(
width: columnWidths[i], width: columnWidths[i],
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), padding:
const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
// decoration: BoxDecoration( // decoration: BoxDecoration(
// border: Border( // border: Border(
// right: BorderSide(color: ColorsManager.boxDivider), // right: BorderSide(color: ColorsManager.boxDivider),
@ -200,7 +201,7 @@ class _DynamicTableScreenState extends State<DynamicTableScreen> {
return Container( return Container(
decoration: containerDecoration.copyWith( decoration: containerDecoration.copyWith(
color: ColorsManager.white, color: ColorsManager.whiteColors,
borderRadius: const BorderRadius.only( borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(15), bottomLeft: Radius.circular(15),
bottomRight: Radius.circular(15), bottomRight: Radius.circular(15),
@ -230,7 +231,8 @@ class _DynamicTableScreenState extends State<DynamicTableScreen> {
if (_lastAvailableWidth != availableWidth) { if (_lastAvailableWidth != availableWidth) {
final equalWidth = final equalWidth =
(availableWidth - totalDividersWidth) / widget.titles.length; (availableWidth - totalDividersWidth) / widget.titles.length;
final clampedWidth = equalWidth.clamp(_minColumnWidth, _maxColumnWidth); final clampedWidth =
equalWidth.clamp(_minColumnWidth, _maxColumnWidth);
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() { setState(() {
@ -247,7 +249,7 @@ class _DynamicTableScreenState extends State<DynamicTableScreen> {
child: Container( child: Container(
width: totalTableWidth, width: totalTableWidth,
decoration: containerDecoration.copyWith( decoration: containerDecoration.copyWith(
color: ColorsManager.white, color: ColorsManager.whiteColors,
borderRadius: const BorderRadius.all(Radius.circular(20)), borderRadius: const BorderRadius.all(Radius.circular(20)),
), ),
child: Column( child: Column(

View File

@ -61,7 +61,8 @@ class UsersPage extends StatelessWidget {
: ColorsManager.disabledPink.withOpacity(0.5), : ColorsManager.disabledPink.withOpacity(0.5),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.only(left: 10, right: 10, bottom: 5, top: 5), padding:
const EdgeInsets.only(left: 10, right: 10, bottom: 5, top: 5),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -92,7 +93,8 @@ class UsersPage extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: onTap, onTap: onTap,
child: Padding( child: Padding(
padding: const EdgeInsets.only(left: 5, right: 5, bottom: 5, top: 5), padding:
const EdgeInsets.only(left: 5, right: 5, bottom: 5, top: 5),
child: SvgPicture.asset( child: SvgPicture.asset(
status == "invited" status == "invited"
? Assets.invitedIcon ? Assets.invitedIcon
@ -140,7 +142,7 @@ class UsersPage extends StatelessWidget {
}, },
style: const TextStyle(color: Colors.black), style: const TextStyle(color: Colors.black),
decoration: textBoxDecoration(radios: 15)!.copyWith( decoration: textBoxDecoration(radios: 15)!.copyWith(
fillColor: ColorsManager.white, fillColor: ColorsManager.whiteColors,
errorStyle: const TextStyle(height: 0), errorStyle: const TextStyle(height: 0),
hintStyle: context.textTheme.titleSmall?.copyWith( hintStyle: context.textTheme.titleSmall?.copyWith(
color: Colors.grey, color: Colors.grey,
@ -428,12 +430,14 @@ class UsersPage extends StatelessWidget {
Text(user.createdTime ?? ''), Text(user.createdTime ?? ''),
Text(user.invitedBy), Text(user.invitedBy),
status( status(
status: status: user.isEnabled == false
user.isEnabled == false ? 'disabled' : user.status, ? 'disabled'
: user.status,
), ),
changeIconStatus( changeIconStatus(
status: status: user.isEnabled == false
user.isEnabled == false ? 'disabled' : user.status, ? 'disabled'
: user.status,
userId: user.uuid, userId: user.uuid,
onTap: user.status != "invited" onTap: user.status != "invited"
? () { ? () {
@ -480,10 +484,11 @@ class UsersPage extends StatelessWidget {
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (BuildContext context) { builder: (BuildContext context) {
return DeleteUserDialog(onTapDelete: () async { return DeleteUserDialog(
onTapDelete: () async {
try { try {
_blocRole.add( _blocRole.add(DeleteUserEvent(
DeleteUserEvent(user.uuid, context)); user.uuid, context));
await Future.delayed( await Future.delayed(
const Duration(seconds: 2)); const Duration(seconds: 2));
return true; return true;
@ -516,7 +521,8 @@ class UsersPage extends StatelessWidget {
visiblePagesCount: 4, visiblePagesCount: 4,
buttonRadius: 10, buttonRadius: 10,
selectedButtonColor: ColorsManager.secondaryColor, selectedButtonColor: ColorsManager.secondaryColor,
buttonUnSelectedBorderColor: ColorsManager.grayBorder, buttonUnSelectedBorderColor:
ColorsManager.grayBorder,
lastPageIcon: lastPageIcon:
const Icon(Icons.keyboard_double_arrow_right), const Icon(Icons.keyboard_double_arrow_right),
firstPageIcon: firstPageIcon:

View File

@ -9,7 +9,7 @@ class RoleCard extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: ColorsManager.white, // Card background color color: ColorsManager.whiteColors, // Card background color
borderRadius: BorderRadius.circular(20), // Rounded corners borderRadius: BorderRadius.circular(20), // Rounded corners
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
@ -22,8 +22,8 @@ class RoleCard extends StatelessWidget {
), ),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: ColorsManager.white, color: ColorsManager.whiteColors,
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
), ),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_web/pages/common/bloc/project_manager.dart';
import 'package:syncrow_web/pages/device_managment/shared/navigate_home_grid_view.dart'; import 'package:syncrow_web/pages/device_managment/shared/navigate_home_grid_view.dart';
import 'package:syncrow_web/pages/roles_and_permission/bloc/roles_permission_bloc.dart'; import 'package:syncrow_web/pages/roles_and_permission/bloc/roles_permission_bloc.dart';
import 'package:syncrow_web/pages/roles_and_permission/bloc/roles_permission_state.dart'; import 'package:syncrow_web/pages/roles_and_permission/bloc/roles_permission_state.dart';
@ -29,7 +30,8 @@ class RolesAndPermissionPage extends StatelessWidget {
enableMenuSidebar: false, enableMenuSidebar: false,
appBarTitle: Text( appBarTitle: Text(
'Roles & Permissions', 'Roles & Permissions',
style: ResponsiveTextTheme.of(context).deviceManagementTitle, style:
ResponsiveTextTheme.of(context).deviceManagementTitle,
), ),
rightBody: const NavigateHomeGridView(), rightBody: const NavigateHomeGridView(),
centerBody: Row( centerBody: Row(
@ -64,7 +66,7 @@ class RolesAndPermissionPage extends StatelessWidget {
'Users', 'Users',
style: context.textTheme.titleMedium?.copyWith( style: context.textTheme.titleMedium?.copyWith(
color: (_blocRole.tapSelect == true) color: (_blocRole.tapSelect == true)
? ColorsManager.white ? ColorsManager.whiteColors
: ColorsManager.grayColor, : ColorsManager.grayColor,
fontWeight: (_blocRole.tapSelect == true) fontWeight: (_blocRole.tapSelect == true)
? FontWeight.w700 ? FontWeight.w700

View File

@ -32,7 +32,7 @@ class RolesPage extends StatelessWidget {
controller: searchController, controller: searchController,
style: const TextStyle(color: Colors.black), style: const TextStyle(color: Colors.black),
decoration: textBoxDecoration(radios: 15)!.copyWith( decoration: textBoxDecoration(radios: 15)!.copyWith(
fillColor: ColorsManager.white, fillColor: ColorsManager.whiteColors,
errorStyle: const TextStyle(height: 0), errorStyle: const TextStyle(height: 0),
hintStyle: context.textTheme.titleSmall?.copyWith( hintStyle: context.textTheme.titleSmall?.copyWith(
color: Colors.grey, color: Colors.grey,

View File

@ -3,7 +3,6 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_web/pages/routines/create_new_routines/dropdown_menu_content.dart'; import 'package:syncrow_web/pages/routines/create_new_routines/dropdown_menu_content.dart';
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/community_model.dart'; import 'package:syncrow_web/pages/spaces_management/all_spaces/model/community_model.dart';
import 'package:syncrow_web/utils/color_manager.dart'; import 'package:syncrow_web/utils/color_manager.dart';
import 'space_tree_dropdown_bloc.dart'; import 'space_tree_dropdown_bloc.dart';
class SpaceTreeDropdown extends StatelessWidget { class SpaceTreeDropdown extends StatelessWidget {
@ -177,7 +176,7 @@ class _DropdownContentState extends State<_DropdownContent> {
showWhenUnlinked: false, showWhenUnlinked: false,
offset: const Offset(0, 48), offset: const Offset(0, 48),
child: Material( child: Material(
color: ColorsManager.white, color: ColorsManager.whiteColors,
elevation: 8, elevation: 8,
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
child: BlocProvider.value( child: BlocProvider.value(
@ -202,7 +201,8 @@ class _DropdownContentState extends State<_DropdownContent> {
Overlay.of(context).insert(_overlayEntry!); Overlay.of(context).insert(_overlayEntry!);
} }
CommunityModel? _findCommunity(SpaceTreeDropdownState state, String? communityId) { CommunityModel? _findCommunity(
SpaceTreeDropdownState state, String? communityId) {
if (communityId == null) return null; if (communityId == null) return null;
try { try {
return state.filteredCommunities.firstWhere((c) => c.uuid == communityId); return state.filteredCommunities.firstWhere((c) => c.uuid == communityId);

View File

@ -35,7 +35,8 @@ class SpaceDropdown extends StatelessWidget {
DropdownButton2<String>( DropdownButton2<String>(
underline: const SizedBox(), underline: const SizedBox(),
buttonStyleData: ButtonStyleData( buttonStyleData: ButtonStyleData(
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12)), decoration:
BoxDecoration(borderRadius: BorderRadius.circular(12)),
), ),
value: selectedValue, value: selectedValue,
items: spaces.map((space) { items: spaces.map((space) {
@ -97,7 +98,9 @@ class SpaceDropdown extends StatelessWidget {
padding: const EdgeInsets.only(left: 10), padding: const EdgeInsets.only(left: 10),
child: Text( child: Text(
selectedValue != null selectedValue != null
? spaces.firstWhere((e) => e.uuid == selectedValue).name ? spaces
.firstWhere((e) => e.uuid == selectedValue)
.name
: hintMessage, : hintMessage,
style: Theme.of(context).textTheme.bodySmall!.copyWith( style: Theme.of(context).textTheme.bodySmall!.copyWith(
fontSize: 13, fontSize: 13,
@ -131,7 +134,7 @@ class SpaceDropdown extends StatelessWidget {
dropdownStyleData: DropdownStyleData( dropdownStyleData: DropdownStyleData(
maxHeight: MediaQuery.of(context).size.height * 0.4, maxHeight: MediaQuery.of(context).size.height * 0.4,
decoration: BoxDecoration( decoration: BoxDecoration(
color: ColorsManager.white, color: ColorsManager.whiteColors,
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
), ),
), ),

View File

@ -17,9 +17,10 @@ class SaveRoutineHelper {
builder: (context) { builder: (context) {
return BlocBuilder<RoutineBloc, RoutineState>( return BlocBuilder<RoutineBloc, RoutineState>(
builder: (context, state) { builder: (context, state) {
final selectedConditionLabel = state.selectedAutomationOperator == 'and' final selectedConditionLabel =
? 'All Conditions are met' state.selectedAutomationOperator == 'and'
: 'Any Condition is met'; ? 'All Conditions are met'
: 'Any Condition is met';
return AlertDialog( return AlertDialog(
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
@ -37,10 +38,11 @@ class SaveRoutineHelper {
Text( Text(
'Create a scene: ${state.routineName ?? ""}', 'Create a scene: ${state.routineName ?? ""}',
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: Theme.of(context).textTheme.headlineMedium!.copyWith( style:
color: ColorsManager.opaquePrimary, Theme.of(context).textTheme.headlineMedium!.copyWith(
fontWeight: FontWeight.bold, color: ColorsManager.primaryColorWithOpacity,
), fontWeight: FontWeight.bold,
),
), ),
const SizedBox(height: 18), const SizedBox(height: 18),
_buildDivider(), _buildDivider(),
@ -58,7 +60,8 @@ class SaveRoutineHelper {
_buildIfConditions(state, context), _buildIfConditions(state, context),
Container( Container(
width: 1, width: 1,
color: ColorsManager.greyColor.withValues(alpha: 0.8), color: ColorsManager.greyColor
.withValues(alpha: 0.8),
), ),
_buildThenActions(state, context), _buildThenActions(state, context),
], ],
@ -97,7 +100,8 @@ class SaveRoutineHelper {
child: Row( child: Row(
spacing: 16, spacing: 16,
children: [ children: [
Expanded(child: Text('IF: $selectedConditionLabel', style: textStyle)), Expanded(
child: Text('IF: $selectedConditionLabel', style: textStyle)),
const Expanded(child: Text('THEN:', style: textStyle)), const Expanded(child: Text('THEN:', style: textStyle)),
], ],
), ),
@ -132,7 +136,7 @@ class SaveRoutineHelper {
Navigator.pop(context); Navigator.pop(context);
}, },
textColor: ColorsManager.opaquePrimary, textColor: ColorsManager.primaryColorWithOpacity,
), ),
], ],
); );
@ -143,7 +147,8 @@ class SaveRoutineHelper {
child: ListView( child: ListView(
// shrinkWrap: true, // shrinkWrap: true,
children: state.thenItems.map((item) { children: state.thenItems.map((item) {
final functions = state.selectedFunctions[item['uniqueCustomId']] ?? []; final functions =
state.selectedFunctions[item['uniqueCustomId']] ?? [];
return functionRow(item, context, functions); return functionRow(item, context, functions);
}).toList(), }).toList(),
), ),
@ -203,19 +208,20 @@ class SaveRoutineHelper {
), ),
), ),
child: Center( child: Center(
child: item['type'] == 'tap_to_run' || item['type'] == 'scene' child:
? Image.memory( item['type'] == 'tap_to_run' || item['type'] == 'scene'
base64Decode(item['icon']), ? Image.memory(
width: 12, base64Decode(item['icon']),
height: 22, width: 12,
fit: BoxFit.scaleDown, height: 22,
) fit: BoxFit.scaleDown,
: SvgPicture.asset( )
item['imagePath'], : SvgPicture.asset(
width: 12, item['imagePath'],
height: 12, width: 12,
fit: BoxFit.scaleDown, height: 12,
), fit: BoxFit.scaleDown,
),
), ),
), ),
Flexible( Flexible(

View File

@ -35,7 +35,7 @@ class CreateNewRoutineView extends StatelessWidget {
child: Card( child: Card(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: ColorsManager.white, color: ColorsManager.whiteColors,
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
), ),
child: const ConditionsRoutinesDevicesView()), child: const ConditionsRoutinesDevicesView()),
@ -53,7 +53,7 @@ class CreateNewRoutineView extends StatelessWidget {
margin: EdgeInsets.zero, margin: EdgeInsets.zero,
child: Container( child: Container(
decoration: const BoxDecoration( decoration: const BoxDecoration(
color: ColorsManager.white, color: ColorsManager.whiteColors,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(15), topLeft: Radius.circular(15),
topRight: Radius.circular(15), topRight: Radius.circular(15),

View File

@ -12,7 +12,11 @@ class ConditionToggle extends StatelessWidget {
}); });
static const _conditions = ["<", "==", ">"]; static const _conditions = ["<", "==", ">"];
static const _icons = [Icons.chevron_left, Icons.drag_handle, Icons.chevron_right]; static const _icons = [
Icons.chevron_left,
Icons.drag_handle,
Icons.chevron_right
];
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -37,14 +41,16 @@ class ConditionToggle extends StatelessWidget {
duration: const Duration(milliseconds: 180), duration: const Duration(milliseconds: 180),
curve: Curves.ease, curve: Curves.ease,
decoration: BoxDecoration( decoration: BoxDecoration(
color: isSelected ? ColorsManager.vividBlue : Colors.transparent, color:
isSelected ? ColorsManager.vividBlue : Colors.transparent,
), ),
child: Center( child: Center(
child: Icon( child: Icon(
_icons[index], _icons[index],
size: 20, size: 20,
color: color: isSelected
isSelected ? ColorsManager.white : ColorsManager.blackColor, ? ColorsManager.whiteColors
: ColorsManager.blackColor,
weight: isSelected ? 700 : 500, weight: isSelected ? 700 : 500,
), ),
), ),

View File

@ -39,8 +39,7 @@ class DeleteSceneWidget extends StatelessWidget {
), ),
), ),
), ),
Container( Container(width: 1, height: 50, color: ColorsManager.greyColor),
width: 1, height: 50, color: ColorsManager.greyColor),
InkWell( InkWell(
onTap: () { onTap: () {
context.read<RoutineBloc>().add(const DeleteScene()); context.read<RoutineBloc>().add(const DeleteScene());
@ -52,7 +51,7 @@ class DeleteSceneWidget extends StatelessWidget {
child: Text( child: Text(
'Confirm', 'Confirm',
style: Theme.of(context).textTheme.bodyMedium!.copyWith( style: Theme.of(context).textTheme.bodyMedium!.copyWith(
color: ColorsManager.opaquePrimary, color: ColorsManager.primaryColorWithOpacity,
), ),
), ),
), ),

View File

@ -37,7 +37,9 @@ class DialogFooter extends StatelessWidget {
DialogFooterButton( DialogFooterButton(
text: 'Confirm', text: 'Confirm',
onTap: onConfirm, onTap: onConfirm,
textColor: isConfirmEnabled ? ColorsManager.opaquePrimary : Colors.red, textColor: isConfirmEnabled
? ColorsManager.primaryColorWithOpacity
: Colors.red,
), ),
], ],
], ],
@ -63,7 +65,7 @@ class DialogFooterButton extends StatelessWidget {
return Expanded( return Expanded(
child: TextButton( child: TextButton(
style: TextButton.styleFrom( style: TextButton.styleFrom(
foregroundColor: ColorsManager.opaquePrimary, foregroundColor: ColorsManager.primaryColorWithOpacity,
disabledForegroundColor: ColorsManager.primaryColor, disabledForegroundColor: ColorsManager.primaryColor,
), ),
onPressed: onTap, onPressed: onTap,

View File

@ -18,7 +18,7 @@ class DialogHeader extends StatelessWidget {
title, title,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodyMedium!.copyWith( style: Theme.of(context).textTheme.bodyMedium!.copyWith(
color: ColorsManager.opaquePrimary, color: ColorsManager.primaryColorWithOpacity,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),

View File

@ -33,18 +33,17 @@ class DraggableCard extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BlocBuilder<RoutineBloc, RoutineState>( return BlocBuilder<RoutineBloc, RoutineState>(
builder: (context, state) { builder: (context, state) {
final deviceFunctions = final deviceFunctions = state.selectedFunctions[deviceData['uniqueCustomId']] ?? [];
state.selectedFunctions[deviceData['uniqueCustomId']] ?? [];
int index = state.thenItems.indexWhere( int index = state.thenItems
(item) => item['uniqueCustomId'] == deviceData['uniqueCustomId']); .indexWhere((item) => item['uniqueCustomId'] == deviceData['uniqueCustomId']);
if (index != -1) { if (index != -1) {
return _buildCardContent(context, deviceFunctions, padding: padding); return _buildCardContent(context, deviceFunctions, padding: padding);
} }
int ifIndex = state.ifItems.indexWhere( int ifIndex = state.ifItems
(item) => item['uniqueCustomId'] == deviceData['uniqueCustomId']); .indexWhere((item) => item['uniqueCustomId'] == deviceData['uniqueCustomId']);
if (ifIndex != -1) { if (ifIndex != -1) {
return _buildCardContent(context, deviceFunctions, padding: padding); return _buildCardContent(context, deviceFunctions, padding: padding);
@ -63,13 +62,12 @@ class DraggableCard extends StatelessWidget {
); );
} }
Widget _buildCardContent( Widget _buildCardContent(BuildContext context, List<DeviceFunctionData> deviceFunctions,
BuildContext context, List<DeviceFunctionData> deviceFunctions,
{EdgeInsetsGeometry? padding}) { {EdgeInsetsGeometry? padding}) {
return Stack( return Stack(
children: [ children: [
Card( Card(
color: ColorsManager.white, color: ColorsManager.whiteColors,
child: Container( child: Container(
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
width: 110, width: 110,
@ -94,8 +92,7 @@ class DraggableCard extends StatelessWidget {
), ),
), ),
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
child: deviceData['type'] == 'tap_to_run' || child: deviceData['type'] == 'tap_to_run' || deviceData['type'] == 'scene'
deviceData['type'] == 'scene'
? Image.memory( ? Image.memory(
base64Decode(deviceData['icon']), base64Decode(deviceData['icon']),
) )
@ -126,9 +123,7 @@ class DraggableCard extends StatelessWidget {
spacing: 2, spacing: 2,
children: [ children: [
SizedBox( SizedBox(
width: 8, width: 8, height: 8, child: SvgPicture.asset(Assets.deviceTagIcon)),
height: 8,
child: SvgPicture.asset(Assets.deviceTagIcon)),
Flexible( Flexible(
child: Text( child: Text(
deviceData['tag'] ?? '', deviceData['tag'] ?? '',
@ -146,15 +141,13 @@ class DraggableCard extends StatelessWidget {
), ),
), ),
Visibility( Visibility(
visible: deviceData['subSpace'] != null && visible: deviceData['subSpace'] != null && deviceData['subSpace'] != '',
deviceData['subSpace'] != '',
child: const SizedBox( child: const SizedBox(
height: 4, height: 4,
), ),
), ),
Visibility( Visibility(
visible: deviceData['subSpace'] != null && visible: deviceData['subSpace'] != null && deviceData['subSpace'] != '',
deviceData['subSpace'] != '',
child: Row( child: Row(
spacing: 2, spacing: 2,
children: [ children: [
@ -229,8 +222,7 @@ class DraggableCard extends StatelessWidget {
} }
String _formatFunctionValue(DeviceFunctionData function) { String _formatFunctionValue(DeviceFunctionData function) {
if (function.functionCode == 'temp_set' || if (function.functionCode == 'temp_set' || function.functionCode == 'temp_current') {
function.functionCode == 'temp_current') {
return '${(function.value / 10).toStringAsFixed(0)}°C'; return '${(function.value / 10).toStringAsFixed(0)}°C';
} else if (function.functionCode.contains('countdown')) { } else if (function.functionCode.contains('countdown')) {
final seconds = function.value?.toInt() ?? 0; final seconds = function.value?.toInt() ?? 0;

View File

@ -32,7 +32,8 @@ class IfContainer extends StatelessWidget {
fontSize: 18, fontWeight: FontWeight.bold)), fontSize: 18, fontWeight: FontWeight.bold)),
if (state.isAutomation && state.ifItems.isNotEmpty) if (state.isAutomation && state.ifItems.isNotEmpty)
AutomationOperatorSelector( AutomationOperatorSelector(
selectedOperator: state.selectedAutomationOperator), selectedOperator:
state.selectedAutomationOperator),
], ],
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
@ -56,8 +57,8 @@ class IfContainer extends StatelessWidget {
(index) => GestureDetector( (index) => GestureDetector(
onTap: () async { onTap: () async {
if (!state.isTabToRun) { if (!state.isTabToRun) {
final result = final result = await DeviceDialogHelper
await DeviceDialogHelper.showDeviceDialog( .showDeviceDialog(
context: context, context: context,
data: state.ifItems[index], data: state.ifItems[index],
removeComparetors: false, removeComparetors: false,
@ -78,8 +79,8 @@ class IfContainer extends StatelessWidget {
'NCPS', 'NCPS',
'WH', 'WH',
'PC', 'PC',
].contains( ].contains(state.ifItems[index]
state.ifItems[index]['productType'])) { ['productType'])) {
context.read<RoutineBloc>().add( context.read<RoutineBloc>().add(
AddToIfContainer( AddToIfContainer(
state.ifItems[index], false)); state.ifItems[index], false));
@ -96,11 +97,12 @@ class IfContainer extends StatelessWidget {
isFromThen: false, isFromThen: false,
isFromIf: true, isFromIf: true,
onRemove: () { onRemove: () {
context.read<RoutineBloc>().add(RemoveDragCard( context.read<RoutineBloc>().add(
index: index, RemoveDragCard(
isFromThen: false, index: index,
key: state.ifItems[index] isFromThen: false,
['uniqueCustomId'])); key: state.ifItems[index]
['uniqueCustomId']));
}, },
), ),
)), )),
@ -121,7 +123,9 @@ class IfContainer extends StatelessWidget {
if (!state.isTabToRun) { if (!state.isTabToRun) {
if (mutableData['deviceId'] == 'tab_to_run') { if (mutableData['deviceId'] == 'tab_to_run') {
context.read<RoutineBloc>().add(AddToIfContainer(mutableData, true)); context
.read<RoutineBloc>()
.add(AddToIfContainer(mutableData, true));
} else { } else {
final result = await DeviceDialogHelper.showDeviceDialog( final result = await DeviceDialogHelper.showDeviceDialog(
dialogType: 'IF', dialogType: 'IF',
@ -180,7 +184,7 @@ class AutomationOperatorSelector extends StatelessWidget {
style: TextButton.styleFrom( style: TextButton.styleFrom(
backgroundColor: selectedOperator.toLowerCase() == 'or' backgroundColor: selectedOperator.toLowerCase() == 'or'
? ColorsManager.dialogBlueTitle ? ColorsManager.dialogBlueTitle
: ColorsManager.white, : ColorsManager.whiteColors,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0), borderRadius: BorderRadius.circular(0),
), ),
@ -189,7 +193,7 @@ class AutomationOperatorSelector extends StatelessWidget {
'Any condition is met', 'Any condition is met',
style: context.textTheme.bodyMedium?.copyWith( style: context.textTheme.bodyMedium?.copyWith(
color: selectedOperator.toLowerCase() == 'or' color: selectedOperator.toLowerCase() == 'or'
? ColorsManager.white ? ColorsManager.whiteColors
: ColorsManager.blackColor, : ColorsManager.blackColor,
), ),
), ),
@ -208,7 +212,7 @@ class AutomationOperatorSelector extends StatelessWidget {
style: TextButton.styleFrom( style: TextButton.styleFrom(
backgroundColor: selectedOperator.toLowerCase() == 'and' backgroundColor: selectedOperator.toLowerCase() == 'and'
? ColorsManager.dialogBlueTitle ? ColorsManager.dialogBlueTitle
: ColorsManager.white, : ColorsManager.whiteColors,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0), borderRadius: BorderRadius.circular(0),
), ),
@ -217,7 +221,7 @@ class AutomationOperatorSelector extends StatelessWidget {
'All condition is met', 'All condition is met',
style: context.textTheme.bodyMedium?.copyWith( style: context.textTheme.bodyMedium?.copyWith(
color: selectedOperator.toLowerCase() == 'and' color: selectedOperator.toLowerCase() == 'and'
? ColorsManager.white ? ColorsManager.whiteColors
: ColorsManager.blackColor, : ColorsManager.blackColor,
), ),
), ),

View File

@ -91,7 +91,7 @@ class _RoutineViewCardState extends State<RoutineViewCard> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
), ),
color: ColorsManager.white, color: ColorsManager.whiteColors,
child: InkWell( child: InkWell(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
child: Padding( child: Padding(
@ -121,7 +121,8 @@ class _RoutineViewCardState extends State<RoutineViewCard> {
child: SizedBox( child: SizedBox(
width: 16, width: 16,
height: 16, height: 16,
child: CircularProgressIndicator(strokeWidth: 2), child:
CircularProgressIndicator(strokeWidth: 2),
), ),
), ),
) )
@ -159,8 +160,9 @@ class _RoutineViewCardState extends State<RoutineViewCard> {
height: iconSize, height: iconSize,
width: iconSize, width: iconSize,
fit: BoxFit.contain, fit: BoxFit.contain,
errorBuilder: (context, error, stackTrace) => errorBuilder:
Image.asset( (context, error, stackTrace) =>
Image.asset(
Assets.logo, Assets.logo,
height: iconSize, height: iconSize,
width: iconSize, width: iconSize,
@ -203,7 +205,8 @@ class _RoutineViewCardState extends State<RoutineViewCard> {
maxLines: 1, maxLines: 1,
style: context.textTheme.bodySmall?.copyWith( style: context.textTheme.bodySmall?.copyWith(
color: ColorsManager.blackColor, color: ColorsManager.blackColor,
fontSize: widget.isSmallScreenSize(context) ? 10 : 12, fontSize:
widget.isSmallScreenSize(context) ? 10 : 12,
), ),
), ),
if (widget.spaceName != '') if (widget.spaceName != '')
@ -222,8 +225,9 @@ class _RoutineViewCardState extends State<RoutineViewCard> {
maxLines: 1, maxLines: 1,
style: context.textTheme.bodySmall?.copyWith( style: context.textTheme.bodySmall?.copyWith(
color: ColorsManager.blackColor, color: ColorsManager.blackColor,
fontSize: fontSize: widget.isSmallScreenSize(context)
widget.isSmallScreenSize(context) ? 10 : 12, ? 10
: 12,
), ),
), ),
], ],

View File

@ -37,7 +37,9 @@ class RoutineDialogSelectionListTile extends StatelessWidget {
trailing: Icon( trailing: Icon(
isSelected ? Icons.radio_button_checked : Icons.radio_button_unchecked, isSelected ? Icons.radio_button_checked : Icons.radio_button_unchecked,
size: 24, size: 24,
color: isSelected ? ColorsManager.opaquePrimary : ColorsManager.textGray, color: isSelected
? ColorsManager.primaryColorWithOpacity
: ColorsManager.textGray,
), ),
onTap: onTap, onTap: onTap,
); );

View File

@ -65,8 +65,9 @@ class ACHelper {
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
DialogHeader( DialogHeader(dialogType == 'THEN'
dialogType == 'THEN' ? 'AC Functions' : 'AC Conditions'), ? 'AC Functions'
: 'AC Conditions'),
Expanded( Expanded(
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
@ -77,12 +78,15 @@ class ACHelper {
child: _buildFunctionsList( child: _buildFunctionsList(
context: context, context: context,
acFunctions: acFunctions, acFunctions: acFunctions,
onFunctionSelected: (functionCode, operationName) { onFunctionSelected:
RoutineTapFunctionHelper.onTapFunction(context, (functionCode, operationName) {
RoutineTapFunctionHelper.onTapFunction(
context,
functionCode: functionCode, functionCode: functionCode,
functionOperationName: operationName, functionOperationName: operationName,
functionValueDescription: functionValueDescription:
selectedFunctionData.valueDescription, selectedFunctionData
.valueDescription,
deviceUuid: device?.uuid, deviceUuid: device?.uuid,
codesToAddIntoFunctionsWithDefaultValue: [ codesToAddIntoFunctionsWithDefaultValue: [
'temp_set', 'temp_set',
@ -115,7 +119,8 @@ class ACHelper {
? () { ? () {
final selectedFunctionData = final selectedFunctionData =
state.addedFunctions.firstWhere( state.addedFunctions.firstWhere(
(f) => f.functionCode == state.selectedFunction, (f) =>
f.functionCode == state.selectedFunction,
orElse: () => DeviceFunctionData( orElse: () => DeviceFunctionData(
entityId: '', entityId: '',
functionCode: state.selectedFunction ?? '', functionCode: state.selectedFunction ?? '',
@ -209,10 +214,12 @@ class ACHelper {
required String operationName, required String operationName,
bool? removeComparators, bool? removeComparators,
}) { }) {
final selectedFn = acFunctions.firstWhere((f) => f.code == selectedFunction); final selectedFn =
acFunctions.firstWhere((f) => f.code == selectedFunction);
if (selectedFunction == 'temp_set' || selectedFunction == 'temp_current') { if (selectedFunction == 'temp_set' || selectedFunction == 'temp_current') {
final displayValue = (selectedFunctionData?.value ?? selectedFn.min!) / 10; final displayValue =
(selectedFunctionData?.value ?? selectedFn.min!) / 10;
final minValue = selectedFn.min! / 10; final minValue = selectedFn.min! / 10;
final maxValue = selectedFn.max! / 10; final maxValue = selectedFn.max! / 10;
@ -455,9 +462,13 @@ class ACHelper {
style: context.textTheme.bodyMedium, style: context.textTheme.bodyMedium,
), ),
trailing: Icon( trailing: Icon(
isSelected ? Icons.radio_button_checked : Icons.radio_button_unchecked, isSelected
? Icons.radio_button_checked
: Icons.radio_button_unchecked,
size: 24, size: 24,
color: isSelected ? ColorsManager.opaquePrimary : ColorsManager.textGray, color: isSelected
? ColorsManager.primaryColorWithOpacity
: ColorsManager.textGray,
), ),
onTap: () { onTap: () {
if (!isSelected) { if (!isSelected) {
@ -469,7 +480,8 @@ class ACHelper {
operationName: operationName, operationName: operationName,
value: value.value, value: value.value,
condition: selectedFunctionData?.condition, condition: selectedFunctionData?.condition,
valueDescription: selectedFunctionData?.valueDescription, valueDescription:
selectedFunctionData?.valueDescription,
), ),
), ),
); );

View File

@ -71,8 +71,10 @@ class CurtainHelper {
child: _buildFunctionsList( child: _buildFunctionsList(
context: context, context: context,
curtainFunctions: curtainFunctions, curtainFunctions: curtainFunctions,
onFunctionSelected: (functionCode, operationName) { onFunctionSelected:
RoutineTapFunctionHelper.onTapFunction(context, (functionCode, operationName) {
RoutineTapFunctionHelper.onTapFunction(
context,
functionCode: functionCode, functionCode: functionCode,
functionOperationName: operationName, functionOperationName: operationName,
functionValueDescription: functionValueDescription:
@ -238,9 +240,13 @@ class CurtainHelper {
style: context.textTheme.bodyMedium, style: context.textTheme.bodyMedium,
), ),
trailing: Icon( trailing: Icon(
isSelected ? Icons.radio_button_checked : Icons.radio_button_unchecked, isSelected
? Icons.radio_button_checked
: Icons.radio_button_unchecked,
size: 24, size: 24,
color: isSelected ? ColorsManager.opaquePrimary : ColorsManager.textGray, color: isSelected
? ColorsManager.primaryColorWithOpacity
: ColorsManager.textGray,
), ),
onTap: () { onTap: () {
if (!isSelected) { if (!isSelected) {
@ -252,7 +258,8 @@ class CurtainHelper {
operationName: operationName, operationName: operationName,
value: value.value, value: value.value,
condition: selectedFunctionData?.condition, condition: selectedFunctionData?.condition,
valueDescription: selectedFunctionData?.valueDescription, valueDescription:
selectedFunctionData?.valueDescription,
), ),
), ),
); );

View File

@ -89,14 +89,15 @@ class OneGangSwitchHelper {
size: 16, size: 16,
color: ColorsManager.textGray, color: ColorsManager.textGray,
), ),
onTap: () => onTap: () => RoutineTapFunctionHelper
RoutineTapFunctionHelper.onTapFunction( .onTapFunction(
context, context,
functionCode: function.code, functionCode: function.code,
functionOperationName: functionOperationName:
function.operationName, function.operationName,
functionValueDescription: functionValueDescription:
selectedFunctionData.valueDescription, selectedFunctionData
.valueDescription,
deviceUuid: device?.uuid, deviceUuid: device?.uuid,
codesToAddIntoFunctionsWithDefaultValue: [ codesToAddIntoFunctionsWithDefaultValue: [
'countdown_1', 'countdown_1',
@ -112,10 +113,12 @@ class OneGangSwitchHelper {
child: _buildValueSelector( child: _buildValueSelector(
context: context, context: context,
selectedFunction: selectedFunction, selectedFunction: selectedFunction,
selectedFunctionData: selectedFunctionData, selectedFunctionData:
selectedFunctionData,
acFunctions: oneGangFunctions, acFunctions: oneGangFunctions,
device: device, device: device,
operationName: selectedOperationName ?? '', operationName:
selectedOperationName ?? '',
removeComparetors: removeComparetors, removeComparetors: removeComparetors,
dialogType: dialogType), dialogType: dialogType),
), ),
@ -315,9 +318,13 @@ class OneGangSwitchHelper {
style: context.textTheme.bodyMedium, style: context.textTheme.bodyMedium,
), ),
trailing: Icon( trailing: Icon(
isSelected ? Icons.radio_button_checked : Icons.radio_button_unchecked, isSelected
? Icons.radio_button_checked
: Icons.radio_button_unchecked,
size: 24, size: 24,
color: isSelected ? ColorsManager.opaquePrimary : ColorsManager.textGray, color: isSelected
? ColorsManager.primaryColorWithOpacity
: ColorsManager.textGray,
), ),
onTap: () { onTap: () {
if (!isSelected) { if (!isSelected) {
@ -329,7 +336,8 @@ class OneGangSwitchHelper {
operationName: operationName, operationName: operationName,
value: value.value, value: value.value,
condition: selectedFunctionData?.condition, condition: selectedFunctionData?.condition,
valueDescription: selectedFunctionData?.valueDescription, valueDescription:
selectedFunctionData?.valueDescription,
), ),
), ),
); );

View File

@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_web/pages/routines/bloc/effective_period/effect_period_bloc.dart'; import 'package:syncrow_web/pages/routines/bloc/effective_period/effect_period_bloc.dart';
@ -14,6 +13,7 @@ import 'package:syncrow_web/pages/routines/view/effective_period_view.dart';
import 'package:syncrow_web/pages/routines/widgets/delete_scene.dart'; import 'package:syncrow_web/pages/routines/widgets/delete_scene.dart';
import 'package:syncrow_web/pages/routines/widgets/dialog_header.dart'; import 'package:syncrow_web/pages/routines/widgets/dialog_header.dart';
import 'package:syncrow_web/utils/color_manager.dart'; import 'package:syncrow_web/utils/color_manager.dart';
import 'package:flutter/cupertino.dart';
class SettingHelper { class SettingHelper {
static Future<String?> showSettingDialog({ static Future<String?> showSettingDialog({
@ -30,16 +30,14 @@ class SettingHelper {
providers: [ providers: [
if (effectiveTime != null) if (effectiveTime != null)
BlocProvider( BlocProvider(
create: (_) => create: (_) => EffectPeriodBloc()..add(InitialEffectPeriodEvent(effectiveTime)),
EffectPeriodBloc()..add(InitialEffectPeriodEvent(effectiveTime)),
), ),
if (effectiveTime == null) if (effectiveTime == null)
BlocProvider( BlocProvider(
create: (_) => EffectPeriodBloc(), create: (_) => EffectPeriodBloc(),
), ),
BlocProvider( BlocProvider(
create: (_) => create: (_) => SettingBloc()..add(InitialEvent(selectedIcon: iconId ?? ''))),
SettingBloc()..add(InitialEvent(selectedIcon: iconId ?? ''))),
], ],
child: AlertDialog( child: AlertDialog(
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
@ -55,9 +53,7 @@ class SettingHelper {
} }
return Container( return Container(
width: context.read<SettingBloc>().isExpanded ? 800 : 400, width: context.read<SettingBloc>().isExpanded ? 800 : 400,
height: context.read<SettingBloc>().isExpanded && isAutomation height: context.read<SettingBloc>().isExpanded && isAutomation ? 500 : 350,
? 500
: 350,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
@ -80,18 +76,14 @@ class SettingHelper {
children: [ children: [
Container( Container(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
top: 10, top: 10, left: 10, right: 10, bottom: 10),
left: 10,
right: 10,
bottom: 10),
child: Column( child: Column(
children: [ children: [
InkWell( InkWell(
onTap: () {}, onTap: () {},
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment MainAxisAlignment.spaceBetween,
.spaceBetween,
children: [ children: [
Text( Text(
'Validity', 'Validity',
@ -99,17 +91,14 @@ class SettingHelper {
.textTheme .textTheme
.bodyMedium! .bodyMedium!
.copyWith( .copyWith(
color: ColorsManager color:
.textPrimaryColor, ColorsManager.textPrimaryColor,
fontWeight: fontWeight: FontWeight.w400,
FontWeight.w400,
fontSize: 14), fontSize: 14),
), ),
const Icon( const Icon(
Icons Icons.arrow_forward_ios_outlined,
.arrow_forward_ios_outlined, color: ColorsManager.textGray,
color:
ColorsManager.textGray,
size: 15, size: 15,
) )
], ],
@ -126,17 +115,15 @@ class SettingHelper {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
BlocProvider.of<SettingBloc>( BlocProvider.of<SettingBloc>(context).add(
context) FetchIcons(
.add(FetchIcons(
expanded: !context expanded: !context
.read<SettingBloc>() .read<SettingBloc>()
.isExpanded)); .isExpanded));
}, },
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment MainAxisAlignment.spaceBetween,
.spaceBetween,
children: [ children: [
Text( Text(
'Effective Period', 'Effective Period',
@ -144,17 +131,14 @@ class SettingHelper {
.textTheme .textTheme
.bodyMedium! .bodyMedium!
.copyWith( .copyWith(
color: ColorsManager color:
.textPrimaryColor, ColorsManager.textPrimaryColor,
fontWeight: fontWeight: FontWeight.w400,
FontWeight.w400,
fontSize: 14), fontSize: 14),
), ),
const Icon( const Icon(
Icons Icons.arrow_forward_ios_outlined,
.arrow_forward_ios_outlined, color: ColorsManager.textGray,
color:
ColorsManager.textGray,
size: 15, size: 15,
) )
], ],
@ -170,8 +154,7 @@ class SettingHelper {
height: 5, height: 5,
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
'Executed by', 'Executed by',
@ -179,10 +162,8 @@ class SettingHelper {
.textTheme .textTheme
.bodyMedium! .bodyMedium!
.copyWith( .copyWith(
color: ColorsManager color: ColorsManager.textPrimaryColor,
.textPrimaryColor, fontWeight: FontWeight.w400,
fontWeight:
FontWeight.w400,
fontSize: 14), fontSize: 14),
), ),
Text('Cloud', Text('Cloud',
@ -190,17 +171,12 @@ class SettingHelper {
.textTheme .textTheme
.bodyMedium! .bodyMedium!
.copyWith( .copyWith(
color: ColorsManager color: ColorsManager.textGray,
.textGray, fontWeight: FontWeight.w400,
fontWeight:
FontWeight.w400,
fontSize: 14)), fontSize: 14)),
], ],
), ),
if (context if (context.read<RoutineBloc>().state.isUpdate ??
.read<RoutineBloc>()
.state
.isUpdate ??
false) false)
const DeleteSceneWidget() const DeleteSceneWidget()
], ],
@ -212,25 +188,20 @@ class SettingHelper {
children: [ children: [
Container( Container(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
top: 10, top: 10, left: 10, right: 10, bottom: 10),
left: 10,
right: 10,
bottom: 10),
child: Column( child: Column(
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
BlocProvider.of<SettingBloc>( BlocProvider.of<SettingBloc>(context).add(
context) FetchIcons(
.add(FetchIcons(
expanded: !context expanded: !context
.read<SettingBloc>() .read<SettingBloc>()
.isExpanded)); .isExpanded));
}, },
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment MainAxisAlignment.spaceBetween,
.spaceBetween,
children: [ children: [
Text( Text(
'Icons', 'Icons',
@ -238,17 +209,14 @@ class SettingHelper {
.textTheme .textTheme
.bodyMedium! .bodyMedium!
.copyWith( .copyWith(
color: ColorsManager color:
.textPrimaryColor, ColorsManager.textPrimaryColor,
fontWeight: fontWeight: FontWeight.w400,
FontWeight.w400,
fontSize: 14), fontSize: 14),
), ),
const Icon( const Icon(
Icons Icons.arrow_forward_ios_outlined,
.arrow_forward_ios_outlined, color: ColorsManager.textGray,
color:
ColorsManager.textGray,
size: 15, size: 15,
) )
], ],
@ -264,8 +232,7 @@ class SettingHelper {
height: 5, height: 5,
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
'Show on devices page', 'Show on devices page',
@ -273,21 +240,17 @@ class SettingHelper {
.textTheme .textTheme
.bodyMedium! .bodyMedium!
.copyWith( .copyWith(
color: ColorsManager color: ColorsManager.textPrimaryColor,
.textPrimaryColor, fontWeight: FontWeight.w400,
fontWeight:
FontWeight.w400,
fontSize: 14), fontSize: 14),
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.end,
MainAxisAlignment.end,
children: [ children: [
Container( Container(
height: 30, height: 30,
width: 1, width: 1,
color: ColorsManager color: ColorsManager.graysColor,
.graysColor,
), ),
Transform.scale( Transform.scale(
scale: .8, scale: .8,
@ -311,8 +274,7 @@ class SettingHelper {
height: 5, height: 5,
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
'Executed by', 'Executed by',
@ -320,10 +282,8 @@ class SettingHelper {
.textTheme .textTheme
.bodyMedium! .bodyMedium!
.copyWith( .copyWith(
color: ColorsManager color: ColorsManager.textPrimaryColor,
.textPrimaryColor, fontWeight: FontWeight.w400,
fontWeight:
FontWeight.w400,
fontSize: 14), fontSize: 14),
), ),
Text('Cloud', Text('Cloud',
@ -331,17 +291,12 @@ class SettingHelper {
.textTheme .textTheme
.bodyMedium! .bodyMedium!
.copyWith( .copyWith(
color: ColorsManager color: ColorsManager.textGray,
.textGray, fontWeight: FontWeight.w400,
fontWeight:
FontWeight.w400,
fontSize: 14)), fontSize: 14)),
], ],
), ),
if (context if (context.read<RoutineBloc>().state.isUpdate ??
.read<RoutineBloc>()
.state
.isUpdate ??
false) false)
const DeleteSceneWidget() const DeleteSceneWidget()
], ],
@ -349,14 +304,12 @@ class SettingHelper {
], ],
), ),
), ),
if (context.read<SettingBloc>().isExpanded && if (context.read<SettingBloc>().isExpanded && !isAutomation)
!isAutomation)
SizedBox( SizedBox(
width: 400, width: 400,
height: 150, height: 150,
child: settingState is LoadingState child: settingState is LoadingState
? const Center( ? const Center(child: CircularProgressIndicator())
child: CircularProgressIndicator())
: GridView.builder( : GridView.builder(
gridDelegate: gridDelegate:
const SliverGridDelegateWithFixedCrossAxisCount( const SliverGridDelegateWithFixedCrossAxisCount(
@ -373,8 +326,7 @@ class SettingHelper {
height: 35, height: 35,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
BlocProvider.of<SettingBloc>( BlocProvider.of<SettingBloc>(context)
context)
.add(SelectIcon( .add(SelectIcon(
iconId: iconModel.uuid, iconId: iconModel.uuid,
)); ));
@ -383,14 +335,12 @@ class SettingHelper {
child: SizedBox( child: SizedBox(
child: ClipOval( child: ClipOval(
child: Container( child: Container(
padding: padding: const EdgeInsets.all(1),
const EdgeInsets.all(1),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: selectedIcon == color: selectedIcon == iconModel.uuid
iconModel.uuid
? ColorsManager ? ColorsManager
.opaquePrimary .primaryColorWithOpacity
: Colors.transparent, : Colors.transparent,
width: 2, width: 2,
), ),
@ -406,12 +356,8 @@ class SettingHelper {
); );
}, },
)), )),
if (context.read<SettingBloc>().isExpanded && if (context.read<SettingBloc>().isExpanded && isAutomation)
isAutomation) const SizedBox(height: 350, width: 400, child: EffectivePeriodView())
const SizedBox(
height: 350,
width: 400,
child: EffectivePeriodView())
], ],
), ),
Container( Container(
@ -435,31 +381,23 @@ class SettingHelper {
alignment: AlignmentDirectional.center, alignment: AlignmentDirectional.center,
child: Text( child: Text(
'Cancel', 'Cancel',
style: Theme.of(context) style: Theme.of(context).textTheme.bodyMedium!.copyWith(
.textTheme
.bodyMedium!
.copyWith(
color: ColorsManager.textGray, color: ColorsManager.textGray,
), ),
), ),
), ),
), ),
), ),
Container( Container(width: 1, height: 50, color: ColorsManager.greyColor),
width: 1,
height: 50,
color: ColorsManager.greyColor),
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
if (isAutomation) { if (isAutomation) {
BlocProvider.of<RoutineBloc>(context).add( BlocProvider.of<RoutineBloc>(context).add(
EffectiveTimePeriodEvent(EffectiveTime( EffectiveTimePeriodEvent(EffectiveTime(
start: start: effectPeriodState.customStartTime!,
effectPeriodState.customStartTime!,
end: effectPeriodState.customEndTime!, end: effectPeriodState.customEndTime!,
loops: effectPeriodState loops: effectPeriodState.selectedDaysBinary)));
.selectedDaysBinary)));
Navigator.of(context).pop(); Navigator.of(context).pop();
} else { } else {
Navigator.of(context).pop(selectedIcon); Navigator.of(context).pop(selectedIcon);
@ -469,11 +407,8 @@ class SettingHelper {
alignment: AlignmentDirectional.center, alignment: AlignmentDirectional.center,
child: Text( child: Text(
'Confirm', 'Confirm',
style: Theme.of(context) style: Theme.of(context).textTheme.bodyMedium!.copyWith(
.textTheme color: ColorsManager.primaryColorWithOpacity,
.bodyMedium!
.copyWith(
color: ColorsManager.opaquePrimary,
), ),
), ),
), ),

View File

@ -88,17 +88,19 @@ class ThreeGangSwitchHelper {
size: 16, size: 16,
color: ColorsManager.textGray, color: ColorsManager.textGray,
), ),
onTap: () => onTap: () => RoutineTapFunctionHelper
RoutineTapFunctionHelper.onTapFunction( .onTapFunction(
context, context,
functionCode: function.code, functionCode: function.code,
functionOperationName: functionOperationName:
function.operationName, function.operationName,
functionValueDescription: functionValueDescription:
selectedFunctionData.valueDescription, selectedFunctionData
.valueDescription,
deviceUuid: device?.uuid, deviceUuid: device?.uuid,
codesToAddIntoFunctionsWithDefaultValue: codesToAddIntoFunctionsWithDefaultValue:
function.code.startsWith('countdown') function.code
.startsWith('countdown')
? [function.code] ? [function.code]
: [], : [],
), ),
@ -112,10 +114,12 @@ class ThreeGangSwitchHelper {
child: _buildValueSelector( child: _buildValueSelector(
context: context, context: context,
selectedFunction: selectedFunction, selectedFunction: selectedFunction,
selectedFunctionData: selectedFunctionData, selectedFunctionData:
selectedFunctionData,
switchFunctions: switchFunctions, switchFunctions: switchFunctions,
device: device, device: device,
operationName: selectedOperationName ?? '', operationName:
selectedOperationName ?? '',
removeComparetors: removeComparetors, removeComparetors: removeComparetors,
dialogType: dialogType), dialogType: dialogType),
), ),
@ -184,7 +188,8 @@ class ThreeGangSwitchHelper {
dialogType: dialogType); dialogType: dialogType);
} }
final selectedFn = switchFunctions.firstWhere((f) => f.code == selectedFunction); final selectedFn =
switchFunctions.firstWhere((f) => f.code == selectedFunction);
final values = selectedFn.getOperationalValues(); final values = selectedFn.getOperationalValues();
return _buildOperationalValuesList( return _buildOperationalValuesList(
@ -302,9 +307,13 @@ class ThreeGangSwitchHelper {
style: context.textTheme.bodyMedium, style: context.textTheme.bodyMedium,
), ),
trailing: Icon( trailing: Icon(
isSelected ? Icons.radio_button_checked : Icons.radio_button_unchecked, isSelected
? Icons.radio_button_checked
: Icons.radio_button_unchecked,
size: 24, size: 24,
color: isSelected ? ColorsManager.opaquePrimary : ColorsManager.textGray, color: isSelected
? ColorsManager.primaryColorWithOpacity
: ColorsManager.textGray,
), ),
onTap: () { onTap: () {
if (!isSelected) { if (!isSelected) {
@ -316,7 +325,8 @@ class ThreeGangSwitchHelper {
operationName: operationName, operationName: operationName,
value: value.value, value: value.value,
condition: selectedFunctionData?.condition, condition: selectedFunctionData?.condition,
valueDescription: selectedFunctionData?.valueDescription, valueDescription:
selectedFunctionData?.valueDescription,
), ),
), ),
); );

View File

@ -89,14 +89,15 @@ class TwoGangSwitchHelper {
size: 16, size: 16,
color: ColorsManager.textGray, color: ColorsManager.textGray,
), ),
onTap: () => onTap: () => RoutineTapFunctionHelper
RoutineTapFunctionHelper.onTapFunction( .onTapFunction(
context, context,
functionCode: function.code, functionCode: function.code,
functionOperationName: functionOperationName:
function.operationName, function.operationName,
functionValueDescription: functionValueDescription:
selectedFunctionData.valueDescription, selectedFunctionData
.valueDescription,
deviceUuid: device?.uuid, deviceUuid: device?.uuid,
codesToAddIntoFunctionsWithDefaultValue: [ codesToAddIntoFunctionsWithDefaultValue: [
'countdown_1', 'countdown_1',
@ -146,10 +147,13 @@ class TwoGangSwitchHelper {
// } // }
final selectedFunctionData = final selectedFunctionData =
state.addedFunctions.firstWhere( state.addedFunctions.firstWhere(
(f) => f.functionCode == state.selectedFunction, (f) =>
f.functionCode ==
state.selectedFunction,
orElse: () => DeviceFunctionData( orElse: () => DeviceFunctionData(
entityId: '', entityId: '',
functionCode: state.selectedFunction ?? '', functionCode:
state.selectedFunction ?? '',
operationName: '', operationName: '',
value: null, value: null,
), ),
@ -188,7 +192,8 @@ class TwoGangSwitchHelper {
required bool removeComparetors, required bool removeComparetors,
required String dialogType, required String dialogType,
}) { }) {
if (selectedFunction == 'countdown_1' || selectedFunction == 'countdown_2') { if (selectedFunction == 'countdown_1' ||
selectedFunction == 'countdown_2') {
final initialValue = selectedFunctionData?.value ?? 0; final initialValue = selectedFunctionData?.value ?? 0;
return _buildTemperatureSelector( return _buildTemperatureSelector(
context: context, context: context,
@ -202,7 +207,8 @@ class TwoGangSwitchHelper {
dialogType: dialogType); dialogType: dialogType);
} }
final selectedFn = switchFunctions.firstWhere((f) => f.code == selectedFunction); final selectedFn =
switchFunctions.firstWhere((f) => f.code == selectedFunction);
final values = selectedFn.getOperationalValues(); final values = selectedFn.getOperationalValues();
return _buildOperationalValuesList( return _buildOperationalValuesList(
@ -264,15 +270,16 @@ class TwoGangSwitchHelper {
); );
}, },
borderRadius: const BorderRadius.all(Radius.circular(8)), borderRadius: const BorderRadius.all(Radius.circular(8)),
selectedBorderColor: ColorsManager.opaquePrimary, selectedBorderColor: ColorsManager.primaryColorWithOpacity,
selectedColor: Colors.white, selectedColor: Colors.white,
fillColor: ColorsManager.opaquePrimary, fillColor: ColorsManager.primaryColorWithOpacity,
color: ColorsManager.opaquePrimary, color: ColorsManager.primaryColorWithOpacity,
constraints: const BoxConstraints( constraints: const BoxConstraints(
minHeight: 40.0, minHeight: 40.0,
minWidth: 40.0, minWidth: 40.0,
), ),
isSelected: conditions.map((c) => c == (currentCondition ?? "==")).toList(), isSelected:
conditions.map((c) => c == (currentCondition ?? "==")).toList(),
children: conditions.map((c) => Text(c)).toList(), children: conditions.map((c) => Text(c)).toList(),
); );
} }
@ -288,13 +295,13 @@ class TwoGangSwitchHelper {
return Container( return Container(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: ColorsManager.opaquePrimary.withOpacity(0.1), color: ColorsManager.primaryColorWithOpacity.withOpacity(0.1),
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
), ),
child: Text( child: Text(
DurationFormatMixin.formatDuration(initialValue?.toInt() ?? 0), DurationFormatMixin.formatDuration(initialValue?.toInt() ?? 0),
style: context.textTheme.headlineMedium!.copyWith( style: context.textTheme.headlineMedium!.copyWith(
color: ColorsManager.opaquePrimary, color: ColorsManager.primaryColorWithOpacity,
), ),
), ),
); );
@ -331,7 +338,8 @@ class TwoGangSwitchHelper {
); );
}, },
onTextChanged: (value) { onTextChanged: (value) {
final roundedValue = value.round(); // Round to nearest integer (stepSize 1) final roundedValue =
value.round(); // Round to nearest integer (stepSize 1)
context.read<FunctionBloc>().add( context.read<FunctionBloc>().add(
AddFunction( AddFunction(
functionData: DeviceFunctionData( functionData: DeviceFunctionData(
@ -383,9 +391,13 @@ class TwoGangSwitchHelper {
style: context.textTheme.bodyMedium, style: context.textTheme.bodyMedium,
), ),
trailing: Icon( trailing: Icon(
isSelected ? Icons.radio_button_checked : Icons.radio_button_unchecked, isSelected
? Icons.radio_button_checked
: Icons.radio_button_unchecked,
size: 24, size: 24,
color: isSelected ? ColorsManager.opaquePrimary : ColorsManager.textGray, color: isSelected
? ColorsManager.primaryColorWithOpacity
: ColorsManager.textGray,
), ),
onTap: () { onTap: () {
if (!isSelected) { if (!isSelected) {
@ -397,7 +409,8 @@ class TwoGangSwitchHelper {
operationName: operationName, operationName: operationName,
value: value.value, value: value.value,
condition: selectedFunctionData?.condition, condition: selectedFunctionData?.condition,
valueDescription: selectedFunctionData?.valueDescription, valueDescription:
selectedFunctionData?.valueDescription,
), ),
), ),
); );

View File

@ -61,9 +61,8 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
children: [ children: [
ConstrainedBox( ConstrainedBox(
constraints: BoxConstraints( constraints: BoxConstraints(
maxWidth: constraints.maxWidth > 700 maxWidth:
? 450 constraints.maxWidth > 700 ? 450 : constraints.maxWidth - 32),
: constraints.maxWidth - 32),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -72,9 +71,7 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
children: [ children: [
Text('* ', Text('* ',
style: context.textTheme.bodyMedium! style: context.textTheme.bodyMedium!
.copyWith( .copyWith(color: ColorsManager.red, fontSize: 13)),
color: ColorsManager.red,
fontSize: 13)),
Text( Text(
'Routine Name', 'Routine Name',
style: context.textTheme.bodyMedium!.copyWith( style: context.textTheme.bodyMedium!.copyWith(
@ -96,11 +93,9 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
decoration: InputDecoration( decoration: InputDecoration(
hintText: 'Please enter the name', hintText: 'Please enter the name',
hintStyle: context.textTheme.bodyMedium! hintStyle: context.textTheme.bodyMedium!
.copyWith( .copyWith(fontSize: 12, color: ColorsManager.grayColor),
fontSize: 12, contentPadding:
color: ColorsManager.grayColor), const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
contentPadding: const EdgeInsets.symmetric(
horizontal: 12, vertical: 10),
border: InputBorder.none, border: InputBorder.none,
), ),
onTapOutside: (_) { onTapOutside: (_) {
@ -126,11 +121,9 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
width: 200, width: 200,
child: Center( child: Center(
child: DefaultButton( child: DefaultButton(
onPressed: state.isAutomation || onPressed: state.isAutomation || state.isTabToRun
state.isTabToRun
? () async { ? () async {
final result = await SettingHelper final result = await SettingHelper.showSettingDialog(
.showSettingDialog(
context: context, context: context,
iconId: state.selectedIcon ?? '', iconId: state.selectedIcon ?? '',
); );
@ -193,12 +186,10 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
child: Center( child: Center(
child: DefaultButton( child: DefaultButton(
onPressed: () async { onPressed: () async {
if (state.routineName == null || if (state.routineName == null || state.routineName!.isEmpty) {
state.routineName!.isEmpty) {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
content: const Text( content: const Text('Please enter the routine name'),
'Please enter the routine name'),
duration: const Duration(seconds: 2), duration: const Duration(seconds: 2),
backgroundColor: ColorsManager.red, backgroundColor: ColorsManager.red,
action: SnackBarAction( action: SnackBarAction(
@ -212,12 +203,10 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
return; return;
} }
if (state.ifItems.isEmpty || if (state.ifItems.isEmpty || state.thenItems.isEmpty) {
state.thenItems.isEmpty) {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
content: const Text( content: const Text('Please add if and then condition'),
'Please add if and then condition'),
duration: const Duration(seconds: 2), duration: const Duration(seconds: 2),
backgroundColor: ColorsManager.red, backgroundColor: ColorsManager.red,
action: SnackBarAction( action: SnackBarAction(
@ -232,8 +221,7 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
} }
// final result = // final result =
// await // await
BlocProvider.of<RoutineBloc>(context) BlocProvider.of<RoutineBloc>(context).add(ResetErrorMessage());
.add(ResetErrorMessage());
SaveRoutineHelper.showSaveRoutineDialog(context); SaveRoutineHelper.showSaveRoutineDialog(context);
// if (result != null && result) { // if (result != null && result) {
// BlocProvider.of<RoutineBloc>(context).add( // BlocProvider.of<RoutineBloc>(context).add(
@ -252,7 +240,7 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
color: ColorsManager.white, color: ColorsManager.whiteColors,
), ),
), ),
), ),
@ -273,14 +261,10 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
child: DefaultButton( child: DefaultButton(
onPressed: state.isAutomation || state.isTabToRun onPressed: state.isAutomation || state.isTabToRun
? () async { ? () async {
final result = final result = await SettingHelper.showSettingDialog(
await SettingHelper.showSettingDialog( context: context, iconId: state.selectedIcon ?? '');
context: context,
iconId: state.selectedIcon ?? '');
if (result != null) { if (result != null) {
context context.read<RoutineBloc>().add(AddSelectedIcon(result));
.read<RoutineBloc>()
.add(AddSelectedIcon(result));
} }
} }
: null, : null,
@ -330,12 +314,10 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
child: Center( child: Center(
child: DefaultButton( child: DefaultButton(
onPressed: () async { onPressed: () async {
if (state.routineName == null || if (state.routineName == null || state.routineName!.isEmpty) {
state.routineName!.isEmpty) {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
content: content: const Text('Please enter the routine name'),
const Text('Please enter the routine name'),
duration: const Duration(seconds: 2), duration: const Duration(seconds: 2),
backgroundColor: ColorsManager.red, backgroundColor: ColorsManager.red,
action: SnackBarAction( action: SnackBarAction(
@ -352,8 +334,7 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
if (state.ifItems.isEmpty || state.thenItems.isEmpty) { if (state.ifItems.isEmpty || state.thenItems.isEmpty) {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
content: const Text( content: const Text('Please add if and then condition'),
'Please add if and then condition'),
duration: const Duration(seconds: 2), duration: const Duration(seconds: 2),
backgroundColor: ColorsManager.red, backgroundColor: ColorsManager.red,
action: SnackBarAction( action: SnackBarAction(
@ -368,8 +349,7 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
} }
// final result = // final result =
// await // await
BlocProvider.of<RoutineBloc>(context) BlocProvider.of<RoutineBloc>(context).add(ResetErrorMessage());
.add(ResetErrorMessage());
SaveRoutineHelper.showSaveRoutineDialog(context); SaveRoutineHelper.showSaveRoutineDialog(context);
// if (result != null && result) { // if (result != null && result) {
// BlocProvider.of<RoutineBloc>(context).add( // BlocProvider.of<RoutineBloc>(context).add(
@ -388,7 +368,7 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
color: ColorsManager.white, color: ColorsManager.whiteColors,
), ),
), ),
), ),

View File

@ -19,13 +19,13 @@ class ValueDisplay extends StatelessWidget {
return Container( return Container(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: ColorsManager.opaquePrimary.withOpacity(0.1), color: ColorsManager.primaryColorWithOpacity.withOpacity(0.1),
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
), ),
child: Text( child: Text(
'$label $unit ', '$label $unit ',
style: context.textTheme.headlineMedium!.copyWith( style: context.textTheme.headlineMedium!.copyWith(
color: ColorsManager.opaquePrimary, color: ColorsManager.primaryColorWithOpacity,
), ),
), ),
); );

View File

@ -1,29 +1,12 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_web/pages/space_management_v2/modules/communities/domain/models/community_model.dart'; import 'package:syncrow_web/pages/space_management_v2/modules/communities/domain/models/community_model.dart';
import 'package:syncrow_web/pages/space_management_v2/modules/communities/presentation/bloc/communities_bloc.dart';
import 'package:syncrow_web/pages/space_management_v2/modules/communities/presentation/communities_tree_selection_bloc/communities_tree_selection_bloc.dart';
import 'package:syncrow_web/pages/space_management_v2/modules/create_community/presentation/create_community_dialog.dart'; import 'package:syncrow_web/pages/space_management_v2/modules/create_community/presentation/create_community_dialog.dart';
import 'package:syncrow_web/pages/space_management_v2/modules/update_community/presentation/edit_community_dialog.dart'; import 'package:syncrow_web/pages/space_management_v2/modules/update_community/presentation/edit_community_dialog.dart';
import 'package:syncrow_web/utils/extension/app_snack_bar.dart';
abstract final class SpaceManagementCommunityDialogHelper { abstract final class SpaceManagementCommunityDialogHelper {
static void showCreateDialog(BuildContext context) => showDialog<void>( static void showCreateDialog(BuildContext context) => showDialog<void>(
context: context, context: context,
builder: (_) => CreateCommunityDialog( builder: (_) => const CreateCommunityDialog(),
onSuccess: (community) {
context.showSuccessSnackbar(
'${community.name} community created successfully',
);
context.read<CommunitiesBloc>().add(
InsertCommunity(community),
);
context.read<CommunitiesTreeSelectionBloc>().add(
SelectCommunityEvent(community: community),
);
},
),
); );
static void showEditDialog( static void showEditDialog(

View File

@ -50,7 +50,7 @@ class _CommunityDialogState extends State<CommunityDialog> {
width: MediaQuery.of(context).size.width * 0.3, width: MediaQuery.of(context).size.width * 0.3,
padding: const EdgeInsets.all(20), padding: const EdgeInsets.all(20),
decoration: BoxDecoration( decoration: BoxDecoration(
color: ColorsManager.white, color: ColorsManager.whiteColors,
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
@ -110,7 +110,7 @@ class _CommunityDialogState extends State<CommunityDialog> {
} }
}, },
borderRadius: 10, borderRadius: 10,
foregroundColor: ColorsManager.white, foregroundColor: ColorsManager.whiteColors,
child: const Text('OK'), child: const Text('OK'),
), ),
); );

View File

@ -17,7 +17,7 @@ class CommunityStructureHeader extends StatelessWidget {
return Container( return Container(
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0), padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
decoration: BoxDecoration( decoration: BoxDecoration(
color: ColorsManager.white, color: ColorsManager.whiteColors,
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: ColorsManager.shadowBlackColor.withValues(alpha: 0.1), color: ColorsManager.shadowBlackColor.withValues(alpha: 0.1),

View File

@ -23,55 +23,62 @@ class _CreateSpaceButtonState extends State<CreateSpaceButton> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return InkWell( return Tooltip(
onTap: () => SpaceDetailsDialogHelper.showCreate( margin: const EdgeInsets.symmetric(vertical: 24),
context, message: 'Create a new space',
communityUuid: widget.community.uuid, child: InkWell(
onSuccess: (updatedSpaceModel) { onTap: () => SpaceDetailsDialogHelper.showCreate(
final newCommunity = widget.community.copyWith( context,
spaces: [...widget.community.spaces, updatedSpaceModel], communityUuid: widget.community.uuid,
); onSuccess: (updatedSpaceModel) {
context.read<CommunitiesBloc>().add( final newCommunity = widget.community.copyWith(
CommunitiesUpdateCommunity(newCommunity), spaces: [...widget.community.spaces, updatedSpaceModel],
); );
context.read<CommunitiesTreeSelectionBloc>().add( context.read<CommunitiesBloc>().add(
SelectSpaceEvent( CommunitiesUpdateCommunity(newCommunity),
space: updatedSpaceModel, );
community: newCommunity, context.read<CommunitiesTreeSelectionBloc>().add(
), SelectSpaceEvent(
); space: updatedSpaceModel,
}, community: newCommunity,
), ),
child: MouseRegion( );
onEnter: (_) => setState(() => _isHovered = true), },
onExit: (_) => setState(() => _isHovered = false), ),
child: AnimatedOpacity( child: MouseRegion(
duration: const Duration(milliseconds: 100), onEnter: (_) => setState(() => _isHovered = true),
opacity: _isHovered ? 1.0 : 0.45, onExit: (_) => setState(() => _isHovered = false),
child: Container( child: AnimatedOpacity(
width: 150, duration: const Duration(milliseconds: 100),
height: 90, opacity: _isHovered ? 1.0 : 0.45,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
boxShadow: [
BoxShadow(
color: Colors.grey.withValues(alpha: 0.8),
spreadRadius: 3,
blurRadius: 8,
offset: const Offset(0, 4),
),
],
),
child: Container( child: Container(
margin: const EdgeInsets.symmetric(vertical: 20), width: 150,
height: 90,
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color: ColorsManager.borderColor, width: 2), color: Colors.white,
color: ColorsManager.boxColor, borderRadius: BorderRadius.circular(20),
shape: BoxShape.circle, boxShadow: [
BoxShadow(
color: Colors.grey.withValues(alpha: 0.2),
spreadRadius: 3,
blurRadius: 8,
offset: const Offset(0, 4),
),
],
), ),
child: const Center( child: Container(
child: Icon(Icons.add, color: ColorsManager.vividBlue), margin: const EdgeInsets.symmetric(vertical: 20),
decoration: BoxDecoration(
border: Border.all(color: ColorsManager.borderColor, width: 2),
color: ColorsManager.boxColor,
shape: BoxShape.circle,
),
child: const Center(
child: Icon(
Icons.add,
color: Colors.blue,
),
),
), ),
), ),
), ),

View File

@ -16,7 +16,7 @@ class PlusButtonWidget extends StatelessWidget {
style: IconButton.styleFrom(backgroundColor: ColorsManager.spaceColor), style: IconButton.styleFrom(backgroundColor: ColorsManager.spaceColor),
icon: const Icon( icon: const Icon(
Icons.add, Icons.add,
color: ColorsManager.white, color: ColorsManager.whiteColors,
size: 20, size: 20,
), ),
); );

Some files were not shown because too many files have changed in this diff Show More