mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-08-24 23:32:27 +00:00
SP-1972-delete-space-reworks (#368)
<!-- Thanks for contributing! Provide a description of your changes below and a general summary in the title Please look at the following checklist to ensure that your PR can be accepted quickly: --> ## Jira Ticket [SP-1972](https://syncrow.atlassian.net/browse/SP-1972) ## Description Enhanced UI design of delete space feature. ## Type of Change <!--- Put an `x` in all the boxes that apply: --> - [ ] ✨ New feature (non-breaking change which adds functionality) - [ x ] 🛠️ Bug fix (non-breaking change which fixes an issue) - [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change) - [ ] 🧹 Code refactor - [ ] ✅ Build configuration change - [ ] 📝 Documentation - [ ] 🗑️ Chore [SP-1972]: https://syncrow.atlassian.net/browse/SP-1972?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
This commit is contained in:
@ -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.whiteColors,
|
color: ColorsManager.white,
|
||||||
constraints: const BoxConstraints(
|
constraints: const BoxConstraints(
|
||||||
maxHeight: 200.0, // Set max height for dropdown
|
maxHeight: 200.0, // Set max height for dropdown
|
||||||
),
|
),
|
||||||
@ -87,12 +87,10 @@ class _DialogDropdownState extends State<DialogDropdown> {
|
|||||||
child: ListTile(
|
child: ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
item,
|
item,
|
||||||
style: Theme.of(context)
|
style:
|
||||||
.textTheme
|
Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||||
.bodyMedium
|
color: ColorsManager.textPrimaryColor,
|
||||||
?.copyWith(
|
),
|
||||||
color: ColorsManager.textPrimaryColor,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
widget.onSelected(item);
|
widget.onSelected(item);
|
||||||
|
@ -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.whiteColors,
|
this.backgroundColor = ColorsManager.white,
|
||||||
this.borderColor = ColorsManager.spaceColor,
|
this.borderColor = ColorsManager.spaceColor,
|
||||||
this.borderRadius = 16.0,
|
this.borderRadius = 16.0,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
@ -24,10 +24,9 @@ class EditChip extends StatelessWidget {
|
|||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
child: Chip(
|
child: Chip(
|
||||||
label: Text(
|
label: Text(label,
|
||||||
label,
|
style:
|
||||||
style: Theme.of(context).textTheme.bodySmall!.copyWith(color: labelColor)
|
Theme.of(context).textTheme.bodySmall!.copyWith(color: labelColor)),
|
||||||
),
|
|
||||||
backgroundColor: backgroundColor,
|
backgroundColor: backgroundColor,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(borderRadius),
|
borderRadius: BorderRadius.circular(borderRadius),
|
||||||
|
@ -17,8 +17,7 @@ class TagDialogTextfieldDropdown extends StatefulWidget {
|
|||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_DialogTextfieldDropdownState createState() =>
|
_DialogTextfieldDropdownState createState() => _DialogTextfieldDropdownState();
|
||||||
_DialogTextfieldDropdownState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _DialogTextfieldDropdownState extends State<TagDialogTextfieldDropdown> {
|
class _DialogTextfieldDropdownState extends State<TagDialogTextfieldDropdown> {
|
||||||
@ -97,7 +96,7 @@ class _DialogTextfieldDropdownState extends State<TagDialogTextfieldDropdown> {
|
|||||||
child: Material(
|
child: Material(
|
||||||
elevation: 4.0,
|
elevation: 4.0,
|
||||||
child: Container(
|
child: Container(
|
||||||
color: ColorsManager.whiteColors,
|
color: ColorsManager.white,
|
||||||
constraints: const BoxConstraints(maxHeight: 200.0),
|
constraints: const BoxConstraints(maxHeight: 200.0),
|
||||||
child: StatefulBuilder(
|
child: StatefulBuilder(
|
||||||
builder: (context, setStateDropdown) {
|
builder: (context, setStateDropdown) {
|
||||||
@ -122,8 +121,7 @@ class _DialogTextfieldDropdownState extends State<TagDialogTextfieldDropdown> {
|
|||||||
.textTheme
|
.textTheme
|
||||||
.bodyMedium
|
.bodyMedium
|
||||||
?.copyWith(
|
?.copyWith(
|
||||||
color: ColorsManager
|
color: ColorsManager.textPrimaryColor)),
|
||||||
.textPrimaryColor)),
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
_controller.text = tag.tag ?? '';
|
_controller.text = tag.tag ?? '';
|
||||||
widget.onSelected(tag);
|
widget.onSelected(tag);
|
||||||
|
@ -5,19 +5,20 @@ 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; // Add this to track selection
|
final bool isSelected;
|
||||||
final bool? isExpanded; // External control over expansion
|
final bool? isExpanded;
|
||||||
final ValueChanged<bool>? onExpansionChanged; // Notify when expansion changes
|
final ValueChanged<bool>? onExpansionChanged;
|
||||||
final VoidCallback? onItemSelected; // Callback for selecting the item
|
final VoidCallback? onItemSelected;
|
||||||
|
|
||||||
CustomExpansionTile({
|
const CustomExpansionTile({
|
||||||
|
super.key,
|
||||||
required this.title,
|
required this.title,
|
||||||
this.children,
|
this.children,
|
||||||
this.initiallyExpanded = false,
|
this.initiallyExpanded = false,
|
||||||
this.isExpanded, // Allow external control over expansion
|
this.isExpanded,
|
||||||
this.onExpansionChanged, // Notify when expansion changes
|
this.onExpansionChanged,
|
||||||
this.onItemSelected, // Trigger item selection when name is tapped
|
this.onItemSelected,
|
||||||
required this.isSelected, // Add this to initialize selection state
|
required this.isSelected,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -25,7 +26,7 @@ class CustomExpansionTile extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class CustomExpansionTileState extends State<CustomExpansionTile> {
|
class CustomExpansionTileState extends State<CustomExpansionTile> {
|
||||||
bool _isExpanded = false; // Local expansion state
|
bool _isExpanded = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -36,7 +37,6 @@ 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,7 +44,6 @@ 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);
|
||||||
@ -56,7 +55,6 @@ 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: () {
|
||||||
@ -70,38 +68,33 @@ 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.0, // Adjusted size for better alignment
|
size: 16,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// 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!();
|
widget.onItemSelected!.call();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
_capitalizeFirstLetter(widget.title),
|
_capitalizeFirstLetter(widget.title),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: widget.isSelected
|
color: widget.isSelected
|
||||||
? ColorsManager
|
? ColorsManager.blackColor
|
||||||
.blackColor // Change color to black when selected
|
: ColorsManager.lightGrayColor,
|
||||||
: ColorsManager
|
fontWeight:
|
||||||
.lightGrayColor, // Gray when not selected
|
widget.isSelected ? FontWeight.w600 : FontWeight.w400,
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
// The expanded section (children) that shows when the tile is expanded
|
if (_isExpanded && widget.children != null && widget.children!.isNotEmpty)
|
||||||
if (_isExpanded &&
|
|
||||||
widget.children != null &&
|
|
||||||
widget.children!.isNotEmpty)
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 24.0), // Indented children
|
padding: const EdgeInsets.only(left: 24),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: widget.children!,
|
children: widget.children!,
|
||||||
|
@ -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 Function(String)? onSearchChanged; // Callback for search input changes
|
final void Function(String)? onSearchChanged;
|
||||||
|
|
||||||
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.whiteColors,
|
color: ColorsManager.white,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Colors.black.withOpacity(0.2),
|
color: ColorsManager.shadowBlackColor.withValues(alpha: 0.1),
|
||||||
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, // Call the callback on text change
|
onChanged: widget.onSearchChanged,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: ColorsManager.textFieldGreyColor,
|
fillColor: ColorsManager.textFieldGreyColor,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
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:calendar_view/calendar_view.dart';
|
import 'package:syncrow_web/pages/access_management/booking_system/data/services/memory_bookable_space_service.dart';
|
||||||
import 'package:syncrow_web/pages/access_management/booking_system/data/services/remote_calendar_service.dart';
|
import 'package:syncrow_web/pages/access_management/booking_system/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';
|
||||||
@ -8,7 +9,6 @@ import 'package:syncrow_web/pages/access_management/booking_system/presentation/
|
|||||||
import 'package:syncrow_web/pages/access_management/booking_system/presentation/bloc/date_selection/date_selection_event.dart';
|
import 'package:syncrow_web/pages/access_management/booking_system/presentation/bloc/date_selection/date_selection_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.whiteColors,
|
color: ColorsManager.white,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: ColorsManager.blackColor.withOpacity(0.1),
|
color: ColorsManager.blackColor.withOpacity(0.1),
|
||||||
@ -142,8 +142,7 @@ class _BookingPageContentState extends State<_BookingPageContent> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child:
|
child: BlocBuilder<DateSelectionBloc, DateSelectionState>(
|
||||||
BlocBuilder<DateSelectionBloc, DateSelectionState>(
|
|
||||||
builder: (context, dateState) {
|
builder: (context, dateState) {
|
||||||
return CustomCalendarPage(
|
return CustomCalendarPage(
|
||||||
selectedDate: dateState.selectedDate,
|
selectedDate: dateState.selectedDate,
|
||||||
@ -152,8 +151,9 @@ class _BookingPageContentState extends State<_BookingPageContent> {
|
|||||||
context
|
context
|
||||||
.read<DateSelectionBloc>()
|
.read<DateSelectionBloc>()
|
||||||
.add(SelectDate(newDate));
|
.add(SelectDate(newDate));
|
||||||
context.read<DateSelectionBloc>().add(
|
context
|
||||||
SelectDateFromSidebarCalendar(newDate));
|
.read<DateSelectionBloc>()
|
||||||
|
.add(SelectDateFromSidebarCalendar(newDate));
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -193,8 +193,7 @@ 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 =
|
final weekEnd = weekStart.add(const Duration(days: 6));
|
||||||
weekStart.add(const Duration(days: 6));
|
|
||||||
return WeekNavigation(
|
return WeekNavigation(
|
||||||
weekStart: weekStart,
|
weekStart: weekStart,
|
||||||
weekEnd: weekEnd,
|
weekEnd: weekEnd,
|
||||||
@ -204,9 +203,7 @@ class _BookingPageContentState extends State<_BookingPageContent> {
|
|||||||
.add(PreviousWeek());
|
.add(PreviousWeek());
|
||||||
},
|
},
|
||||||
onNextWeek: () {
|
onNextWeek: () {
|
||||||
context
|
context.read<DateSelectionBloc>().add(NextWeek());
|
||||||
.read<DateSelectionBloc>()
|
|
||||||
.add(NextWeek());
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -219,8 +216,7 @@ class _BookingPageContentState extends State<_BookingPageContent> {
|
|||||||
child: BlocBuilder<SelectedBookableSpaceBloc,
|
child: BlocBuilder<SelectedBookableSpaceBloc,
|
||||||
SelectedBookableSpaceState>(
|
SelectedBookableSpaceState>(
|
||||||
builder: (context, roomState) {
|
builder: (context, roomState) {
|
||||||
final selectedRoom =
|
final selectedRoom = roomState.selectedBookableSpace;
|
||||||
roomState.selectedBookableSpace;
|
|
||||||
return BlocBuilder<DateSelectionBloc,
|
return BlocBuilder<DateSelectionBloc,
|
||||||
DateSelectionState>(
|
DateSelectionState>(
|
||||||
builder: (context, dateState) {
|
builder: (context, dateState) {
|
||||||
@ -228,12 +224,10 @@ class _BookingPageContentState extends State<_BookingPageContent> {
|
|||||||
CalendarEventState>(
|
CalendarEventState>(
|
||||||
builder: (context, eventState) {
|
builder: (context, eventState) {
|
||||||
return WeeklyCalendarPage(
|
return WeeklyCalendarPage(
|
||||||
key: ValueKey(
|
key: ValueKey(selectedRoom?.uuid ?? 'no-room'),
|
||||||
selectedRoom?.uuid ?? 'no-room'),
|
startTime:
|
||||||
startTime: selectedRoom
|
selectedRoom?.bookableConfig.startTime,
|
||||||
?.bookableConfig.startTime,
|
endTime: selectedRoom?.bookableConfig.endTime,
|
||||||
endTime:
|
|
||||||
selectedRoom?.bookableConfig.endTime,
|
|
||||||
weekStart: dateState.weekStart,
|
weekStart: dateState.weekStart,
|
||||||
selectedDate: dateState.selectedDate,
|
selectedDate: dateState.selectedDate,
|
||||||
eventController: _eventController,
|
eventController: _eventController,
|
||||||
|
@ -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.whiteColors,
|
color: ColorsManager.white,
|
||||||
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.whiteColors,
|
color: ColorsManager.white,
|
||||||
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: const EdgeInsets.symmetric(
|
padding:
|
||||||
horizontal: 16.0, vertical: 8.0),
|
const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: ColorsManager.counterBackgroundColor,
|
color: ColorsManager.counterBackgroundColor,
|
||||||
@ -119,12 +119,10 @@ class __SidebarContentState extends State<_SidebarContent> {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TextField(
|
child: TextField(
|
||||||
style: Theme.of(context)
|
style:
|
||||||
.textTheme
|
Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||||
.bodyMedium
|
color: ColorsManager.blackColor,
|
||||||
?.copyWith(
|
),
|
||||||
color: ColorsManager.blackColor,
|
|
||||||
),
|
|
||||||
controller: searchController,
|
controller: searchController,
|
||||||
onChanged: _handleSearch,
|
onChanged: _handleSearch,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
@ -174,8 +172,7 @@ class __SidebarContentState extends State<_SidebarContent> {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
controller: _scrollController,
|
controller: _scrollController,
|
||||||
itemCount:
|
itemCount: state.displayedRooms.length + (state.hasMore ? 1 : 0),
|
||||||
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);
|
||||||
@ -186,9 +183,7 @@ class __SidebarContentState extends State<_SidebarContent> {
|
|||||||
room: room,
|
room: room,
|
||||||
isSelected: state.selectedRoomId == room.uuid,
|
isSelected: state.selectedRoomId == room.uuid,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context
|
context.read<SidebarBloc>().add(SelectRoomEvent(room.uuid));
|
||||||
.read<SidebarBloc>()
|
|
||||||
.add(SelectRoomEvent(room.uuid));
|
|
||||||
widget.onRoomSelected(room);
|
widget.onRoomSelected(room);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -52,21 +52,20 @@ class _SetupBookableSpacesDialogState extends State<SetupBookableSpacesDialog> {
|
|||||||
),
|
),
|
||||||
)..add(
|
)..add(
|
||||||
LoadUnBookableSpacesEvent(
|
LoadUnBookableSpacesEvent(
|
||||||
nonBookableSpacesParams:
|
nonBookableSpacesParams: NonBookableSpacesParams(currentPage: 1),
|
||||||
NonBookableSpacesParams(currentPage: 1),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
BlocProvider<SetupBookableSpacesBloc>(
|
BlocProvider<SetupBookableSpacesBloc>(
|
||||||
create: widget.editingBookableSpace == null
|
create: widget.editingBookableSpace == null
|
||||||
? (context) => SetupBookableSpacesBloc(
|
? (context) =>
|
||||||
RemoteNonBookableSpaces(HTTPService()))
|
SetupBookableSpacesBloc(RemoteNonBookableSpaces(HTTPService()))
|
||||||
: (context) => SetupBookableSpacesBloc(
|
: (context) =>
|
||||||
RemoteNonBookableSpaces(HTTPService()))
|
SetupBookableSpacesBloc(RemoteNonBookableSpaces(HTTPService()))
|
||||||
..add(
|
..add(
|
||||||
EditModeSelected(
|
EditModeSelected(
|
||||||
editingBookableSpace: widget.editingBookableSpace!),
|
editingBookableSpace: widget.editingBookableSpace!),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
BlocProvider(
|
BlocProvider(
|
||||||
create: (context) => SendBookableSpacesBloc(
|
create: (context) => SendBookableSpacesBloc(
|
||||||
@ -75,7 +74,7 @@ class _SetupBookableSpacesDialogState extends State<SetupBookableSpacesDialog> {
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
child: AlertDialog(
|
child: AlertDialog(
|
||||||
backgroundColor: ColorsManager.whiteColors,
|
backgroundColor: ColorsManager.white,
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
title: Center(
|
title: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -21,16 +21,14 @@ class BookableSpaceSwitchActivationWidget extends StatelessWidget {
|
|||||||
return Center(
|
return Center(
|
||||||
child: Transform.scale(
|
child: Transform.scale(
|
||||||
scale: 0.7,
|
scale: 0.7,
|
||||||
child:
|
child: BlocConsumer<UpdateBookableSpacesBloc, UpdateBookableSpacesState>(
|
||||||
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:
|
updatedBookableSpaceConfig: updateState.bookableSpaceConfig,
|
||||||
updateState.bookableSpaceConfig,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -42,16 +40,16 @@ class BookableSpaceSwitchActivationWidget extends StatelessWidget {
|
|||||||
return const Center(child: CircularProgressIndicator());
|
return const Center(child: CircularProgressIndicator());
|
||||||
}
|
}
|
||||||
return Switch(
|
return Switch(
|
||||||
trackOutlineColor: WidgetStateProperty.resolveWith<Color>(
|
trackOutlineColor:
|
||||||
(Set<WidgetState> states) {
|
WidgetStateProperty.resolveWith<Color>((Set<WidgetState> states) {
|
||||||
return ColorsManager.whiteColors;
|
return ColorsManager.white;
|
||||||
}),
|
}),
|
||||||
value: space.spaceConfig!.availability,
|
value: space.spaceConfig!.availability,
|
||||||
activeTrackColor: ColorsManager.dialogBlueTitle,
|
activeTrackColor: ColorsManager.dialogBlueTitle,
|
||||||
inactiveTrackColor: ColorsManager.grayBorder,
|
inactiveTrackColor: ColorsManager.grayBorder,
|
||||||
thumbColor: WidgetStateProperty.resolveWith<Color>(
|
thumbColor:
|
||||||
(Set<WidgetState> states) {
|
WidgetStateProperty.resolveWith<Color>((Set<WidgetState> states) {
|
||||||
return ColorsManager.whiteColors;
|
return ColorsManager.white;
|
||||||
}),
|
}),
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
context.read<UpdateBookableSpacesBloc>().add(
|
context.read<UpdateBookableSpacesBloc>().add(
|
||||||
|
@ -68,7 +68,7 @@ class PaginationButtonsWidget extends StatelessWidget {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: i == currentPage
|
color: i == currentPage
|
||||||
? ColorsManager.dialogBlueTitle
|
? ColorsManager.dialogBlueTitle
|
||||||
: ColorsManager.whiteColors,
|
: ColorsManager.white,
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: ColorsManager.lightGrayBorderColor,
|
color: ColorsManager.lightGrayBorderColor,
|
||||||
@ -77,9 +77,8 @@ 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: i == currentPage
|
fontWeight:
|
||||||
? FontWeight.bold
|
i == currentPage ? FontWeight.bold : FontWeight.normal,
|
||||||
: FontWeight.normal,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -129,8 +128,7 @@ class PaginationButtonsWidget extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildArrowButton(
|
Widget _buildArrowButton({required String label, required VoidCallback onTap}) {
|
||||||
{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(
|
||||||
@ -140,7 +138,7 @@ class PaginationButtonsWidget extends StatelessWidget {
|
|||||||
height: 30,
|
height: 30,
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: ColorsManager.whiteColors,
|
color: ColorsManager.white,
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: ColorsManager.lightGrayBorderColor,
|
color: ColorsManager.lightGrayBorderColor,
|
||||||
|
@ -62,16 +62,13 @@ class _PointsPartWidgetState extends State<PointsPartWidget> {
|
|||||||
scale: 0.7,
|
scale: 0.7,
|
||||||
child: Switch(
|
child: Switch(
|
||||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||||
trackOutlineColor:
|
trackOutlineColor: WidgetStateProperty.all(ColorsManager.white),
|
||||||
WidgetStateProperty.all(ColorsManager.whiteColors),
|
|
||||||
activeTrackColor: ColorsManager.dialogBlueTitle,
|
activeTrackColor: ColorsManager.dialogBlueTitle,
|
||||||
inactiveTrackColor: ColorsManager.lightGrayBorderColor,
|
inactiveTrackColor: ColorsManager.lightGrayBorderColor,
|
||||||
thumbColor:
|
thumbColor: WidgetStateProperty.all(ColorsManager.white),
|
||||||
WidgetStateProperty.all(ColorsManager.whiteColors),
|
|
||||||
value: isSwitchOn,
|
value: isSwitchOn,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
final toggleCubit =
|
final toggleCubit = context.read<TogglePointsSwitchCubit>();
|
||||||
context.read<TogglePointsSwitchCubit>();
|
|
||||||
final bloc = context.read<SetupBookableSpacesBloc>();
|
final bloc = context.read<SetupBookableSpacesBloc>();
|
||||||
|
|
||||||
final updatedCost = value ? -1 : 0;
|
final updatedCost = value ? -1 : 0;
|
||||||
|
@ -36,12 +36,11 @@ 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.whiteColors,
|
color: ColorsManager.white,
|
||||||
borderRadius: BorderRadius.circular(raduis ?? 15),
|
borderRadius: BorderRadius.circular(raduis ?? 15),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color:
|
color: ColorsManager.shadowOfSearchTextfield.withValues(alpha: 0.15),
|
||||||
ColorsManager.shadowOfSearchTextfield.withValues(alpha: 0.15),
|
|
||||||
offset: Offset.zero,
|
offset: Offset.zero,
|
||||||
blurRadius: blur ?? 5,
|
blurRadius: blur ?? 5,
|
||||||
spreadRadius: 0,
|
spreadRadius: 0,
|
||||||
|
@ -33,7 +33,7 @@ class StepperPartWidget extends StatelessWidget {
|
|||||||
const CircleTitleStepperWidget(
|
const CircleTitleStepperWidget(
|
||||||
title: 'Settings',
|
title: 'Settings',
|
||||||
titleColor: ColorsManager.softGray,
|
titleColor: ColorsManager.softGray,
|
||||||
circleColor: ColorsManager.whiteColors,
|
circleColor: ColorsManager.white,
|
||||||
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.whiteColors,
|
color: ColorsManager.white,
|
||||||
size: 12,
|
size: 12,
|
||||||
),
|
),
|
||||||
circleColor: ColorsManager.trueIconGreen,
|
circleColor: ColorsManager.trueIconGreen,
|
||||||
|
@ -104,7 +104,7 @@ abstract final class RangeOfAqiChartsHelper {
|
|||||||
) {
|
) {
|
||||||
return LineTouchData(
|
return LineTouchData(
|
||||||
touchTooltipData: LineTouchTooltipData(
|
touchTooltipData: LineTouchTooltipData(
|
||||||
getTooltipColor: (touchTooltipItem) => ColorsManager.whiteColors,
|
getTooltipColor: (touchTooltipItem) => ColorsManager.white,
|
||||||
tooltipBorder: const BorderSide(
|
tooltipBorder: const BorderSide(
|
||||||
color: ColorsManager.semiTransparentBlack,
|
color: ColorsManager.semiTransparentBlack,
|
||||||
),
|
),
|
||||||
|
@ -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.whiteColors,
|
getTooltipColor: (_) => ColorsManager.white,
|
||||||
tooltipBorder: const BorderSide(
|
tooltipBorder: const BorderSide(
|
||||||
color: ColorsManager.semiTransparentBlack,
|
color: ColorsManager.semiTransparentBlack,
|
||||||
),
|
),
|
||||||
|
@ -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.whiteColors,
|
color: ColorsManager.white,
|
||||||
border: GaugePointerBorder(
|
border: GaugePointerBorder(
|
||||||
width: 6,
|
width: 6,
|
||||||
color: statusColor,
|
color: statusColor,
|
||||||
|
@ -20,7 +20,7 @@ class AqiLocationInfoCell extends StatelessWidget {
|
|||||||
return Expanded(
|
return Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: ColorsManager.whiteColors,
|
color: ColorsManager.white,
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
),
|
),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
|
@ -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.whiteColors,
|
color: ColorsManager.white,
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
|
@ -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.whiteColors,
|
dropdownColor: ColorsManager.white,
|
||||||
underline: const SizedBox.shrink(),
|
underline: const SizedBox.shrink(),
|
||||||
icon: const RotatedBox(
|
icon: const RotatedBox(
|
||||||
quarterTurns: 1,
|
quarterTurns: 1,
|
||||||
|
@ -107,7 +107,7 @@ class RangeOfAqiChart extends StatelessWidget {
|
|||||||
show: true,
|
show: true,
|
||||||
getDotPainter: (_, __, ___, ____) => FlDotCirclePainter(
|
getDotPainter: (_, __, ___, ____) => FlDotCirclePainter(
|
||||||
radius: 2,
|
radius: 2,
|
||||||
color: ColorsManager.whiteColors,
|
color: ColorsManager.white,
|
||||||
strokeWidth: 2,
|
strokeWidth: 2,
|
||||||
strokeColor: color,
|
strokeColor: color,
|
||||||
),
|
),
|
||||||
|
@ -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.whiteColors,
|
backgroundColor: ColorsManager.white,
|
||||||
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.whiteColors,
|
color: ColorsManager.white,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -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.whiteColors
|
? ColorsManager.white
|
||||||
: 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),
|
||||||
|
@ -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.whiteColors),
|
decoration: const BoxDecoration(color: ColorsManager.white),
|
||||||
child: state is SpaceTreeLoadingState
|
child: state is SpaceTreeLoadingState
|
||||||
? const Center(child: CircularProgressIndicator())
|
? const Center(child: CircularProgressIndicator())
|
||||||
: Column(
|
: Column(
|
||||||
|
@ -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.whiteColors,
|
backgroundColor: ColorsManager.white,
|
||||||
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.whiteColors,
|
color: ColorsManager.white,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -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.whiteColors
|
? ColorsManager.white
|
||||||
: ColorsManager.blackColor.withValues(alpha: 0.8),
|
: ColorsManager.blackColor.withValues(alpha: 0.8),
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
|
@ -81,7 +81,7 @@ abstract final class EnergyManagementChartsHelper {
|
|||||||
|
|
||||||
static LineTouchTooltipData lineTouchTooltipData() {
|
static LineTouchTooltipData lineTouchTooltipData() {
|
||||||
return LineTouchTooltipData(
|
return LineTouchTooltipData(
|
||||||
getTooltipColor: (touchTooltipItem) => ColorsManager.whiteColors,
|
getTooltipColor: (touchTooltipItem) => ColorsManager.white,
|
||||||
tooltipBorder: const BorderSide(color: ColorsManager.semiTransparentBlack),
|
tooltipBorder: const BorderSide(color: ColorsManager.semiTransparentBlack),
|
||||||
tooltipRoundedRadius: 16,
|
tooltipRoundedRadius: 16,
|
||||||
showOnTopOfTheChartBoxArea: false,
|
showOnTopOfTheChartBoxArea: false,
|
||||||
|
@ -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.whiteColors,
|
dropdownColor: ColorsManager.white,
|
||||||
underline: const SizedBox.shrink(),
|
underline: const SizedBox.shrink(),
|
||||||
icon: const RotatedBox(
|
icon: const RotatedBox(
|
||||||
quarterTurns: 1,
|
quarterTurns: 1,
|
||||||
|
@ -18,7 +18,6 @@ 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,
|
||||||
@ -74,7 +73,7 @@ class EnergyConsumptionByPhasesChart extends StatelessWidget {
|
|||||||
BarTouchData _barTouchData(BuildContext context) {
|
BarTouchData _barTouchData(BuildContext context) {
|
||||||
return BarTouchData(
|
return BarTouchData(
|
||||||
touchTooltipData: BarTouchTooltipData(
|
touchTooltipData: BarTouchTooltipData(
|
||||||
getTooltipColor: (touchTooltipItem) => ColorsManager.whiteColors,
|
getTooltipColor: (touchTooltipItem) => ColorsManager.white,
|
||||||
tooltipBorder: const BorderSide(
|
tooltipBorder: const BorderSide(
|
||||||
color: ColorsManager.semiTransparentBlack,
|
color: ColorsManager.semiTransparentBlack,
|
||||||
),
|
),
|
||||||
|
@ -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.whiteColors,
|
color: ColorsManager.white,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
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.whiteColors,
|
color: ColorsManager.white,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -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.whiteColors,
|
getTooltipColor: (touchTooltipItem) => ColorsManager.white,
|
||||||
tooltipBorder: const BorderSide(
|
tooltipBorder: const BorderSide(
|
||||||
color: ColorsManager.semiTransparentBlack,
|
color: ColorsManager.semiTransparentBlack,
|
||||||
),
|
),
|
||||||
|
@ -121,7 +121,8 @@ class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout
|
|||||||
const Spacer(),
|
const Spacer(),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: _buildLoginFormFields(context, loginBloc, size),
|
child:
|
||||||
|
_buildLoginFormFields(context, loginBloc, size),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
],
|
],
|
||||||
@ -147,8 +148,8 @@ class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout
|
|||||||
child: Form(
|
child: Form(
|
||||||
key: loginBloc.loginFormKey,
|
key: loginBloc.loginFormKey,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: EdgeInsets.symmetric(
|
||||||
EdgeInsets.symmetric(horizontal: size.width * 0.02, vertical: size.width * 0.003),
|
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,
|
||||||
@ -303,10 +304,8 @@ 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)
|
hintStyle: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||||
.textTheme
|
color: ColorsManager.grayColor, fontWeight: FontWeight.w400)),
|
||||||
.bodySmall!
|
|
||||||
.copyWith(color: ColorsManager.grayColor, fontWeight: FontWeight.w400)),
|
|
||||||
style: const TextStyle(color: Colors.black),
|
style: const TextStyle(color: Colors.black),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -338,7 +337,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,
|
||||||
));
|
));
|
||||||
@ -348,17 +347,18 @@ 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)
|
hintStyle: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||||
.textTheme
|
color: ColorsManager.grayColor, fontWeight: FontWeight.w400),
|
||||||
.bodySmall!
|
|
||||||
.copyWith(color: ColorsManager.grayColor, fontWeight: FontWeight.w400),
|
|
||||||
suffixIcon: IconButton(
|
suffixIcon: IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
loginBloc.add(PasswordVisibleEvent(newValue: loginBloc.obscureText));
|
loginBloc
|
||||||
|
.add(PasswordVisibleEvent(newValue: loginBloc.obscureText));
|
||||||
},
|
},
|
||||||
icon: SizedBox(
|
icon: SizedBox(
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
loginBloc.obscureText ? Assets.visiblePassword : Assets.invisiblePassword,
|
loginBloc.obscureText
|
||||||
|
? Assets.visiblePassword
|
||||||
|
: Assets.invisiblePassword,
|
||||||
height: 15,
|
height: 15,
|
||||||
width: 15,
|
width: 15,
|
||||||
),
|
),
|
||||||
@ -386,10 +386,8 @@ class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout
|
|||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"Forgot Password?",
|
"Forgot Password?",
|
||||||
style: Theme.of(context)
|
style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||||
.textTheme
|
color: Colors.black, fontSize: 14, fontWeight: FontWeight.w400),
|
||||||
.bodySmall!
|
|
||||||
.copyWith(color: Colors.black, fontSize: 14, fontWeight: FontWeight.w400),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -466,8 +464,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.whiteColors
|
? ColorsManager.white
|
||||||
: ColorsManager.whiteColors.withOpacity(0.2),
|
: ColorsManager.white.withOpacity(0.2),
|
||||||
)),
|
)),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (loginBloc.loginFormKey.currentState!.validate()) {
|
if (loginBloc.loginFormKey.currentState!.validate()) {
|
||||||
@ -494,7 +492,8 @@ class _LoginWebPageState extends State<LoginWebPage> with HelperResponsiveLayout
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
child: Text(
|
child: Text(
|
||||||
loginBloc.validate,
|
loginBloc.validate,
|
||||||
style: const TextStyle(fontWeight: FontWeight.w700, color: ColorsManager.red),
|
style: const TextStyle(
|
||||||
|
fontWeight: FontWeight.w700, color: ColorsManager.red),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
@ -56,7 +56,7 @@ class SearchResetButtons extends StatelessWidget {
|
|||||||
decoration: containerDecoration,
|
decoration: containerDecoration,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: DefaultButton(
|
child: DefaultButton(
|
||||||
backgroundColor: ColorsManager.whiteColors,
|
backgroundColor: ColorsManager.white,
|
||||||
borderRadius: 9,
|
borderRadius: 9,
|
||||||
onPressed: onReset,
|
onPressed: onReset,
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -35,7 +35,7 @@ class CurtainToggle extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
ClipOval(
|
ClipOval(
|
||||||
child: Container(
|
child: Container(
|
||||||
color: ColorsManager.whiteColors,
|
color: ColorsManager.white,
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
Assets.curtainIcon,
|
Assets.curtainIcon,
|
||||||
width: 60,
|
width: 60,
|
||||||
|
@ -127,13 +127,11 @@ class _DynamicTableState extends State<DynamicTable> {
|
|||||||
controller: _horizontalScrollController,
|
controller: _horizontalScrollController,
|
||||||
thumbVisibility: true,
|
thumbVisibility: true,
|
||||||
trackVisibility: true,
|
trackVisibility: true,
|
||||||
notificationPredicate: (notif) =>
|
notificationPredicate: (notif) => notif.metrics.axis == Axis.horizontal,
|
||||||
notif.metrics.axis == Axis.horizontal,
|
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
controller: _horizontalScrollController,
|
controller: _horizontalScrollController,
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
physics:
|
physics: widget.isEmpty ? const NeverScrollableScrollPhysics() : null,
|
||||||
widget.isEmpty ? const NeverScrollableScrollPhysics() : null,
|
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: _totalTableWidth,
|
width: _totalTableWidth,
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -195,29 +193,25 @@ class _DynamicTableState extends State<DynamicTable> {
|
|||||||
widget.headers[colIndex] == 'Settings'
|
widget.headers[colIndex] == 'Settings'
|
||||||
? buildSettingsIcon(
|
? buildSettingsIcon(
|
||||||
width: _settingsColumnWidth,
|
width: _settingsColumnWidth,
|
||||||
onTap: () => widget
|
onTap: () => widget.onSettingsPressed
|
||||||
.onSettingsPressed
|
|
||||||
?.call(rowIndex),
|
?.call(rowIndex),
|
||||||
)
|
)
|
||||||
: _buildTableCell(
|
: _buildTableCell(
|
||||||
row[colIndex].toString(),
|
row[colIndex].toString(),
|
||||||
width: widget.headers[
|
width: widget.headers[colIndex] ==
|
||||||
colIndex] ==
|
|
||||||
'Settings'
|
'Settings'
|
||||||
? _settingsColumnWidth
|
? _settingsColumnWidth
|
||||||
: (_totalTableWidth -
|
: (_totalTableWidth -
|
||||||
(widget.withCheckBox
|
(widget.withCheckBox
|
||||||
? _checkboxColumnWidth
|
? _checkboxColumnWidth
|
||||||
: 0) -
|
: 0) -
|
||||||
(widget.headers
|
(widget.headers.contains(
|
||||||
.contains(
|
'Settings')
|
||||||
'Settings')
|
|
||||||
? _settingsColumnWidth
|
? _settingsColumnWidth
|
||||||
: 0)) /
|
: 0)) /
|
||||||
(widget.headers.length -
|
(widget.headers.length -
|
||||||
(widget.headers
|
(widget.headers.contains(
|
||||||
.contains(
|
'Settings')
|
||||||
'Settings')
|
|
||||||
? 1
|
? 1
|
||||||
: 0)),
|
: 0)),
|
||||||
rowIndex: rowIndex,
|
rowIndex: rowIndex,
|
||||||
@ -241,7 +235,7 @@ class _DynamicTableState extends State<DynamicTable> {
|
|||||||
|
|
||||||
Widget _buildEmptyState() => Container(
|
Widget _buildEmptyState() => Container(
|
||||||
height: widget.size.height,
|
height: widget.size.height,
|
||||||
color: ColorsManager.whiteColors,
|
color: ColorsManager.white,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
@ -281,9 +275,8 @@ class _DynamicTableState extends State<DynamicTable> {
|
|||||||
),
|
),
|
||||||
child: Checkbox(
|
child: Checkbox(
|
||||||
value: _selectAll,
|
value: _selectAll,
|
||||||
onChanged: widget.withSelectAll && widget.data.isNotEmpty
|
onChanged:
|
||||||
? _toggleSelectAll
|
widget.withSelectAll && widget.data.isNotEmpty ? _toggleSelectAll : null,
|
||||||
: null,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -300,7 +293,7 @@ class _DynamicTableState extends State<DynamicTable> {
|
|||||||
width: 1.0,
|
width: 1.0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
color: ColorsManager.whiteColors,
|
color: ColorsManager.white,
|
||||||
),
|
),
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: Center(
|
child: Center(
|
||||||
@ -341,9 +334,7 @@ class _DynamicTableState extends State<DynamicTable> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildTableCell(String content,
|
Widget _buildTableCell(String content,
|
||||||
{required double width,
|
{required double width, required int rowIndex, required int columnIndex}) {
|
||||||
required int rowIndex,
|
|
||||||
required int columnIndex}) {
|
|
||||||
bool isBatteryLevel = content.endsWith('%');
|
bool isBatteryLevel = content.endsWith('%');
|
||||||
double? batteryLevel;
|
double? batteryLevel;
|
||||||
|
|
||||||
@ -415,7 +406,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.whiteColors,
|
color: ColorsManager.white,
|
||||||
border: Border(
|
border: Border(
|
||||||
bottom: BorderSide(
|
bottom: BorderSide(
|
||||||
color: ColorsManager.boxDivider,
|
color: ColorsManager.boxDivider,
|
||||||
|
@ -27,8 +27,8 @@ class BatchAcMode extends StatelessWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
_buildIconContainer(context, TempModes.cold, Assets.freezing,
|
_buildIconContainer(
|
||||||
value == TempModes.cold),
|
context, TempModes.cold, Assets.freezing, 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.whiteColors,
|
color: ColorsManager.white,
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: isSelected ? Colors.blue : Colors.transparent,
|
color: isSelected ? Colors.blue : Colors.transparent,
|
||||||
width: 2.0,
|
width: 2.0,
|
||||||
|
@ -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(context, FanSpeeds.low, Assets.acFanLow,
|
_buildIconContainer(
|
||||||
value == FanSpeeds.low),
|
context, FanSpeeds.low, Assets.acFanLow, value == FanSpeeds.low),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
@ -52,8 +52,8 @@ class BatchFanSpeedControl extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildIconContainer(BuildContext context, FanSpeeds speed,
|
Widget _buildIconContainer(
|
||||||
String assetPath, bool isSelected) {
|
BuildContext context, FanSpeeds speed, 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.whiteColors,
|
color: ColorsManager.white,
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: isSelected ? Colors.blue : Colors.transparent,
|
color: isSelected ? Colors.blue : Colors.transparent,
|
||||||
width: 2.0,
|
width: 2.0,
|
||||||
|
@ -27,8 +27,8 @@ class AcMode extends StatelessWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
_buildIconContainer(context, TempModes.cold, Assets.freezing,
|
_buildIconContainer(
|
||||||
value == TempModes.cold),
|
context, TempModes.cold, Assets.freezing, 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.whiteColors,
|
color: ColorsManager.white,
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: isSelected ? Colors.blue : Colors.transparent,
|
color: isSelected ? Colors.blue : Colors.transparent,
|
||||||
width: 2.0,
|
width: 2.0,
|
||||||
|
@ -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.whiteColors,
|
color: ColorsManager.white,
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
child: ClipOval(
|
child: ClipOval(
|
||||||
|
@ -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(context, FanSpeeds.low, Assets.acFanLow,
|
_buildIconContainer(
|
||||||
value == FanSpeeds.low),
|
context, FanSpeeds.low, Assets.acFanLow, value == FanSpeeds.low),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
@ -51,8 +51,8 @@ class FanSpeedControl extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildIconContainer(BuildContext context, FanSpeeds speed,
|
Widget _buildIconContainer(
|
||||||
String assetPath, bool isSelected) {
|
BuildContext context, FanSpeeds speed, 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.whiteColors,
|
color: ColorsManager.white,
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: isSelected ? Colors.blue : Colors.transparent,
|
color: isSelected ? Colors.blue : Colors.transparent,
|
||||||
width: 2.0,
|
width: 2.0,
|
||||||
|
@ -35,8 +35,7 @@ class _DeviceManagementPageState extends State<DeviceManagementPage> {
|
|||||||
return MultiBlocProvider(
|
return MultiBlocProvider(
|
||||||
providers: [
|
providers: [
|
||||||
BlocProvider(
|
BlocProvider(
|
||||||
create: (context) =>
|
create: (context) => DeviceManagementBloc()..add(FetchDevices(context)),
|
||||||
DeviceManagementBloc()..add(FetchDevices(context)),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
child: WebScaffold(
|
child: WebScaffold(
|
||||||
@ -59,8 +58,9 @@ class _DeviceManagementPageState extends State<DeviceManagementPage> {
|
|||||||
BlocProvider.of<CreateRoutineBloc>(context)
|
BlocProvider.of<CreateRoutineBloc>(context)
|
||||||
.add(const ResetSelectedEvent());
|
.add(const ResetSelectedEvent());
|
||||||
|
|
||||||
context.read<RoutineBloc>().add(
|
context
|
||||||
const TriggerSwitchTabsEvent(isRoutineTab: false));
|
.read<RoutineBloc>()
|
||||||
|
.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.whiteColors
|
? ColorsManager.white
|
||||||
: 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.read<RoutineBloc>().add(
|
context
|
||||||
const TriggerSwitchTabsEvent(isRoutineTab: true));
|
.read<RoutineBloc>()
|
||||||
|
.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.whiteColors
|
? ColorsManager.white
|
||||||
: ColorsManager.grayColor,
|
: ColorsManager.grayColor,
|
||||||
fontWeight:
|
fontWeight: state.routineTab ? FontWeight.w700 : FontWeight.w400,
|
||||||
state.routineTab ? FontWeight.w700 : FontWeight.w400,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -120,8 +120,7 @@ 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(
|
return DeviceManagementBody(devices: deviceState.filteredDevices);
|
||||||
devices: deviceState.filteredDevices);
|
|
||||||
} else {
|
} else {
|
||||||
return const DeviceManagementBody(devices: []);
|
return const DeviceManagementBody(devices: []);
|
||||||
}
|
}
|
||||||
|
@ -120,8 +120,7 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
|
|||||||
content: Text(
|
content: Text(
|
||||||
'This Device is Offline',
|
'This Device is Offline',
|
||||||
),
|
),
|
||||||
duration:
|
duration: Duration(seconds: 2),
|
||||||
Duration(seconds: 2),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
@ -135,13 +134,11 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
|
|||||||
device: selectedDevices.first,
|
device: selectedDevices.first,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else if (selectedDevices.length >
|
} else if (selectedDevices.length > 1) {
|
||||||
1) {
|
final productTypes = selectedDevices
|
||||||
final productTypes =
|
.map(
|
||||||
selectedDevices
|
(device) => device.productType)
|
||||||
.map((device) =>
|
.toSet();
|
||||||
device.productType)
|
|
||||||
.toSet();
|
|
||||||
if (productTypes.length == 1) {
|
if (productTypes.length == 1) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
@ -224,13 +221,11 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
|
|||||||
device.batteryLevel != null
|
device.batteryLevel != null
|
||||||
? '${device.batteryLevel}%'
|
? '${device.batteryLevel}%'
|
||||||
: '-',
|
: '-',
|
||||||
formatDateTime(
|
formatDateTime(DateTime.fromMillisecondsSinceEpoch(
|
||||||
DateTime.fromMillisecondsSinceEpoch(
|
(device.createTime ?? 0) * 1000)),
|
||||||
(device.createTime ?? 0) * 1000)),
|
|
||||||
device.online == true ? 'Online' : 'Offline',
|
device.online == true ? 'Online' : 'Offline',
|
||||||
formatDateTime(
|
formatDateTime(DateTime.fromMillisecondsSinceEpoch(
|
||||||
DateTime.fromMillisecondsSinceEpoch(
|
(device.updateTime ?? 0) * 1000)),
|
||||||
(device.updateTime ?? 0) * 1000)),
|
|
||||||
'Settings',
|
'Settings',
|
||||||
];
|
];
|
||||||
}).toList(),
|
}).toList(),
|
||||||
@ -273,7 +268,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.whiteColors,
|
color: ColorsManager.white,
|
||||||
child: DeviceSettingsPanel(
|
child: DeviceSettingsPanel(
|
||||||
device: device,
|
device: device,
|
||||||
onClose: () => Navigator.of(context).pop(),
|
onClose: () => Navigator.of(context).pop(),
|
||||||
|
@ -18,7 +18,7 @@ class AccurteCalibratingDialog extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(_) {
|
Widget build(_) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
backgroundColor: ColorsManager.whiteColors,
|
backgroundColor: ColorsManager.white,
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
content: AccurateDialogWidget(
|
content: AccurateDialogWidget(
|
||||||
title: 'Calibrating',
|
title: 'Calibrating',
|
||||||
|
@ -16,7 +16,7 @@ class AccurateCalibrationDialog extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(_) {
|
Widget build(_) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
backgroundColor: ColorsManager.whiteColors,
|
backgroundColor: ColorsManager.white,
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
content: AccurateDialogWidget(
|
content: AccurateDialogWidget(
|
||||||
title: 'Accurate Calibration',
|
title: 'Accurate Calibration',
|
||||||
|
@ -17,7 +17,7 @@ class CalibrateCompletedDialog extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(_) {
|
Widget build(_) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
backgroundColor: ColorsManager.whiteColors,
|
backgroundColor: ColorsManager.white,
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
content: SizedBox(
|
content: SizedBox(
|
||||||
height: 250,
|
height: 250,
|
||||||
|
@ -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.whiteColors,
|
color: ColorsManager.white,
|
||||||
child: ClipOval(
|
child: ClipOval(
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 60,
|
height: 60,
|
||||||
|
@ -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.whiteColors,
|
inactiveColor: ColorsManager.white,
|
||||||
|
|
||||||
// Start dragging — use local control
|
// Start dragging — use local control
|
||||||
onChangeStart: (_) {
|
onChangeStart: (_) {
|
||||||
|
@ -47,10 +47,9 @@ class PrefReversCardWidget extends StatelessWidget {
|
|||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(3),
|
padding: const EdgeInsets.all(3),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: ColorsManager.whiteColors,
|
color: ColorsManager.white,
|
||||||
borderRadius: const BorderRadius.horizontal(
|
borderRadius: const BorderRadius.horizontal(
|
||||||
left: Radius.circular(10),
|
left: Radius.circular(10), right: 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,
|
||||||
|
@ -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(
|
||||||
|
@ -63,7 +63,7 @@ class _QuickCalibratingDialogState extends State<QuickCalibratingDialog> {
|
|||||||
@override
|
@override
|
||||||
Widget build(_) {
|
Widget build(_) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
backgroundColor: ColorsManager.whiteColors,
|
backgroundColor: ColorsManager.white,
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
content: AccurateDialogWidget(
|
content: AccurateDialogWidget(
|
||||||
title: 'Calibrating',
|
title: 'Calibrating',
|
||||||
|
@ -18,7 +18,7 @@ class QuickCalibrationDialog extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(_) {
|
Widget build(_) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
backgroundColor: ColorsManager.whiteColors,
|
backgroundColor: ColorsManager.white,
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
content: AccurateDialogWidget(
|
content: AccurateDialogWidget(
|
||||||
title: 'Quick Calibration',
|
title: 'Quick Calibration',
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
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';
|
||||||
@ -47,8 +46,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 = DeviceIconTypeHelper.getDeviceIconByTypeCode(
|
final iconPath =
|
||||||
device.productType);
|
DeviceIconTypeHelper.getDeviceIconByTypeCode(device.productType);
|
||||||
final deviceInfo = state is DeviceSettingsUpdate
|
final deviceInfo = state is DeviceSettingsUpdate
|
||||||
? state.deviceInfo ?? DeviceInfoModel.empty()
|
? state.deviceInfo ?? DeviceInfoModel.empty()
|
||||||
: DeviceInfoModel.empty();
|
: DeviceInfoModel.empty();
|
||||||
@ -77,11 +76,9 @@ class DeviceSettingsPanel extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Device Settings',
|
'Device Settings',
|
||||||
style: context.theme.textTheme.titleLarge!
|
style: context.theme.textTheme.titleLarge!.copyWith(
|
||||||
.copyWith(
|
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
color: ColorsManager.vividBlue
|
color: ColorsManager.vividBlue.withOpacity(0.7),
|
||||||
.withOpacity(0.7),
|
|
||||||
fontSize: 24),
|
fontSize: 24),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -98,7 +95,7 @@ class DeviceSettingsPanel extends StatelessWidget {
|
|||||||
backgroundColor:
|
backgroundColor:
|
||||||
ColorsManager.grayBorder.withOpacity(0.5),
|
ColorsManager.grayBorder.withOpacity(0.5),
|
||||||
child: CircleAvatar(
|
child: CircleAvatar(
|
||||||
backgroundColor: ColorsManager.whiteColors,
|
backgroundColor: ColorsManager.white,
|
||||||
radius: 36,
|
radius: 36,
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
iconPath,
|
iconPath,
|
||||||
@ -116,8 +113,7 @@ class DeviceSettingsPanel extends StatelessWidget {
|
|||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
Text(
|
Text(
|
||||||
'Device Name:',
|
'Device Name:',
|
||||||
style: context.textTheme.bodyMedium!
|
style: context.textTheme.bodyMedium!.copyWith(
|
||||||
.copyWith(
|
|
||||||
color: ColorsManager.grayColor,
|
color: ColorsManager.grayColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -143,13 +139,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: _bloc
|
newName:
|
||||||
.nameController
|
_bloc.nameController.text))
|
||||||
.text))..add(ResetSelectedDevices());
|
..add(ResetSelectedDevices());
|
||||||
},
|
},
|
||||||
decoration:const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
isDense: true,
|
isDense: true,
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
@ -164,18 +160,16 @@ class DeviceSettingsPanel extends StatelessWidget {
|
|||||||
width: 15,
|
width: 15,
|
||||||
height: 25,
|
height: 25,
|
||||||
child: Visibility(
|
child: Visibility(
|
||||||
visible:
|
visible: _bloc.editName != true,
|
||||||
_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
|
Assets.editNameIconSettings,
|
||||||
.editNameIconSettings,
|
|
||||||
color: ColorsManager
|
color: ColorsManager
|
||||||
.lightGrayBorderColor,
|
.lightGrayBorderColor,
|
||||||
height: 15,
|
height: 15,
|
||||||
|
@ -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.whiteColors,
|
backgroundColor: ColorsManager.white,
|
||||||
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),
|
||||||
|
@ -100,7 +100,6 @@ 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,
|
||||||
@ -110,7 +109,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.whiteColors,
|
color: ColorsManager.white,
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
device.icon ?? 'assets/icons/gateway.svg',
|
device.icon ?? 'assets/icons/gateway.svg',
|
||||||
width: 35,
|
width: 35,
|
||||||
|
@ -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.whiteColors,
|
color: ColorsManager.white,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
const Row(
|
const Row(
|
||||||
|
@ -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.whiteColors,
|
color: ColorsManager.white,
|
||||||
borderRadius: BorderRadius.circular(20),
|
borderRadius: BorderRadius.circular(20),
|
||||||
),
|
),
|
||||||
height: 55,
|
height: 55,
|
||||||
|
@ -12,8 +12,7 @@ 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
|
class SmartPowerDeviceControl extends StatelessWidget with HelperResponsiveLayout {
|
||||||
with HelperResponsiveLayout {
|
|
||||||
final String deviceId;
|
final String deviceId;
|
||||||
|
|
||||||
const SmartPowerDeviceControl({super.key, required this.deviceId});
|
const SmartPowerDeviceControl({super.key, required this.deviceId});
|
||||||
@ -129,7 +128,7 @@ class SmartPowerDeviceControl extends StatelessWidget
|
|||||||
bottom: 10,
|
bottom: 10,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: ColorsManager.whiteColors,
|
color: ColorsManager.white,
|
||||||
borderRadius: BorderRadius.circular(20),
|
borderRadius: BorderRadius.circular(20),
|
||||||
),
|
),
|
||||||
height: 300,
|
height: 300,
|
||||||
@ -149,8 +148,7 @@ class SmartPowerDeviceControl extends StatelessWidget
|
|||||||
onPressed: blocProvider.currentPage <= 0
|
onPressed: blocProvider.currentPage <= 0
|
||||||
? null
|
? null
|
||||||
: () {
|
: () {
|
||||||
blocProvider
|
blocProvider.add(SmartPowerArrowPressedEvent(-1));
|
||||||
.add(SmartPowerArrowPressedEvent(-1));
|
|
||||||
pageController.previousPage(
|
pageController.previousPage(
|
||||||
duration: const Duration(milliseconds: 300),
|
duration: const Duration(milliseconds: 300),
|
||||||
curve: Curves.easeInOut,
|
curve: Curves.easeInOut,
|
||||||
@ -172,8 +170,7 @@ class SmartPowerDeviceControl extends StatelessWidget
|
|||||||
onPressed: blocProvider.currentPage >= 3
|
onPressed: blocProvider.currentPage >= 3
|
||||||
? null
|
? null
|
||||||
: () {
|
: () {
|
||||||
blocProvider
|
blocProvider.add(SmartPowerArrowPressedEvent(1));
|
||||||
.add(SmartPowerArrowPressedEvent(1));
|
|
||||||
pageController.nextPage(
|
pageController.nextPage(
|
||||||
duration: const Duration(milliseconds: 300),
|
duration: const Duration(milliseconds: 300),
|
||||||
curve: Curves.easeInOut,
|
curve: Curves.easeInOut,
|
||||||
@ -202,8 +199,8 @@ class SmartPowerDeviceControl extends StatelessWidget
|
|||||||
blocProvider.add(SelectDateEvent(context: context));
|
blocProvider.add(SelectDateEvent(context: context));
|
||||||
blocProvider.add(FilterRecordsByDateEvent(
|
blocProvider.add(FilterRecordsByDateEvent(
|
||||||
selectedDate: blocProvider.dateTime!,
|
selectedDate: blocProvider.dateTime!,
|
||||||
viewType: blocProvider
|
viewType:
|
||||||
.views[blocProvider.currentIndex]));
|
blocProvider.views[blocProvider.currentIndex]));
|
||||||
},
|
},
|
||||||
widget: blocProvider.dateSwitcher(),
|
widget: blocProvider.dateSwitcher(),
|
||||||
chartData: blocProvider.energyDataList.isNotEmpty
|
chartData: blocProvider.energyDataList.isNotEmpty
|
||||||
|
@ -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.whiteColors,
|
color: ColorsManager.white,
|
||||||
),
|
),
|
||||||
margin: const EdgeInsets.symmetric(horizontal: 4),
|
margin: const EdgeInsets.symmetric(horizontal: 4),
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(12),
|
||||||
|
@ -13,7 +13,7 @@ class ScheduleHeader extends StatelessWidget {
|
|||||||
Text(
|
Text(
|
||||||
'Scheduling',
|
'Scheduling',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: ColorsManager.primaryColorWithOpacity,
|
color: ColorsManager.opaquePrimary,
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
fontSize: 30,
|
fontSize: 30,
|
||||||
),
|
),
|
||||||
|
@ -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.whiteColors,
|
color: ColorsManager.white,
|
||||||
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.whiteColors,
|
color: ColorsManager.white,
|
||||||
height: 60,
|
height: 60,
|
||||||
width: 60,
|
width: 60,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
@ -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.whiteColors,
|
color: ColorsManager.white,
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
icon,
|
icon,
|
||||||
width: 35,
|
width: 35,
|
||||||
|
@ -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/utils/constants/assets.dart';
|
import 'package:syncrow_web/pages/device_managment/ceiling_sensor/model/ceiling_sensor_model.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/pages/device_managment/shared/device_controls_container.dart';
|
||||||
import 'package:syncrow_web/utils/color_manager.dart';
|
import 'package:syncrow_web/utils/color_manager.dart';
|
||||||
import 'package:syncrow_web/pages/device_managment/ceiling_sensor/model/ceiling_sensor_model.dart';
|
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||||
|
import 'package:syncrow_web/utils/extension/build_context_x.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.primaryColorWithOpacity
|
? ColorsManager.opaquePrimary
|
||||||
: ColorsManager.textGray,
|
: ColorsManager.textGray,
|
||||||
),
|
),
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
|
@ -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.whiteColors,
|
color: ColorsManager.white,
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
icon ?? Assets.lightPulp,
|
icon ?? Assets.lightPulp,
|
||||||
width: 35,
|
width: 35,
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
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';
|
||||||
@ -7,7 +6,8 @@ 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({super.key, required this.value, required this.code, required this.deviceId});
|
const CeilingLight(
|
||||||
|
{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.whiteColors,
|
color: ColorsManager.white,
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
Assets.lightPulp,
|
Assets.lightPulp,
|
||||||
width: 60,
|
width: 60,
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
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';
|
||||||
@ -7,7 +6,8 @@ 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({super.key, required this.value, required this.code, required this.deviceId});
|
const SpotLight(
|
||||||
|
{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.whiteColors,
|
color: ColorsManager.white,
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
Assets.lightPulp,
|
Assets.lightPulp,
|
||||||
width: 60,
|
width: 60,
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
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';
|
||||||
@ -7,7 +6,8 @@ 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({super.key, required this.value, required this.code, required this.deviceId});
|
const WallLight(
|
||||||
|
{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.whiteColors,
|
color: ColorsManager.white,
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
Assets.lightPulp,
|
Assets.lightPulp,
|
||||||
width: 60,
|
width: 60,
|
||||||
|
@ -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.primaryColorWithOpacity,
|
color: ColorsManager.opaquePrimary,
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
fontSize: 30,
|
fontSize: 30,
|
||||||
),
|
),
|
||||||
@ -171,8 +171,8 @@ class ScheduleDialogHelper {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Widget _buildDayCheckboxes(BuildContext ctx, List<bool> selectedDays,
|
static Widget _buildDayCheckboxes(
|
||||||
Function(int, bool) onChanged) {
|
BuildContext ctx, List<bool> selectedDays, 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,8 +197,7 @@ class ScheduleDialogHelper {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Function:',
|
'Function:',
|
||||||
style:
|
style: Theme.of(ctx).textTheme.bodySmall!.copyWith(color: Colors.grey),
|
||||||
Theme.of(ctx).textTheme.bodySmall!.copyWith(color: Colors.grey),
|
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Radio<bool>(
|
Radio<bool>(
|
||||||
@ -213,7 +212,6 @@ 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),
|
||||||
|
@ -17,7 +17,7 @@ Future<void> showPopUpFilterMenu({
|
|||||||
await showMenu(
|
await showMenu(
|
||||||
context: context,
|
context: context,
|
||||||
position: position,
|
position: position,
|
||||||
color: ColorsManager.whiteColors,
|
color: ColorsManager.white,
|
||||||
shape: const RoundedRectangleBorder(
|
shape: const RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(10)),
|
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||||
),
|
),
|
||||||
|
@ -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.whiteColors,
|
dropdownColor: ColorsManager.white,
|
||||||
// alignment: Alignment.,
|
// alignment: Alignment.,
|
||||||
focusColor: Colors.white,
|
focusColor: Colors.white,
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
|
@ -28,9 +28,7 @@ class RolesAndPermission extends StatelessWidget {
|
|||||||
Text(
|
Text(
|
||||||
'Role & Permissions',
|
'Role & Permissions',
|
||||||
style: context.textTheme.bodyLarge?.copyWith(
|
style: context.textTheme.bodyLarge?.copyWith(
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700, fontSize: 20, color: Colors.black),
|
||||||
fontSize: 20,
|
|
||||||
color: Colors.black),
|
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 15,
|
height: 15,
|
||||||
@ -67,21 +65,18 @@ class RolesAndPermission extends StatelessWidget {
|
|||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: ColorsManager.grayBorder)),
|
color: ColorsManager.grayBorder)),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
style:
|
style: const TextStyle(color: Colors.black),
|
||||||
const TextStyle(color: Colors.black),
|
controller: _blocRole.roleSearchController,
|
||||||
controller:
|
|
||||||
_blocRole.roleSearchController,
|
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
_blocRole.add(SearchPermission(
|
_blocRole.add(SearchPermission(
|
||||||
nodes: _blocRole.permissions,
|
nodes: _blocRole.permissions,
|
||||||
searchTerm: value));
|
searchTerm: value));
|
||||||
},
|
},
|
||||||
decoration: textBoxDecoration(radios: 20)!
|
decoration:
|
||||||
.copyWith(
|
textBoxDecoration(radios: 20)!.copyWith(
|
||||||
fillColor: Colors.white,
|
fillColor: Colors.white,
|
||||||
suffixIcon: Padding(
|
suffixIcon: Padding(
|
||||||
padding:
|
padding: const EdgeInsets.only(right: 16),
|
||||||
const EdgeInsets.only(right: 16),
|
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
Assets.textFieldSearch,
|
Assets.textFieldSearch,
|
||||||
width: 24,
|
width: 24,
|
||||||
@ -108,7 +103,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.whiteColors,
|
color: ColorsManager.white,
|
||||||
child: PermissionManagement(
|
child: PermissionManagement(
|
||||||
bloc: _blocRole,
|
bloc: _blocRole,
|
||||||
))))
|
))))
|
||||||
|
@ -23,7 +23,7 @@ Future<void> showDateFilterMenu({
|
|||||||
await showMenu(
|
await showMenu(
|
||||||
context: context,
|
context: context,
|
||||||
position: position,
|
position: position,
|
||||||
color: ColorsManager.whiteColors,
|
color: ColorsManager.white,
|
||||||
shape: const RoundedRectangleBorder(
|
shape: const RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
bottomRight: Radius.circular(10),
|
bottomRight: Radius.circular(10),
|
||||||
@ -41,9 +41,8 @@ Future<void> showDateFilterMenu({
|
|||||||
title: Text(
|
title: Text(
|
||||||
"Sort from newest to oldest",
|
"Sort from newest to oldest",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: isSelected == "NewestToOldest"
|
color:
|
||||||
? Colors.black
|
isSelected == "NewestToOldest" ? Colors.black : Colors.blueGrey),
|
||||||
: Colors.blueGrey),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -57,9 +56,8 @@ Future<void> showDateFilterMenu({
|
|||||||
title: Text(
|
title: Text(
|
||||||
"Sort from oldest to newest",
|
"Sort from oldest to newest",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: isSelected == "OldestToNewest"
|
color:
|
||||||
? Colors.black
|
isSelected == "OldestToNewest" ? Colors.black : Colors.blueGrey),
|
||||||
: Colors.blueGrey),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -23,7 +23,7 @@ Future<void> showDeActivateFilterMenu({
|
|||||||
await showMenu(
|
await showMenu(
|
||||||
context: context,
|
context: context,
|
||||||
position: position,
|
position: position,
|
||||||
color: ColorsManager.whiteColors,
|
color: ColorsManager.white,
|
||||||
shape: const RoundedRectangleBorder(
|
shape: const RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
bottomRight: Radius.circular(10),
|
bottomRight: Radius.circular(10),
|
||||||
@ -41,9 +41,8 @@ Future<void> showDeActivateFilterMenu({
|
|||||||
title: Text(
|
title: Text(
|
||||||
"Sort A to Z",
|
"Sort A to Z",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: isSelected == "NewestToOldest"
|
color:
|
||||||
? Colors.black
|
isSelected == "NewestToOldest" ? Colors.black : Colors.blueGrey),
|
||||||
: Colors.blueGrey),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -57,9 +56,8 @@ Future<void> showDeActivateFilterMenu({
|
|||||||
title: Text(
|
title: Text(
|
||||||
"Sort Z to A",
|
"Sort Z to A",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: isSelected == "OldestToNewest"
|
color:
|
||||||
? Colors.black
|
isSelected == "OldestToNewest" ? Colors.black : Colors.blueGrey),
|
||||||
: Colors.blueGrey),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -23,7 +23,7 @@ Future<void> showNameMenu({
|
|||||||
await showMenu(
|
await showMenu(
|
||||||
context: context,
|
context: context,
|
||||||
position: position,
|
position: position,
|
||||||
color: ColorsManager.whiteColors,
|
color: ColorsManager.white,
|
||||||
shape: const RoundedRectangleBorder(
|
shape: const RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
bottomRight: Radius.circular(10),
|
bottomRight: Radius.circular(10),
|
||||||
|
@ -83,8 +83,7 @@ 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:
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||||
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),
|
||||||
@ -201,7 +200,7 @@ class _DynamicTableScreenState extends State<DynamicTableScreen> {
|
|||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
decoration: containerDecoration.copyWith(
|
decoration: containerDecoration.copyWith(
|
||||||
color: ColorsManager.whiteColors,
|
color: ColorsManager.white,
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
bottomLeft: Radius.circular(15),
|
bottomLeft: Radius.circular(15),
|
||||||
bottomRight: Radius.circular(15),
|
bottomRight: Radius.circular(15),
|
||||||
@ -231,8 +230,7 @@ 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 =
|
final clampedWidth = equalWidth.clamp(_minColumnWidth, _maxColumnWidth);
|
||||||
equalWidth.clamp(_minColumnWidth, _maxColumnWidth);
|
|
||||||
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
setState(() {
|
setState(() {
|
||||||
@ -249,7 +247,7 @@ class _DynamicTableScreenState extends State<DynamicTableScreen> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
width: totalTableWidth,
|
width: totalTableWidth,
|
||||||
decoration: containerDecoration.copyWith(
|
decoration: containerDecoration.copyWith(
|
||||||
color: ColorsManager.whiteColors,
|
color: ColorsManager.white,
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(20)),
|
borderRadius: const BorderRadius.all(Radius.circular(20)),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
@ -61,8 +61,7 @@ class UsersPage extends StatelessWidget {
|
|||||||
: ColorsManager.disabledPink.withOpacity(0.5),
|
: ColorsManager.disabledPink.withOpacity(0.5),
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: const EdgeInsets.only(left: 10, right: 10, bottom: 5, top: 5),
|
||||||
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,
|
||||||
@ -93,8 +92,7 @@ class UsersPage extends StatelessWidget {
|
|||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: const EdgeInsets.only(left: 5, right: 5, bottom: 5, top: 5),
|
||||||
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
|
||||||
@ -142,7 +140,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.whiteColors,
|
fillColor: ColorsManager.white,
|
||||||
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,
|
||||||
@ -430,14 +428,12 @@ class UsersPage extends StatelessWidget {
|
|||||||
Text(user.createdTime ?? ''),
|
Text(user.createdTime ?? ''),
|
||||||
Text(user.invitedBy),
|
Text(user.invitedBy),
|
||||||
status(
|
status(
|
||||||
status: user.isEnabled == false
|
status:
|
||||||
? 'disabled'
|
user.isEnabled == false ? 'disabled' : user.status,
|
||||||
: user.status,
|
|
||||||
),
|
),
|
||||||
changeIconStatus(
|
changeIconStatus(
|
||||||
status: user.isEnabled == false
|
status:
|
||||||
? 'disabled'
|
user.isEnabled == false ? 'disabled' : user.status,
|
||||||
: user.status,
|
|
||||||
userId: user.uuid,
|
userId: user.uuid,
|
||||||
onTap: user.status != "invited"
|
onTap: user.status != "invited"
|
||||||
? () {
|
? () {
|
||||||
@ -484,11 +480,10 @@ class UsersPage extends StatelessWidget {
|
|||||||
context: context,
|
context: context,
|
||||||
barrierDismissible: false,
|
barrierDismissible: false,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return DeleteUserDialog(
|
return DeleteUserDialog(onTapDelete: () async {
|
||||||
onTapDelete: () async {
|
|
||||||
try {
|
try {
|
||||||
_blocRole.add(DeleteUserEvent(
|
_blocRole.add(
|
||||||
user.uuid, context));
|
DeleteUserEvent(user.uuid, context));
|
||||||
await Future.delayed(
|
await Future.delayed(
|
||||||
const Duration(seconds: 2));
|
const Duration(seconds: 2));
|
||||||
return true;
|
return true;
|
||||||
@ -521,8 +516,7 @@ class UsersPage extends StatelessWidget {
|
|||||||
visiblePagesCount: 4,
|
visiblePagesCount: 4,
|
||||||
buttonRadius: 10,
|
buttonRadius: 10,
|
||||||
selectedButtonColor: ColorsManager.secondaryColor,
|
selectedButtonColor: ColorsManager.secondaryColor,
|
||||||
buttonUnSelectedBorderColor:
|
buttonUnSelectedBorderColor: ColorsManager.grayBorder,
|
||||||
ColorsManager.grayBorder,
|
|
||||||
lastPageIcon:
|
lastPageIcon:
|
||||||
const Icon(Icons.keyboard_double_arrow_right),
|
const Icon(Icons.keyboard_double_arrow_right),
|
||||||
firstPageIcon:
|
firstPageIcon:
|
||||||
|
@ -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.whiteColors, // Card background color
|
color: ColorsManager.white, // 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.whiteColors,
|
color: ColorsManager.white,
|
||||||
borderRadius: BorderRadius.circular(20),
|
borderRadius: BorderRadius.circular(20),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
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';
|
||||||
@ -30,8 +29,7 @@ class RolesAndPermissionPage extends StatelessWidget {
|
|||||||
enableMenuSidebar: false,
|
enableMenuSidebar: false,
|
||||||
appBarTitle: Text(
|
appBarTitle: Text(
|
||||||
'Roles & Permissions',
|
'Roles & Permissions',
|
||||||
style:
|
style: ResponsiveTextTheme.of(context).deviceManagementTitle,
|
||||||
ResponsiveTextTheme.of(context).deviceManagementTitle,
|
|
||||||
),
|
),
|
||||||
rightBody: const NavigateHomeGridView(),
|
rightBody: const NavigateHomeGridView(),
|
||||||
centerBody: Row(
|
centerBody: Row(
|
||||||
@ -66,7 +64,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.whiteColors
|
? ColorsManager.white
|
||||||
: ColorsManager.grayColor,
|
: ColorsManager.grayColor,
|
||||||
fontWeight: (_blocRole.tapSelect == true)
|
fontWeight: (_blocRole.tapSelect == true)
|
||||||
? FontWeight.w700
|
? FontWeight.w700
|
||||||
|
@ -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.whiteColors,
|
fillColor: ColorsManager.white,
|
||||||
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,
|
||||||
|
@ -3,6 +3,7 @@ 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 {
|
||||||
@ -176,7 +177,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.whiteColors,
|
color: ColorsManager.white,
|
||||||
elevation: 8,
|
elevation: 8,
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
child: BlocProvider.value(
|
child: BlocProvider.value(
|
||||||
@ -201,8 +202,7 @@ class _DropdownContentState extends State<_DropdownContent> {
|
|||||||
Overlay.of(context).insert(_overlayEntry!);
|
Overlay.of(context).insert(_overlayEntry!);
|
||||||
}
|
}
|
||||||
|
|
||||||
CommunityModel? _findCommunity(
|
CommunityModel? _findCommunity(SpaceTreeDropdownState state, String? communityId) {
|
||||||
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);
|
||||||
|
@ -35,8 +35,7 @@ class SpaceDropdown extends StatelessWidget {
|
|||||||
DropdownButton2<String>(
|
DropdownButton2<String>(
|
||||||
underline: const SizedBox(),
|
underline: const SizedBox(),
|
||||||
buttonStyleData: ButtonStyleData(
|
buttonStyleData: ButtonStyleData(
|
||||||
decoration:
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12)),
|
||||||
BoxDecoration(borderRadius: BorderRadius.circular(12)),
|
|
||||||
),
|
),
|
||||||
value: selectedValue,
|
value: selectedValue,
|
||||||
items: spaces.map((space) {
|
items: spaces.map((space) {
|
||||||
@ -98,9 +97,7 @@ 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
|
? spaces.firstWhere((e) => e.uuid == selectedValue).name
|
||||||
.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,
|
||||||
@ -134,7 +131,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.whiteColors,
|
color: ColorsManager.white,
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -17,10 +17,9 @@ class SaveRoutineHelper {
|
|||||||
builder: (context) {
|
builder: (context) {
|
||||||
return BlocBuilder<RoutineBloc, RoutineState>(
|
return BlocBuilder<RoutineBloc, RoutineState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
final selectedConditionLabel =
|
final selectedConditionLabel = state.selectedAutomationOperator == 'and'
|
||||||
state.selectedAutomationOperator == 'and'
|
? 'All Conditions are met'
|
||||||
? 'All Conditions are met'
|
: 'Any Condition is met';
|
||||||
: 'Any Condition is met';
|
|
||||||
|
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
@ -38,11 +37,10 @@ class SaveRoutineHelper {
|
|||||||
Text(
|
Text(
|
||||||
'Create a scene: ${state.routineName ?? ""}',
|
'Create a scene: ${state.routineName ?? ""}',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style:
|
style: Theme.of(context).textTheme.headlineMedium!.copyWith(
|
||||||
Theme.of(context).textTheme.headlineMedium!.copyWith(
|
color: ColorsManager.opaquePrimary,
|
||||||
color: ColorsManager.primaryColorWithOpacity,
|
fontWeight: FontWeight.bold,
|
||||||
fontWeight: FontWeight.bold,
|
),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 18),
|
const SizedBox(height: 18),
|
||||||
_buildDivider(),
|
_buildDivider(),
|
||||||
@ -60,8 +58,7 @@ class SaveRoutineHelper {
|
|||||||
_buildIfConditions(state, context),
|
_buildIfConditions(state, context),
|
||||||
Container(
|
Container(
|
||||||
width: 1,
|
width: 1,
|
||||||
color: ColorsManager.greyColor
|
color: ColorsManager.greyColor.withValues(alpha: 0.8),
|
||||||
.withValues(alpha: 0.8),
|
|
||||||
),
|
),
|
||||||
_buildThenActions(state, context),
|
_buildThenActions(state, context),
|
||||||
],
|
],
|
||||||
@ -100,8 +97,7 @@ class SaveRoutineHelper {
|
|||||||
child: Row(
|
child: Row(
|
||||||
spacing: 16,
|
spacing: 16,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(child: Text('IF: $selectedConditionLabel', style: textStyle)),
|
||||||
child: Text('IF: $selectedConditionLabel', style: textStyle)),
|
|
||||||
const Expanded(child: Text('THEN:', style: textStyle)),
|
const Expanded(child: Text('THEN:', style: textStyle)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -136,7 +132,7 @@ class SaveRoutineHelper {
|
|||||||
|
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
textColor: ColorsManager.primaryColorWithOpacity,
|
textColor: ColorsManager.opaquePrimary,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
@ -147,8 +143,7 @@ class SaveRoutineHelper {
|
|||||||
child: ListView(
|
child: ListView(
|
||||||
// shrinkWrap: true,
|
// shrinkWrap: true,
|
||||||
children: state.thenItems.map((item) {
|
children: state.thenItems.map((item) {
|
||||||
final functions =
|
final functions = state.selectedFunctions[item['uniqueCustomId']] ?? [];
|
||||||
state.selectedFunctions[item['uniqueCustomId']] ?? [];
|
|
||||||
return functionRow(item, context, functions);
|
return functionRow(item, context, functions);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
),
|
),
|
||||||
@ -208,20 +203,19 @@ class SaveRoutineHelper {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Center(
|
||||||
child:
|
child: item['type'] == 'tap_to_run' || item['type'] == 'scene'
|
||||||
item['type'] == 'tap_to_run' || item['type'] == 'scene'
|
? Image.memory(
|
||||||
? Image.memory(
|
base64Decode(item['icon']),
|
||||||
base64Decode(item['icon']),
|
width: 12,
|
||||||
width: 12,
|
height: 22,
|
||||||
height: 22,
|
fit: BoxFit.scaleDown,
|
||||||
fit: BoxFit.scaleDown,
|
)
|
||||||
)
|
: SvgPicture.asset(
|
||||||
: SvgPicture.asset(
|
item['imagePath'],
|
||||||
item['imagePath'],
|
width: 12,
|
||||||
width: 12,
|
height: 12,
|
||||||
height: 12,
|
fit: BoxFit.scaleDown,
|
||||||
fit: BoxFit.scaleDown,
|
),
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Flexible(
|
Flexible(
|
||||||
|
@ -35,7 +35,7 @@ class CreateNewRoutineView extends StatelessWidget {
|
|||||||
child: Card(
|
child: Card(
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: ColorsManager.whiteColors,
|
color: ColorsManager.white,
|
||||||
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.whiteColors,
|
color: ColorsManager.white,
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
topLeft: Radius.circular(15),
|
topLeft: Radius.circular(15),
|
||||||
topRight: Radius.circular(15),
|
topRight: Radius.circular(15),
|
||||||
|
@ -12,11 +12,7 @@ class ConditionToggle extends StatelessWidget {
|
|||||||
});
|
});
|
||||||
|
|
||||||
static const _conditions = ["<", "==", ">"];
|
static const _conditions = ["<", "==", ">"];
|
||||||
static const _icons = [
|
static const _icons = [Icons.chevron_left, Icons.drag_handle, Icons.chevron_right];
|
||||||
Icons.chevron_left,
|
|
||||||
Icons.drag_handle,
|
|
||||||
Icons.chevron_right
|
|
||||||
];
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -41,16 +37,14 @@ 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:
|
color: isSelected ? ColorsManager.vividBlue : Colors.transparent,
|
||||||
isSelected ? ColorsManager.vividBlue : Colors.transparent,
|
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Icon(
|
child: Icon(
|
||||||
_icons[index],
|
_icons[index],
|
||||||
size: 20,
|
size: 20,
|
||||||
color: isSelected
|
color:
|
||||||
? ColorsManager.whiteColors
|
isSelected ? ColorsManager.white : ColorsManager.blackColor,
|
||||||
: ColorsManager.blackColor,
|
|
||||||
weight: isSelected ? 700 : 500,
|
weight: isSelected ? 700 : 500,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -39,7 +39,8 @@ class DeleteSceneWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(width: 1, height: 50, color: ColorsManager.greyColor),
|
Container(
|
||||||
|
width: 1, height: 50, color: ColorsManager.greyColor),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.read<RoutineBloc>().add(const DeleteScene());
|
context.read<RoutineBloc>().add(const DeleteScene());
|
||||||
@ -51,7 +52,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.primaryColorWithOpacity,
|
color: ColorsManager.opaquePrimary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -37,9 +37,7 @@ class DialogFooter extends StatelessWidget {
|
|||||||
DialogFooterButton(
|
DialogFooterButton(
|
||||||
text: 'Confirm',
|
text: 'Confirm',
|
||||||
onTap: onConfirm,
|
onTap: onConfirm,
|
||||||
textColor: isConfirmEnabled
|
textColor: isConfirmEnabled ? ColorsManager.opaquePrimary : Colors.red,
|
||||||
? ColorsManager.primaryColorWithOpacity
|
|
||||||
: Colors.red,
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -65,7 +63,7 @@ class DialogFooterButton extends StatelessWidget {
|
|||||||
return Expanded(
|
return Expanded(
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
style: TextButton.styleFrom(
|
style: TextButton.styleFrom(
|
||||||
foregroundColor: ColorsManager.primaryColorWithOpacity,
|
foregroundColor: ColorsManager.opaquePrimary,
|
||||||
disabledForegroundColor: ColorsManager.primaryColor,
|
disabledForegroundColor: ColorsManager.primaryColor,
|
||||||
),
|
),
|
||||||
onPressed: onTap,
|
onPressed: onTap,
|
||||||
|
@ -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.primaryColorWithOpacity,
|
color: ColorsManager.opaquePrimary,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -33,17 +33,18 @@ 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 = state.selectedFunctions[deviceData['uniqueCustomId']] ?? [];
|
final deviceFunctions =
|
||||||
|
state.selectedFunctions[deviceData['uniqueCustomId']] ?? [];
|
||||||
|
|
||||||
int index = state.thenItems
|
int index = state.thenItems.indexWhere(
|
||||||
.indexWhere((item) => item['uniqueCustomId'] == deviceData['uniqueCustomId']);
|
(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
|
int ifIndex = state.ifItems.indexWhere(
|
||||||
.indexWhere((item) => item['uniqueCustomId'] == deviceData['uniqueCustomId']);
|
(item) => item['uniqueCustomId'] == deviceData['uniqueCustomId']);
|
||||||
|
|
||||||
if (ifIndex != -1) {
|
if (ifIndex != -1) {
|
||||||
return _buildCardContent(context, deviceFunctions, padding: padding);
|
return _buildCardContent(context, deviceFunctions, padding: padding);
|
||||||
@ -62,12 +63,13 @@ class DraggableCard extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildCardContent(BuildContext context, List<DeviceFunctionData> deviceFunctions,
|
Widget _buildCardContent(
|
||||||
|
BuildContext context, List<DeviceFunctionData> deviceFunctions,
|
||||||
{EdgeInsetsGeometry? padding}) {
|
{EdgeInsetsGeometry? padding}) {
|
||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
Card(
|
Card(
|
||||||
color: ColorsManager.whiteColors,
|
color: ColorsManager.white,
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
width: 110,
|
width: 110,
|
||||||
@ -92,7 +94,8 @@ class DraggableCard extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
child: deviceData['type'] == 'tap_to_run' || deviceData['type'] == 'scene'
|
child: deviceData['type'] == 'tap_to_run' ||
|
||||||
|
deviceData['type'] == 'scene'
|
||||||
? Image.memory(
|
? Image.memory(
|
||||||
base64Decode(deviceData['icon']),
|
base64Decode(deviceData['icon']),
|
||||||
)
|
)
|
||||||
@ -123,7 +126,9 @@ class DraggableCard extends StatelessWidget {
|
|||||||
spacing: 2,
|
spacing: 2,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 8, height: 8, child: SvgPicture.asset(Assets.deviceTagIcon)),
|
width: 8,
|
||||||
|
height: 8,
|
||||||
|
child: SvgPicture.asset(Assets.deviceTagIcon)),
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Text(
|
child: Text(
|
||||||
deviceData['tag'] ?? '',
|
deviceData['tag'] ?? '',
|
||||||
@ -141,13 +146,15 @@ class DraggableCard extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: deviceData['subSpace'] != null && deviceData['subSpace'] != '',
|
visible: deviceData['subSpace'] != null &&
|
||||||
|
deviceData['subSpace'] != '',
|
||||||
child: const SizedBox(
|
child: const SizedBox(
|
||||||
height: 4,
|
height: 4,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: deviceData['subSpace'] != null && deviceData['subSpace'] != '',
|
visible: deviceData['subSpace'] != null &&
|
||||||
|
deviceData['subSpace'] != '',
|
||||||
child: Row(
|
child: Row(
|
||||||
spacing: 2,
|
spacing: 2,
|
||||||
children: [
|
children: [
|
||||||
@ -222,7 +229,8 @@ class DraggableCard extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String _formatFunctionValue(DeviceFunctionData function) {
|
String _formatFunctionValue(DeviceFunctionData function) {
|
||||||
if (function.functionCode == 'temp_set' || function.functionCode == 'temp_current') {
|
if (function.functionCode == 'temp_set' ||
|
||||||
|
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;
|
||||||
|
@ -32,8 +32,7 @@ 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:
|
selectedOperator: state.selectedAutomationOperator),
|
||||||
state.selectedAutomationOperator),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
@ -57,8 +56,8 @@ class IfContainer extends StatelessWidget {
|
|||||||
(index) => GestureDetector(
|
(index) => GestureDetector(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
if (!state.isTabToRun) {
|
if (!state.isTabToRun) {
|
||||||
final result = await DeviceDialogHelper
|
final result =
|
||||||
.showDeviceDialog(
|
await DeviceDialogHelper.showDeviceDialog(
|
||||||
context: context,
|
context: context,
|
||||||
data: state.ifItems[index],
|
data: state.ifItems[index],
|
||||||
removeComparetors: false,
|
removeComparetors: false,
|
||||||
@ -79,8 +78,8 @@ class IfContainer extends StatelessWidget {
|
|||||||
'NCPS',
|
'NCPS',
|
||||||
'WH',
|
'WH',
|
||||||
'PC',
|
'PC',
|
||||||
].contains(state.ifItems[index]
|
].contains(
|
||||||
['productType'])) {
|
state.ifItems[index]['productType'])) {
|
||||||
context.read<RoutineBloc>().add(
|
context.read<RoutineBloc>().add(
|
||||||
AddToIfContainer(
|
AddToIfContainer(
|
||||||
state.ifItems[index], false));
|
state.ifItems[index], false));
|
||||||
@ -97,12 +96,11 @@ class IfContainer extends StatelessWidget {
|
|||||||
isFromThen: false,
|
isFromThen: false,
|
||||||
isFromIf: true,
|
isFromIf: true,
|
||||||
onRemove: () {
|
onRemove: () {
|
||||||
context.read<RoutineBloc>().add(
|
context.read<RoutineBloc>().add(RemoveDragCard(
|
||||||
RemoveDragCard(
|
index: index,
|
||||||
index: index,
|
isFromThen: false,
|
||||||
isFromThen: false,
|
key: state.ifItems[index]
|
||||||
key: state.ifItems[index]
|
['uniqueCustomId']));
|
||||||
['uniqueCustomId']));
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
@ -123,9 +121,7 @@ class IfContainer extends StatelessWidget {
|
|||||||
|
|
||||||
if (!state.isTabToRun) {
|
if (!state.isTabToRun) {
|
||||||
if (mutableData['deviceId'] == 'tab_to_run') {
|
if (mutableData['deviceId'] == 'tab_to_run') {
|
||||||
context
|
context.read<RoutineBloc>().add(AddToIfContainer(mutableData, true));
|
||||||
.read<RoutineBloc>()
|
|
||||||
.add(AddToIfContainer(mutableData, true));
|
|
||||||
} else {
|
} else {
|
||||||
final result = await DeviceDialogHelper.showDeviceDialog(
|
final result = await DeviceDialogHelper.showDeviceDialog(
|
||||||
dialogType: 'IF',
|
dialogType: 'IF',
|
||||||
@ -184,7 +180,7 @@ class AutomationOperatorSelector extends StatelessWidget {
|
|||||||
style: TextButton.styleFrom(
|
style: TextButton.styleFrom(
|
||||||
backgroundColor: selectedOperator.toLowerCase() == 'or'
|
backgroundColor: selectedOperator.toLowerCase() == 'or'
|
||||||
? ColorsManager.dialogBlueTitle
|
? ColorsManager.dialogBlueTitle
|
||||||
: ColorsManager.whiteColors,
|
: ColorsManager.white,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(0),
|
borderRadius: BorderRadius.circular(0),
|
||||||
),
|
),
|
||||||
@ -193,7 +189,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.whiteColors
|
? ColorsManager.white
|
||||||
: ColorsManager.blackColor,
|
: ColorsManager.blackColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -212,7 +208,7 @@ class AutomationOperatorSelector extends StatelessWidget {
|
|||||||
style: TextButton.styleFrom(
|
style: TextButton.styleFrom(
|
||||||
backgroundColor: selectedOperator.toLowerCase() == 'and'
|
backgroundColor: selectedOperator.toLowerCase() == 'and'
|
||||||
? ColorsManager.dialogBlueTitle
|
? ColorsManager.dialogBlueTitle
|
||||||
: ColorsManager.whiteColors,
|
: ColorsManager.white,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(0),
|
borderRadius: BorderRadius.circular(0),
|
||||||
),
|
),
|
||||||
@ -221,7 +217,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.whiteColors
|
? ColorsManager.white
|
||||||
: ColorsManager.blackColor,
|
: ColorsManager.blackColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -91,7 +91,7 @@ class _RoutineViewCardState extends State<RoutineViewCard> {
|
|||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
),
|
),
|
||||||
color: ColorsManager.whiteColors,
|
color: ColorsManager.white,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
@ -121,8 +121,7 @@ class _RoutineViewCardState extends State<RoutineViewCard> {
|
|||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 16,
|
width: 16,
|
||||||
height: 16,
|
height: 16,
|
||||||
child:
|
child: CircularProgressIndicator(strokeWidth: 2),
|
||||||
CircularProgressIndicator(strokeWidth: 2),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@ -160,9 +159,8 @@ class _RoutineViewCardState extends State<RoutineViewCard> {
|
|||||||
height: iconSize,
|
height: iconSize,
|
||||||
width: iconSize,
|
width: iconSize,
|
||||||
fit: BoxFit.contain,
|
fit: BoxFit.contain,
|
||||||
errorBuilder:
|
errorBuilder: (context, error, stackTrace) =>
|
||||||
(context, error, stackTrace) =>
|
Image.asset(
|
||||||
Image.asset(
|
|
||||||
Assets.logo,
|
Assets.logo,
|
||||||
height: iconSize,
|
height: iconSize,
|
||||||
width: iconSize,
|
width: iconSize,
|
||||||
@ -205,8 +203,7 @@ 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) ? 10 : 12,
|
||||||
widget.isSmallScreenSize(context) ? 10 : 12,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (widget.spaceName != '')
|
if (widget.spaceName != '')
|
||||||
@ -225,9 +222,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)
|
fontSize:
|
||||||
? 10
|
widget.isSmallScreenSize(context) ? 10 : 12,
|
||||||
: 12,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -37,9 +37,7 @@ 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
|
color: isSelected ? ColorsManager.opaquePrimary : ColorsManager.textGray,
|
||||||
? ColorsManager.primaryColorWithOpacity
|
|
||||||
: ColorsManager.textGray,
|
|
||||||
),
|
),
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
);
|
);
|
||||||
|
@ -65,9 +65,8 @@ class ACHelper {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
DialogHeader(dialogType == 'THEN'
|
DialogHeader(
|
||||||
? 'AC Functions'
|
dialogType == 'THEN' ? 'AC Functions' : 'AC Conditions'),
|
||||||
: 'AC Conditions'),
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
@ -78,15 +77,12 @@ class ACHelper {
|
|||||||
child: _buildFunctionsList(
|
child: _buildFunctionsList(
|
||||||
context: context,
|
context: context,
|
||||||
acFunctions: acFunctions,
|
acFunctions: acFunctions,
|
||||||
onFunctionSelected:
|
onFunctionSelected: (functionCode, operationName) {
|
||||||
(functionCode, operationName) {
|
RoutineTapFunctionHelper.onTapFunction(context,
|
||||||
RoutineTapFunctionHelper.onTapFunction(
|
|
||||||
context,
|
|
||||||
functionCode: functionCode,
|
functionCode: functionCode,
|
||||||
functionOperationName: operationName,
|
functionOperationName: operationName,
|
||||||
functionValueDescription:
|
functionValueDescription:
|
||||||
selectedFunctionData
|
selectedFunctionData.valueDescription,
|
||||||
.valueDescription,
|
|
||||||
deviceUuid: device?.uuid,
|
deviceUuid: device?.uuid,
|
||||||
codesToAddIntoFunctionsWithDefaultValue: [
|
codesToAddIntoFunctionsWithDefaultValue: [
|
||||||
'temp_set',
|
'temp_set',
|
||||||
@ -119,8 +115,7 @@ class ACHelper {
|
|||||||
? () {
|
? () {
|
||||||
final selectedFunctionData =
|
final selectedFunctionData =
|
||||||
state.addedFunctions.firstWhere(
|
state.addedFunctions.firstWhere(
|
||||||
(f) =>
|
(f) => f.functionCode == state.selectedFunction,
|
||||||
f.functionCode == state.selectedFunction,
|
|
||||||
orElse: () => DeviceFunctionData(
|
orElse: () => DeviceFunctionData(
|
||||||
entityId: '',
|
entityId: '',
|
||||||
functionCode: state.selectedFunction ?? '',
|
functionCode: state.selectedFunction ?? '',
|
||||||
@ -214,12 +209,10 @@ class ACHelper {
|
|||||||
required String operationName,
|
required String operationName,
|
||||||
bool? removeComparators,
|
bool? removeComparators,
|
||||||
}) {
|
}) {
|
||||||
final selectedFn =
|
final selectedFn = acFunctions.firstWhere((f) => f.code == selectedFunction);
|
||||||
acFunctions.firstWhere((f) => f.code == selectedFunction);
|
|
||||||
|
|
||||||
if (selectedFunction == 'temp_set' || selectedFunction == 'temp_current') {
|
if (selectedFunction == 'temp_set' || selectedFunction == 'temp_current') {
|
||||||
final displayValue =
|
final displayValue = (selectedFunctionData?.value ?? selectedFn.min!) / 10;
|
||||||
(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;
|
||||||
|
|
||||||
@ -462,13 +455,9 @@ class ACHelper {
|
|||||||
style: context.textTheme.bodyMedium,
|
style: context.textTheme.bodyMedium,
|
||||||
),
|
),
|
||||||
trailing: Icon(
|
trailing: Icon(
|
||||||
isSelected
|
isSelected ? Icons.radio_button_checked : Icons.radio_button_unchecked,
|
||||||
? Icons.radio_button_checked
|
|
||||||
: Icons.radio_button_unchecked,
|
|
||||||
size: 24,
|
size: 24,
|
||||||
color: isSelected
|
color: isSelected ? ColorsManager.opaquePrimary : ColorsManager.textGray,
|
||||||
? ColorsManager.primaryColorWithOpacity
|
|
||||||
: ColorsManager.textGray,
|
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (!isSelected) {
|
if (!isSelected) {
|
||||||
@ -480,8 +469,7 @@ class ACHelper {
|
|||||||
operationName: operationName,
|
operationName: operationName,
|
||||||
value: value.value,
|
value: value.value,
|
||||||
condition: selectedFunctionData?.condition,
|
condition: selectedFunctionData?.condition,
|
||||||
valueDescription:
|
valueDescription: selectedFunctionData?.valueDescription,
|
||||||
selectedFunctionData?.valueDescription,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -71,10 +71,8 @@ class CurtainHelper {
|
|||||||
child: _buildFunctionsList(
|
child: _buildFunctionsList(
|
||||||
context: context,
|
context: context,
|
||||||
curtainFunctions: curtainFunctions,
|
curtainFunctions: curtainFunctions,
|
||||||
onFunctionSelected:
|
onFunctionSelected: (functionCode, operationName) {
|
||||||
(functionCode, operationName) {
|
RoutineTapFunctionHelper.onTapFunction(context,
|
||||||
RoutineTapFunctionHelper.onTapFunction(
|
|
||||||
context,
|
|
||||||
functionCode: functionCode,
|
functionCode: functionCode,
|
||||||
functionOperationName: operationName,
|
functionOperationName: operationName,
|
||||||
functionValueDescription:
|
functionValueDescription:
|
||||||
@ -240,13 +238,9 @@ class CurtainHelper {
|
|||||||
style: context.textTheme.bodyMedium,
|
style: context.textTheme.bodyMedium,
|
||||||
),
|
),
|
||||||
trailing: Icon(
|
trailing: Icon(
|
||||||
isSelected
|
isSelected ? Icons.radio_button_checked : Icons.radio_button_unchecked,
|
||||||
? Icons.radio_button_checked
|
|
||||||
: Icons.radio_button_unchecked,
|
|
||||||
size: 24,
|
size: 24,
|
||||||
color: isSelected
|
color: isSelected ? ColorsManager.opaquePrimary : ColorsManager.textGray,
|
||||||
? ColorsManager.primaryColorWithOpacity
|
|
||||||
: ColorsManager.textGray,
|
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (!isSelected) {
|
if (!isSelected) {
|
||||||
@ -258,8 +252,7 @@ class CurtainHelper {
|
|||||||
operationName: operationName,
|
operationName: operationName,
|
||||||
value: value.value,
|
value: value.value,
|
||||||
condition: selectedFunctionData?.condition,
|
condition: selectedFunctionData?.condition,
|
||||||
valueDescription:
|
valueDescription: selectedFunctionData?.valueDescription,
|
||||||
selectedFunctionData?.valueDescription,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -89,15 +89,14 @@ class OneGangSwitchHelper {
|
|||||||
size: 16,
|
size: 16,
|
||||||
color: ColorsManager.textGray,
|
color: ColorsManager.textGray,
|
||||||
),
|
),
|
||||||
onTap: () => RoutineTapFunctionHelper
|
onTap: () =>
|
||||||
.onTapFunction(
|
RoutineTapFunctionHelper.onTapFunction(
|
||||||
context,
|
context,
|
||||||
functionCode: function.code,
|
functionCode: function.code,
|
||||||
functionOperationName:
|
functionOperationName:
|
||||||
function.operationName,
|
function.operationName,
|
||||||
functionValueDescription:
|
functionValueDescription:
|
||||||
selectedFunctionData
|
selectedFunctionData.valueDescription,
|
||||||
.valueDescription,
|
|
||||||
deviceUuid: device?.uuid,
|
deviceUuid: device?.uuid,
|
||||||
codesToAddIntoFunctionsWithDefaultValue: [
|
codesToAddIntoFunctionsWithDefaultValue: [
|
||||||
'countdown_1',
|
'countdown_1',
|
||||||
@ -113,12 +112,10 @@ 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:
|
operationName: selectedOperationName ?? '',
|
||||||
selectedOperationName ?? '',
|
|
||||||
removeComparetors: removeComparetors,
|
removeComparetors: removeComparetors,
|
||||||
dialogType: dialogType),
|
dialogType: dialogType),
|
||||||
),
|
),
|
||||||
@ -318,13 +315,9 @@ class OneGangSwitchHelper {
|
|||||||
style: context.textTheme.bodyMedium,
|
style: context.textTheme.bodyMedium,
|
||||||
),
|
),
|
||||||
trailing: Icon(
|
trailing: Icon(
|
||||||
isSelected
|
isSelected ? Icons.radio_button_checked : Icons.radio_button_unchecked,
|
||||||
? Icons.radio_button_checked
|
|
||||||
: Icons.radio_button_unchecked,
|
|
||||||
size: 24,
|
size: 24,
|
||||||
color: isSelected
|
color: isSelected ? ColorsManager.opaquePrimary : ColorsManager.textGray,
|
||||||
? ColorsManager.primaryColorWithOpacity
|
|
||||||
: ColorsManager.textGray,
|
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (!isSelected) {
|
if (!isSelected) {
|
||||||
@ -336,8 +329,7 @@ class OneGangSwitchHelper {
|
|||||||
operationName: operationName,
|
operationName: operationName,
|
||||||
value: value.value,
|
value: value.value,
|
||||||
condition: selectedFunctionData?.condition,
|
condition: selectedFunctionData?.condition,
|
||||||
valueDescription:
|
valueDescription: selectedFunctionData?.valueDescription,
|
||||||
selectedFunctionData?.valueDescription,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
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';
|
||||||
@ -13,7 +14,6 @@ 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,14 +30,16 @@ class SettingHelper {
|
|||||||
providers: [
|
providers: [
|
||||||
if (effectiveTime != null)
|
if (effectiveTime != null)
|
||||||
BlocProvider(
|
BlocProvider(
|
||||||
create: (_) => EffectPeriodBloc()..add(InitialEffectPeriodEvent(effectiveTime)),
|
create: (_) =>
|
||||||
|
EffectPeriodBloc()..add(InitialEffectPeriodEvent(effectiveTime)),
|
||||||
),
|
),
|
||||||
if (effectiveTime == null)
|
if (effectiveTime == null)
|
||||||
BlocProvider(
|
BlocProvider(
|
||||||
create: (_) => EffectPeriodBloc(),
|
create: (_) => EffectPeriodBloc(),
|
||||||
),
|
),
|
||||||
BlocProvider(
|
BlocProvider(
|
||||||
create: (_) => SettingBloc()..add(InitialEvent(selectedIcon: iconId ?? ''))),
|
create: (_) =>
|
||||||
|
SettingBloc()..add(InitialEvent(selectedIcon: iconId ?? ''))),
|
||||||
],
|
],
|
||||||
child: AlertDialog(
|
child: AlertDialog(
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
@ -53,7 +55,9 @@ 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 ? 500 : 350,
|
height: context.read<SettingBloc>().isExpanded && isAutomation
|
||||||
|
? 500
|
||||||
|
: 350,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(20),
|
borderRadius: BorderRadius.circular(20),
|
||||||
@ -76,14 +80,18 @@ class SettingHelper {
|
|||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.only(
|
padding: const EdgeInsets.only(
|
||||||
top: 10, left: 10, right: 10, bottom: 10),
|
top: 10,
|
||||||
|
left: 10,
|
||||||
|
right: 10,
|
||||||
|
bottom: 10),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {},
|
onTap: () {},
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.spaceBetween,
|
MainAxisAlignment
|
||||||
|
.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Validity',
|
'Validity',
|
||||||
@ -91,14 +99,17 @@ class SettingHelper {
|
|||||||
.textTheme
|
.textTheme
|
||||||
.bodyMedium!
|
.bodyMedium!
|
||||||
.copyWith(
|
.copyWith(
|
||||||
color:
|
color: ColorsManager
|
||||||
ColorsManager.textPrimaryColor,
|
.textPrimaryColor,
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight:
|
||||||
|
FontWeight.w400,
|
||||||
fontSize: 14),
|
fontSize: 14),
|
||||||
),
|
),
|
||||||
const Icon(
|
const Icon(
|
||||||
Icons.arrow_forward_ios_outlined,
|
Icons
|
||||||
color: ColorsManager.textGray,
|
.arrow_forward_ios_outlined,
|
||||||
|
color:
|
||||||
|
ColorsManager.textGray,
|
||||||
size: 15,
|
size: 15,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@ -115,15 +126,17 @@ class SettingHelper {
|
|||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
BlocProvider.of<SettingBloc>(context).add(
|
BlocProvider.of<SettingBloc>(
|
||||||
FetchIcons(
|
context)
|
||||||
|
.add(FetchIcons(
|
||||||
expanded: !context
|
expanded: !context
|
||||||
.read<SettingBloc>()
|
.read<SettingBloc>()
|
||||||
.isExpanded));
|
.isExpanded));
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.spaceBetween,
|
MainAxisAlignment
|
||||||
|
.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Effective Period',
|
'Effective Period',
|
||||||
@ -131,14 +144,17 @@ class SettingHelper {
|
|||||||
.textTheme
|
.textTheme
|
||||||
.bodyMedium!
|
.bodyMedium!
|
||||||
.copyWith(
|
.copyWith(
|
||||||
color:
|
color: ColorsManager
|
||||||
ColorsManager.textPrimaryColor,
|
.textPrimaryColor,
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight:
|
||||||
|
FontWeight.w400,
|
||||||
fontSize: 14),
|
fontSize: 14),
|
||||||
),
|
),
|
||||||
const Icon(
|
const Icon(
|
||||||
Icons.arrow_forward_ios_outlined,
|
Icons
|
||||||
color: ColorsManager.textGray,
|
.arrow_forward_ios_outlined,
|
||||||
|
color:
|
||||||
|
ColorsManager.textGray,
|
||||||
size: 15,
|
size: 15,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@ -154,7 +170,8 @@ class SettingHelper {
|
|||||||
height: 5,
|
height: 5,
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Executed by',
|
'Executed by',
|
||||||
@ -162,8 +179,10 @@ class SettingHelper {
|
|||||||
.textTheme
|
.textTheme
|
||||||
.bodyMedium!
|
.bodyMedium!
|
||||||
.copyWith(
|
.copyWith(
|
||||||
color: ColorsManager.textPrimaryColor,
|
color: ColorsManager
|
||||||
fontWeight: FontWeight.w400,
|
.textPrimaryColor,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w400,
|
||||||
fontSize: 14),
|
fontSize: 14),
|
||||||
),
|
),
|
||||||
Text('Cloud',
|
Text('Cloud',
|
||||||
@ -171,12 +190,17 @@ class SettingHelper {
|
|||||||
.textTheme
|
.textTheme
|
||||||
.bodyMedium!
|
.bodyMedium!
|
||||||
.copyWith(
|
.copyWith(
|
||||||
color: ColorsManager.textGray,
|
color: ColorsManager
|
||||||
fontWeight: FontWeight.w400,
|
.textGray,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w400,
|
||||||
fontSize: 14)),
|
fontSize: 14)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (context.read<RoutineBloc>().state.isUpdate ??
|
if (context
|
||||||
|
.read<RoutineBloc>()
|
||||||
|
.state
|
||||||
|
.isUpdate ??
|
||||||
false)
|
false)
|
||||||
const DeleteSceneWidget()
|
const DeleteSceneWidget()
|
||||||
],
|
],
|
||||||
@ -188,20 +212,25 @@ class SettingHelper {
|
|||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.only(
|
padding: const EdgeInsets.only(
|
||||||
top: 10, left: 10, right: 10, bottom: 10),
|
top: 10,
|
||||||
|
left: 10,
|
||||||
|
right: 10,
|
||||||
|
bottom: 10),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
BlocProvider.of<SettingBloc>(context).add(
|
BlocProvider.of<SettingBloc>(
|
||||||
FetchIcons(
|
context)
|
||||||
|
.add(FetchIcons(
|
||||||
expanded: !context
|
expanded: !context
|
||||||
.read<SettingBloc>()
|
.read<SettingBloc>()
|
||||||
.isExpanded));
|
.isExpanded));
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.spaceBetween,
|
MainAxisAlignment
|
||||||
|
.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Icons',
|
'Icons',
|
||||||
@ -209,14 +238,17 @@ class SettingHelper {
|
|||||||
.textTheme
|
.textTheme
|
||||||
.bodyMedium!
|
.bodyMedium!
|
||||||
.copyWith(
|
.copyWith(
|
||||||
color:
|
color: ColorsManager
|
||||||
ColorsManager.textPrimaryColor,
|
.textPrimaryColor,
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight:
|
||||||
|
FontWeight.w400,
|
||||||
fontSize: 14),
|
fontSize: 14),
|
||||||
),
|
),
|
||||||
const Icon(
|
const Icon(
|
||||||
Icons.arrow_forward_ios_outlined,
|
Icons
|
||||||
color: ColorsManager.textGray,
|
.arrow_forward_ios_outlined,
|
||||||
|
color:
|
||||||
|
ColorsManager.textGray,
|
||||||
size: 15,
|
size: 15,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@ -232,7 +264,8 @@ class SettingHelper {
|
|||||||
height: 5,
|
height: 5,
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Show on devices page',
|
'Show on devices page',
|
||||||
@ -240,17 +273,21 @@ class SettingHelper {
|
|||||||
.textTheme
|
.textTheme
|
||||||
.bodyMedium!
|
.bodyMedium!
|
||||||
.copyWith(
|
.copyWith(
|
||||||
color: ColorsManager.textPrimaryColor,
|
color: ColorsManager
|
||||||
fontWeight: FontWeight.w400,
|
.textPrimaryColor,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w400,
|
||||||
fontSize: 14),
|
fontSize: 14),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
height: 30,
|
height: 30,
|
||||||
width: 1,
|
width: 1,
|
||||||
color: ColorsManager.graysColor,
|
color: ColorsManager
|
||||||
|
.graysColor,
|
||||||
),
|
),
|
||||||
Transform.scale(
|
Transform.scale(
|
||||||
scale: .8,
|
scale: .8,
|
||||||
@ -274,7 +311,8 @@ class SettingHelper {
|
|||||||
height: 5,
|
height: 5,
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Executed by',
|
'Executed by',
|
||||||
@ -282,8 +320,10 @@ class SettingHelper {
|
|||||||
.textTheme
|
.textTheme
|
||||||
.bodyMedium!
|
.bodyMedium!
|
||||||
.copyWith(
|
.copyWith(
|
||||||
color: ColorsManager.textPrimaryColor,
|
color: ColorsManager
|
||||||
fontWeight: FontWeight.w400,
|
.textPrimaryColor,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w400,
|
||||||
fontSize: 14),
|
fontSize: 14),
|
||||||
),
|
),
|
||||||
Text('Cloud',
|
Text('Cloud',
|
||||||
@ -291,12 +331,17 @@ class SettingHelper {
|
|||||||
.textTheme
|
.textTheme
|
||||||
.bodyMedium!
|
.bodyMedium!
|
||||||
.copyWith(
|
.copyWith(
|
||||||
color: ColorsManager.textGray,
|
color: ColorsManager
|
||||||
fontWeight: FontWeight.w400,
|
.textGray,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w400,
|
||||||
fontSize: 14)),
|
fontSize: 14)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (context.read<RoutineBloc>().state.isUpdate ??
|
if (context
|
||||||
|
.read<RoutineBloc>()
|
||||||
|
.state
|
||||||
|
.isUpdate ??
|
||||||
false)
|
false)
|
||||||
const DeleteSceneWidget()
|
const DeleteSceneWidget()
|
||||||
],
|
],
|
||||||
@ -304,12 +349,14 @@ class SettingHelper {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (context.read<SettingBloc>().isExpanded && !isAutomation)
|
if (context.read<SettingBloc>().isExpanded &&
|
||||||
|
!isAutomation)
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 400,
|
width: 400,
|
||||||
height: 150,
|
height: 150,
|
||||||
child: settingState is LoadingState
|
child: settingState is LoadingState
|
||||||
? const Center(child: CircularProgressIndicator())
|
? const Center(
|
||||||
|
child: CircularProgressIndicator())
|
||||||
: GridView.builder(
|
: GridView.builder(
|
||||||
gridDelegate:
|
gridDelegate:
|
||||||
const SliverGridDelegateWithFixedCrossAxisCount(
|
const SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
@ -326,7 +373,8 @@ class SettingHelper {
|
|||||||
height: 35,
|
height: 35,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
BlocProvider.of<SettingBloc>(context)
|
BlocProvider.of<SettingBloc>(
|
||||||
|
context)
|
||||||
.add(SelectIcon(
|
.add(SelectIcon(
|
||||||
iconId: iconModel.uuid,
|
iconId: iconModel.uuid,
|
||||||
));
|
));
|
||||||
@ -335,12 +383,14 @@ class SettingHelper {
|
|||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
child: ClipOval(
|
child: ClipOval(
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(1),
|
padding:
|
||||||
|
const EdgeInsets.all(1),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: selectedIcon == iconModel.uuid
|
color: selectedIcon ==
|
||||||
|
iconModel.uuid
|
||||||
? ColorsManager
|
? ColorsManager
|
||||||
.primaryColorWithOpacity
|
.opaquePrimary
|
||||||
: Colors.transparent,
|
: Colors.transparent,
|
||||||
width: 2,
|
width: 2,
|
||||||
),
|
),
|
||||||
@ -356,8 +406,12 @@ class SettingHelper {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
)),
|
)),
|
||||||
if (context.read<SettingBloc>().isExpanded && isAutomation)
|
if (context.read<SettingBloc>().isExpanded &&
|
||||||
const SizedBox(height: 350, width: 400, child: EffectivePeriodView())
|
isAutomation)
|
||||||
|
const SizedBox(
|
||||||
|
height: 350,
|
||||||
|
width: 400,
|
||||||
|
child: EffectivePeriodView())
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
@ -381,23 +435,31 @@ class SettingHelper {
|
|||||||
alignment: AlignmentDirectional.center,
|
alignment: AlignmentDirectional.center,
|
||||||
child: Text(
|
child: Text(
|
||||||
'Cancel',
|
'Cancel',
|
||||||
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
style: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.bodyMedium!
|
||||||
|
.copyWith(
|
||||||
color: ColorsManager.textGray,
|
color: ColorsManager.textGray,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(width: 1, height: 50, color: ColorsManager.greyColor),
|
Container(
|
||||||
|
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: effectPeriodState.customStartTime!,
|
start:
|
||||||
|
effectPeriodState.customStartTime!,
|
||||||
end: effectPeriodState.customEndTime!,
|
end: effectPeriodState.customEndTime!,
|
||||||
loops: effectPeriodState.selectedDaysBinary)));
|
loops: effectPeriodState
|
||||||
|
.selectedDaysBinary)));
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
} else {
|
} else {
|
||||||
Navigator.of(context).pop(selectedIcon);
|
Navigator.of(context).pop(selectedIcon);
|
||||||
@ -407,8 +469,11 @@ class SettingHelper {
|
|||||||
alignment: AlignmentDirectional.center,
|
alignment: AlignmentDirectional.center,
|
||||||
child: Text(
|
child: Text(
|
||||||
'Confirm',
|
'Confirm',
|
||||||
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
style: Theme.of(context)
|
||||||
color: ColorsManager.primaryColorWithOpacity,
|
.textTheme
|
||||||
|
.bodyMedium!
|
||||||
|
.copyWith(
|
||||||
|
color: ColorsManager.opaquePrimary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -88,19 +88,17 @@ class ThreeGangSwitchHelper {
|
|||||||
size: 16,
|
size: 16,
|
||||||
color: ColorsManager.textGray,
|
color: ColorsManager.textGray,
|
||||||
),
|
),
|
||||||
onTap: () => RoutineTapFunctionHelper
|
onTap: () =>
|
||||||
.onTapFunction(
|
RoutineTapFunctionHelper.onTapFunction(
|
||||||
context,
|
context,
|
||||||
functionCode: function.code,
|
functionCode: function.code,
|
||||||
functionOperationName:
|
functionOperationName:
|
||||||
function.operationName,
|
function.operationName,
|
||||||
functionValueDescription:
|
functionValueDescription:
|
||||||
selectedFunctionData
|
selectedFunctionData.valueDescription,
|
||||||
.valueDescription,
|
|
||||||
deviceUuid: device?.uuid,
|
deviceUuid: device?.uuid,
|
||||||
codesToAddIntoFunctionsWithDefaultValue:
|
codesToAddIntoFunctionsWithDefaultValue:
|
||||||
function.code
|
function.code.startsWith('countdown')
|
||||||
.startsWith('countdown')
|
|
||||||
? [function.code]
|
? [function.code]
|
||||||
: [],
|
: [],
|
||||||
),
|
),
|
||||||
@ -114,12 +112,10 @@ 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:
|
operationName: selectedOperationName ?? '',
|
||||||
selectedOperationName ?? '',
|
|
||||||
removeComparetors: removeComparetors,
|
removeComparetors: removeComparetors,
|
||||||
dialogType: dialogType),
|
dialogType: dialogType),
|
||||||
),
|
),
|
||||||
@ -188,8 +184,7 @@ class ThreeGangSwitchHelper {
|
|||||||
dialogType: dialogType);
|
dialogType: dialogType);
|
||||||
}
|
}
|
||||||
|
|
||||||
final selectedFn =
|
final selectedFn = switchFunctions.firstWhere((f) => f.code == selectedFunction);
|
||||||
switchFunctions.firstWhere((f) => f.code == selectedFunction);
|
|
||||||
final values = selectedFn.getOperationalValues();
|
final values = selectedFn.getOperationalValues();
|
||||||
|
|
||||||
return _buildOperationalValuesList(
|
return _buildOperationalValuesList(
|
||||||
@ -307,13 +302,9 @@ class ThreeGangSwitchHelper {
|
|||||||
style: context.textTheme.bodyMedium,
|
style: context.textTheme.bodyMedium,
|
||||||
),
|
),
|
||||||
trailing: Icon(
|
trailing: Icon(
|
||||||
isSelected
|
isSelected ? Icons.radio_button_checked : Icons.radio_button_unchecked,
|
||||||
? Icons.radio_button_checked
|
|
||||||
: Icons.radio_button_unchecked,
|
|
||||||
size: 24,
|
size: 24,
|
||||||
color: isSelected
|
color: isSelected ? ColorsManager.opaquePrimary : ColorsManager.textGray,
|
||||||
? ColorsManager.primaryColorWithOpacity
|
|
||||||
: ColorsManager.textGray,
|
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (!isSelected) {
|
if (!isSelected) {
|
||||||
@ -325,8 +316,7 @@ class ThreeGangSwitchHelper {
|
|||||||
operationName: operationName,
|
operationName: operationName,
|
||||||
value: value.value,
|
value: value.value,
|
||||||
condition: selectedFunctionData?.condition,
|
condition: selectedFunctionData?.condition,
|
||||||
valueDescription:
|
valueDescription: selectedFunctionData?.valueDescription,
|
||||||
selectedFunctionData?.valueDescription,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -89,15 +89,14 @@ class TwoGangSwitchHelper {
|
|||||||
size: 16,
|
size: 16,
|
||||||
color: ColorsManager.textGray,
|
color: ColorsManager.textGray,
|
||||||
),
|
),
|
||||||
onTap: () => RoutineTapFunctionHelper
|
onTap: () =>
|
||||||
.onTapFunction(
|
RoutineTapFunctionHelper.onTapFunction(
|
||||||
context,
|
context,
|
||||||
functionCode: function.code,
|
functionCode: function.code,
|
||||||
functionOperationName:
|
functionOperationName:
|
||||||
function.operationName,
|
function.operationName,
|
||||||
functionValueDescription:
|
functionValueDescription:
|
||||||
selectedFunctionData
|
selectedFunctionData.valueDescription,
|
||||||
.valueDescription,
|
|
||||||
deviceUuid: device?.uuid,
|
deviceUuid: device?.uuid,
|
||||||
codesToAddIntoFunctionsWithDefaultValue: [
|
codesToAddIntoFunctionsWithDefaultValue: [
|
||||||
'countdown_1',
|
'countdown_1',
|
||||||
@ -147,13 +146,10 @@ class TwoGangSwitchHelper {
|
|||||||
// }
|
// }
|
||||||
final selectedFunctionData =
|
final selectedFunctionData =
|
||||||
state.addedFunctions.firstWhere(
|
state.addedFunctions.firstWhere(
|
||||||
(f) =>
|
(f) => f.functionCode == state.selectedFunction,
|
||||||
f.functionCode ==
|
|
||||||
state.selectedFunction,
|
|
||||||
orElse: () => DeviceFunctionData(
|
orElse: () => DeviceFunctionData(
|
||||||
entityId: '',
|
entityId: '',
|
||||||
functionCode:
|
functionCode: state.selectedFunction ?? '',
|
||||||
state.selectedFunction ?? '',
|
|
||||||
operationName: '',
|
operationName: '',
|
||||||
value: null,
|
value: null,
|
||||||
),
|
),
|
||||||
@ -192,8 +188,7 @@ class TwoGangSwitchHelper {
|
|||||||
required bool removeComparetors,
|
required bool removeComparetors,
|
||||||
required String dialogType,
|
required String dialogType,
|
||||||
}) {
|
}) {
|
||||||
if (selectedFunction == 'countdown_1' ||
|
if (selectedFunction == 'countdown_1' || selectedFunction == 'countdown_2') {
|
||||||
selectedFunction == 'countdown_2') {
|
|
||||||
final initialValue = selectedFunctionData?.value ?? 0;
|
final initialValue = selectedFunctionData?.value ?? 0;
|
||||||
return _buildTemperatureSelector(
|
return _buildTemperatureSelector(
|
||||||
context: context,
|
context: context,
|
||||||
@ -207,8 +202,7 @@ class TwoGangSwitchHelper {
|
|||||||
dialogType: dialogType);
|
dialogType: dialogType);
|
||||||
}
|
}
|
||||||
|
|
||||||
final selectedFn =
|
final selectedFn = switchFunctions.firstWhere((f) => f.code == selectedFunction);
|
||||||
switchFunctions.firstWhere((f) => f.code == selectedFunction);
|
|
||||||
final values = selectedFn.getOperationalValues();
|
final values = selectedFn.getOperationalValues();
|
||||||
|
|
||||||
return _buildOperationalValuesList(
|
return _buildOperationalValuesList(
|
||||||
@ -270,16 +264,15 @@ class TwoGangSwitchHelper {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||||
selectedBorderColor: ColorsManager.primaryColorWithOpacity,
|
selectedBorderColor: ColorsManager.opaquePrimary,
|
||||||
selectedColor: Colors.white,
|
selectedColor: Colors.white,
|
||||||
fillColor: ColorsManager.primaryColorWithOpacity,
|
fillColor: ColorsManager.opaquePrimary,
|
||||||
color: ColorsManager.primaryColorWithOpacity,
|
color: ColorsManager.opaquePrimary,
|
||||||
constraints: const BoxConstraints(
|
constraints: const BoxConstraints(
|
||||||
minHeight: 40.0,
|
minHeight: 40.0,
|
||||||
minWidth: 40.0,
|
minWidth: 40.0,
|
||||||
),
|
),
|
||||||
isSelected:
|
isSelected: conditions.map((c) => c == (currentCondition ?? "==")).toList(),
|
||||||
conditions.map((c) => c == (currentCondition ?? "==")).toList(),
|
|
||||||
children: conditions.map((c) => Text(c)).toList(),
|
children: conditions.map((c) => Text(c)).toList(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -295,13 +288,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.primaryColorWithOpacity.withOpacity(0.1),
|
color: ColorsManager.opaquePrimary.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.primaryColorWithOpacity,
|
color: ColorsManager.opaquePrimary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -338,8 +331,7 @@ class TwoGangSwitchHelper {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
onTextChanged: (value) {
|
onTextChanged: (value) {
|
||||||
final roundedValue =
|
final roundedValue = value.round(); // Round to nearest integer (stepSize 1)
|
||||||
value.round(); // Round to nearest integer (stepSize 1)
|
|
||||||
context.read<FunctionBloc>().add(
|
context.read<FunctionBloc>().add(
|
||||||
AddFunction(
|
AddFunction(
|
||||||
functionData: DeviceFunctionData(
|
functionData: DeviceFunctionData(
|
||||||
@ -391,13 +383,9 @@ class TwoGangSwitchHelper {
|
|||||||
style: context.textTheme.bodyMedium,
|
style: context.textTheme.bodyMedium,
|
||||||
),
|
),
|
||||||
trailing: Icon(
|
trailing: Icon(
|
||||||
isSelected
|
isSelected ? Icons.radio_button_checked : Icons.radio_button_unchecked,
|
||||||
? Icons.radio_button_checked
|
|
||||||
: Icons.radio_button_unchecked,
|
|
||||||
size: 24,
|
size: 24,
|
||||||
color: isSelected
|
color: isSelected ? ColorsManager.opaquePrimary : ColorsManager.textGray,
|
||||||
? ColorsManager.primaryColorWithOpacity
|
|
||||||
: ColorsManager.textGray,
|
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (!isSelected) {
|
if (!isSelected) {
|
||||||
@ -409,8 +397,7 @@ class TwoGangSwitchHelper {
|
|||||||
operationName: operationName,
|
operationName: operationName,
|
||||||
value: value.value,
|
value: value.value,
|
||||||
condition: selectedFunctionData?.condition,
|
condition: selectedFunctionData?.condition,
|
||||||
valueDescription:
|
valueDescription: selectedFunctionData?.valueDescription,
|
||||||
selectedFunctionData?.valueDescription,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -61,8 +61,9 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
|
|||||||
children: [
|
children: [
|
||||||
ConstrainedBox(
|
ConstrainedBox(
|
||||||
constraints: BoxConstraints(
|
constraints: BoxConstraints(
|
||||||
maxWidth:
|
maxWidth: constraints.maxWidth > 700
|
||||||
constraints.maxWidth > 700 ? 450 : constraints.maxWidth - 32),
|
? 450
|
||||||
|
: constraints.maxWidth - 32),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@ -71,7 +72,9 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
|
|||||||
children: [
|
children: [
|
||||||
Text('* ',
|
Text('* ',
|
||||||
style: context.textTheme.bodyMedium!
|
style: context.textTheme.bodyMedium!
|
||||||
.copyWith(color: ColorsManager.red, fontSize: 13)),
|
.copyWith(
|
||||||
|
color: ColorsManager.red,
|
||||||
|
fontSize: 13)),
|
||||||
Text(
|
Text(
|
||||||
'Routine Name',
|
'Routine Name',
|
||||||
style: context.textTheme.bodyMedium!.copyWith(
|
style: context.textTheme.bodyMedium!.copyWith(
|
||||||
@ -93,9 +96,11 @@ 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(fontSize: 12, color: ColorsManager.grayColor),
|
.copyWith(
|
||||||
contentPadding:
|
fontSize: 12,
|
||||||
const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
|
color: ColorsManager.grayColor),
|
||||||
|
contentPadding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 12, vertical: 10),
|
||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
),
|
),
|
||||||
onTapOutside: (_) {
|
onTapOutside: (_) {
|
||||||
@ -121,9 +126,11 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
|
|||||||
width: 200,
|
width: 200,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: DefaultButton(
|
child: DefaultButton(
|
||||||
onPressed: state.isAutomation || state.isTabToRun
|
onPressed: state.isAutomation ||
|
||||||
|
state.isTabToRun
|
||||||
? () async {
|
? () async {
|
||||||
final result = await SettingHelper.showSettingDialog(
|
final result = await SettingHelper
|
||||||
|
.showSettingDialog(
|
||||||
context: context,
|
context: context,
|
||||||
iconId: state.selectedIcon ?? '',
|
iconId: state.selectedIcon ?? '',
|
||||||
);
|
);
|
||||||
@ -186,10 +193,12 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
|
|||||||
child: Center(
|
child: Center(
|
||||||
child: DefaultButton(
|
child: DefaultButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
if (state.routineName == null || state.routineName!.isEmpty) {
|
if (state.routineName == null ||
|
||||||
|
state.routineName!.isEmpty) {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: const Text('Please enter the routine name'),
|
content: 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(
|
||||||
@ -203,10 +212,12 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
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('Please add if and then condition'),
|
content: const Text(
|
||||||
|
'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(
|
||||||
@ -221,7 +232,8 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
|
|||||||
}
|
}
|
||||||
// final result =
|
// final result =
|
||||||
// await
|
// await
|
||||||
BlocProvider.of<RoutineBloc>(context).add(ResetErrorMessage());
|
BlocProvider.of<RoutineBloc>(context)
|
||||||
|
.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(
|
||||||
@ -240,7 +252,7 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
|
|||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: ColorsManager.whiteColors,
|
color: ColorsManager.white,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -261,10 +273,14 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
|
|||||||
child: DefaultButton(
|
child: DefaultButton(
|
||||||
onPressed: state.isAutomation || state.isTabToRun
|
onPressed: state.isAutomation || state.isTabToRun
|
||||||
? () async {
|
? () async {
|
||||||
final result = await SettingHelper.showSettingDialog(
|
final result =
|
||||||
context: context, iconId: state.selectedIcon ?? '');
|
await SettingHelper.showSettingDialog(
|
||||||
|
context: context,
|
||||||
|
iconId: state.selectedIcon ?? '');
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
context.read<RoutineBloc>().add(AddSelectedIcon(result));
|
context
|
||||||
|
.read<RoutineBloc>()
|
||||||
|
.add(AddSelectedIcon(result));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
@ -314,10 +330,12 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
|
|||||||
child: Center(
|
child: Center(
|
||||||
child: DefaultButton(
|
child: DefaultButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
if (state.routineName == null || state.routineName!.isEmpty) {
|
if (state.routineName == null ||
|
||||||
|
state.routineName!.isEmpty) {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: const Text('Please enter the routine name'),
|
content:
|
||||||
|
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(
|
||||||
@ -334,7 +352,8 @@ 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('Please add if and then condition'),
|
content: const Text(
|
||||||
|
'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(
|
||||||
@ -349,7 +368,8 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
|
|||||||
}
|
}
|
||||||
// final result =
|
// final result =
|
||||||
// await
|
// await
|
||||||
BlocProvider.of<RoutineBloc>(context).add(ResetErrorMessage());
|
BlocProvider.of<RoutineBloc>(context)
|
||||||
|
.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(
|
||||||
@ -368,7 +388,7 @@ class _RoutineSearchAndButtonsState extends State<RoutineSearchAndButtons> {
|
|||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: ColorsManager.whiteColors,
|
color: ColorsManager.white,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -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.primaryColorWithOpacity.withOpacity(0.1),
|
color: ColorsManager.opaquePrimary.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.primaryColorWithOpacity,
|
color: ColorsManager.opaquePrimary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -1,12 +1,29 @@
|
|||||||
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: (_) => const CreateCommunityDialog(),
|
builder: (_) => 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(
|
||||||
|
@ -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.whiteColors,
|
color: ColorsManager.white,
|
||||||
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.whiteColors,
|
foregroundColor: ColorsManager.white,
|
||||||
child: const Text('OK'),
|
child: const Text('OK'),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -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.whiteColors,
|
color: ColorsManager.white,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: ColorsManager.shadowBlackColor.withValues(alpha: 0.1),
|
color: ColorsManager.shadowBlackColor.withValues(alpha: 0.1),
|
||||||
|
@ -23,62 +23,55 @@ class _CreateSpaceButtonState extends State<CreateSpaceButton> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Tooltip(
|
return InkWell(
|
||||||
margin: const EdgeInsets.symmetric(vertical: 24),
|
onTap: () => SpaceDetailsDialogHelper.showCreate(
|
||||||
message: 'Create a new space',
|
context,
|
||||||
child: InkWell(
|
communityUuid: widget.community.uuid,
|
||||||
onTap: () => SpaceDetailsDialogHelper.showCreate(
|
onSuccess: (updatedSpaceModel) {
|
||||||
context,
|
final newCommunity = widget.community.copyWith(
|
||||||
communityUuid: widget.community.uuid,
|
spaces: [...widget.community.spaces, updatedSpaceModel],
|
||||||
onSuccess: (updatedSpaceModel) {
|
);
|
||||||
final newCommunity = widget.community.copyWith(
|
context.read<CommunitiesBloc>().add(
|
||||||
spaces: [...widget.community.spaces, updatedSpaceModel],
|
CommunitiesUpdateCommunity(newCommunity),
|
||||||
);
|
);
|
||||||
context.read<CommunitiesBloc>().add(
|
context.read<CommunitiesTreeSelectionBloc>().add(
|
||||||
CommunitiesUpdateCommunity(newCommunity),
|
SelectSpaceEvent(
|
||||||
);
|
space: updatedSpaceModel,
|
||||||
context.read<CommunitiesTreeSelectionBloc>().add(
|
community: newCommunity,
|
||||||
SelectSpaceEvent(
|
),
|
||||||
space: updatedSpaceModel,
|
);
|
||||||
community: newCommunity,
|
},
|
||||||
),
|
),
|
||||||
);
|
child: MouseRegion(
|
||||||
},
|
onEnter: (_) => setState(() => _isHovered = true),
|
||||||
),
|
onExit: (_) => setState(() => _isHovered = false),
|
||||||
child: MouseRegion(
|
child: AnimatedOpacity(
|
||||||
onEnter: (_) => setState(() => _isHovered = true),
|
duration: const Duration(milliseconds: 100),
|
||||||
onExit: (_) => setState(() => _isHovered = false),
|
opacity: _isHovered ? 1.0 : 0.45,
|
||||||
child: AnimatedOpacity(
|
child: Container(
|
||||||
duration: const Duration(milliseconds: 100),
|
width: 150,
|
||||||
opacity: _isHovered ? 1.0 : 0.45,
|
height: 90,
|
||||||
|
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(
|
||||||
width: 150,
|
margin: const EdgeInsets.symmetric(vertical: 20),
|
||||||
height: 90,
|
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
border: Border.all(color: ColorsManager.borderColor, width: 2),
|
||||||
borderRadius: BorderRadius.circular(20),
|
color: ColorsManager.boxColor,
|
||||||
boxShadow: [
|
shape: BoxShape.circle,
|
||||||
BoxShadow(
|
|
||||||
color: Colors.grey.withValues(alpha: 0.2),
|
|
||||||
spreadRadius: 3,
|
|
||||||
blurRadius: 8,
|
|
||||||
offset: const Offset(0, 4),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
child: Container(
|
child: const Center(
|
||||||
margin: const EdgeInsets.symmetric(vertical: 20),
|
child: Icon(Icons.add, color: ColorsManager.vividBlue),
|
||||||
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,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -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.whiteColors,
|
color: ColorsManager.white,
|
||||||
size: 20,
|
size: 20,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user