diff --git a/assets/icons/success_icon.svg b/assets/icons/success_icon.svg
new file mode 100644
index 00000000..6f5dbf9e
--- /dev/null
+++ b/assets/icons/success_icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/lib/pages/device_managment/ac/view/ac_device_control.dart b/lib/pages/device_managment/ac/view/ac_device_control.dart
index 5197d722..071344d7 100644
--- a/lib/pages/device_managment/ac/view/ac_device_control.dart
+++ b/lib/pages/device_managment/ac/view/ac_device_control.dart
@@ -24,7 +24,8 @@ class AcDeviceControlsView extends StatelessWidget with HelperResponsiveLayout {
final isLarge = isLargeScreenSize(context);
final isMedium = isMediumScreenSize(context);
return BlocProvider(
- create: (context) => AcBloc(deviceId: device.uuid!)..add(AcFetchDeviceStatusEvent(device.uuid!)),
+ create: (context) => AcBloc(deviceId: device.uuid!)
+ ..add(AcFetchDeviceStatusEvent(device.uuid!)),
child: BlocBuilder(
builder: (context, state) {
if (state is ACStatusLoaded) {
@@ -98,7 +99,8 @@ class AcDeviceControlsView extends StatelessWidget with HelperResponsiveLayout {
),
Text(
'h',
- style: context.textTheme.bodySmall!.copyWith(color: ColorsManager.blackColor),
+ style: context.textTheme.bodySmall!
+ .copyWith(color: ColorsManager.blackColor),
),
Text(
'30',
@@ -107,7 +109,9 @@ class AcDeviceControlsView extends StatelessWidget with HelperResponsiveLayout {
fontWeight: FontWeight.bold,
),
),
- Text('m', style: context.textTheme.bodySmall!.copyWith(color: ColorsManager.blackColor)),
+ Text('m',
+ style: context.textTheme.bodySmall!
+ .copyWith(color: ColorsManager.blackColor)),
IconButton(
padding: const EdgeInsets.all(0),
onPressed: () {},
diff --git a/lib/pages/space_tree/view/space_tree_view.dart b/lib/pages/space_tree/view/space_tree_view.dart
index de9d088e..3954f200 100644
--- a/lib/pages/space_tree/view/space_tree_view.dart
+++ b/lib/pages/space_tree/view/space_tree_view.dart
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:flutter_svg/svg.dart';
import 'package:syncrow_web/common/widgets/search_bar.dart';
import 'package:syncrow_web/pages/space_tree/bloc/space_tree_bloc.dart';
import 'package:syncrow_web/pages/space_tree/bloc/space_tree_event.dart';
@@ -8,11 +9,14 @@ import 'package:syncrow_web/pages/space_tree/view/custom_expansion.dart';
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/community_model.dart';
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/space_model.dart';
import 'package:syncrow_web/utils/color_manager.dart';
+import 'package:syncrow_web/utils/constants/assets.dart';
+import 'package:syncrow_web/utils/extension/build_context_x.dart';
import 'package:syncrow_web/utils/style.dart';
class SpaceTreeView extends StatefulWidget {
+ final bool? isSide;
final Function onSelect;
- const SpaceTreeView({required this.onSelect, super.key});
+ const SpaceTreeView({required this.onSelect, this.isSide, super.key});
@override
State createState() => _SpaceTreeViewState();
@@ -29,20 +33,77 @@ class _SpaceTreeViewState extends State {
@override
Widget build(BuildContext context) {
- return BlocBuilder(builder: (context, state) {
- List list = state.isSearching ? state.filteredCommunity : state.communityList;
+ return BlocBuilder(
+ builder: (context, state) {
+ List list =
+ state.isSearching ? state.filteredCommunity : state.communityList;
return Container(
height: MediaQuery.sizeOf(context).height,
- decoration: subSectionContainerDecoration,
+ decoration:
+ widget.isSide == true ? subSectionContainerDecoration : null,
child: state is SpaceTreeLoadingState
? const Center(child: CircularProgressIndicator())
: Column(
children: [
- CustomSearchBar(
- onSearchChanged: (query) {
- context.read().add(SearchQueryEvent(query));
- },
- ),
+ widget.isSide == true
+ ? Container(
+ decoration: const BoxDecoration(
+ color: ColorsManager.circleRolesBackground,
+ borderRadius: BorderRadius.only(
+ topRight: Radius.circular(20),
+ topLeft: Radius.circular(20)),
+ ),
+ child: Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: Row(
+ children: [
+ Expanded(
+ child: Container(
+ decoration: BoxDecoration(
+ borderRadius: const BorderRadius.all(
+ Radius.circular(20)),
+ border: Border.all(
+ color: ColorsManager.grayBorder)),
+ child: TextFormField(
+ style:
+ const TextStyle(color: Colors.black),
+ onChanged: (value) {
+ context
+ .read()
+ .add(SearchQueryEvent(value));
+ },
+ decoration: textBoxDecoration(radios: 20)!
+ .copyWith(
+ fillColor: Colors.white,
+ suffixIcon: Padding(
+ padding:
+ const EdgeInsets.only(right: 16),
+ child: SvgPicture.asset(
+ Assets.textFieldSearch,
+ width: 24,
+ height: 24,
+ ),
+ ),
+ hintStyle: context.textTheme.bodyMedium
+ ?.copyWith(
+ fontWeight: FontWeight.w400,
+ fontSize: 12,
+ color: ColorsManager.textGray),
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ )
+ : CustomSearchBar(
+ onSearchChanged: (query) {
+ context
+ .read()
+ .add(SearchQueryEvent(query));
+ },
+ ),
const SizedBox(height: 16),
Expanded(
child: ListView(
@@ -56,14 +117,18 @@ class _SpaceTreeViewState extends State {
? Center(
child: Text(
'No results found',
- style: Theme.of(context).textTheme.bodySmall!.copyWith(
+ style: Theme.of(context)
+ .textTheme
+ .bodySmall!
+ .copyWith(
color: ColorsManager.lightGrayColor,
fontWeight: FontWeight.w400,
),
),
)
: Scrollbar(
- scrollbarOrientation: ScrollbarOrientation.left,
+ scrollbarOrientation:
+ ScrollbarOrientation.left,
thumbVisibility: true,
controller: _scrollController,
child: Padding(
@@ -73,47 +138,68 @@ class _SpaceTreeViewState extends State {
shrinkWrap: true,
children: list
.map(
- (community) => CustomExpansionTileSpaceTree(
+ (community) =>
+ CustomExpansionTileSpaceTree(
title: community.name,
- isSelected: state.selectedCommunities
+ isSelected: state
+ .selectedCommunities
.contains(community.uuid),
- isSoldCheck: state.selectedCommunities
+ isSoldCheck: state
+ .selectedCommunities
.contains(community.uuid),
onExpansionChanged: () {
context
.read()
- .add(OnCommunityExpanded(community.uuid));
+ .add(OnCommunityExpanded(
+ community.uuid));
},
- isExpanded: state.expandedCommunities
+ isExpanded: state
+ .expandedCommunities
.contains(community.uuid),
onItemSelected: () {
- context.read().add(
- OnCommunitySelected(
- community.uuid, community.spaces));
+ context
+ .read()
+ .add(OnCommunitySelected(
+ community.uuid,
+ community.spaces));
widget.onSelect();
},
- children: community.spaces.map((space) {
+ children:
+ community.spaces.map((space) {
return CustomExpansionTileSpaceTree(
title: space.name,
- isExpanded:
- state.expandedSpaces.contains(space.uuid),
+ isExpanded: state
+ .expandedSpaces
+ .contains(space.uuid),
onItemSelected: () {
- context.read().add(
- OnSpaceSelected(community.uuid,
- space.uuid ?? '', space.children));
+ context
+ .read()
+ .add(OnSpaceSelected(
+ community.uuid,
+ space.uuid ?? '',
+ space.children));
widget.onSelect();
},
onExpansionChanged: () {
- context.read().add(
- OnSpaceExpanded(
- community.uuid, space.uuid ?? ''));
+ context
+ .read()
+ .add(OnSpaceExpanded(
+ community.uuid,
+ space.uuid ?? ''));
},
- isSelected:
- state.selectedSpaces.contains(space.uuid) ||
- state.soldCheck.contains(space.uuid),
- isSoldCheck: state.soldCheck.contains(space.uuid),
+ isSelected: state
+ .selectedSpaces
+ .contains(
+ space.uuid) ||
+ state.soldCheck
+ .contains(space.uuid),
+ isSoldCheck: state.soldCheck
+ .contains(space.uuid),
children: _buildNestedSpaces(
- context, state, space, community.uuid),
+ context,
+ state,
+ space,
+ community.uuid),
);
}).toList(),
),
@@ -195,23 +281,24 @@ class _SpaceTreeViewState extends State {
});
}
- List _buildNestedSpaces(
- BuildContext context, SpaceTreeState state, SpaceModel space, String communityId) {
+ List _buildNestedSpaces(BuildContext context, SpaceTreeState state,
+ SpaceModel space, String communityId) {
return space.children.map((child) {
return CustomExpansionTileSpaceTree(
- isSelected:
- state.selectedSpaces.contains(child.uuid) || state.soldCheck.contains(child.uuid),
+ isSelected: state.selectedSpaces.contains(child.uuid) ||
+ state.soldCheck.contains(child.uuid),
isSoldCheck: state.soldCheck.contains(child.uuid),
title: child.name,
isExpanded: state.expandedSpaces.contains(child.uuid),
onItemSelected: () {
- context
- .read()
- .add(OnSpaceSelected(communityId, child.uuid ?? '', child.children));
+ context.read().add(
+ OnSpaceSelected(communityId, child.uuid ?? '', child.children));
widget.onSelect();
},
onExpansionChanged: () {
- context.read().add(OnSpaceExpanded(communityId, child.uuid ?? ''));
+ context
+ .read()
+ .add(OnSpaceExpanded(communityId, child.uuid ?? ''));
},
children: _buildNestedSpaces(context, state, child, communityId),
);
diff --git a/lib/pages/spaces_management/space_model/models/space_template_model.dart b/lib/pages/spaces_management/space_model/models/space_template_model.dart
index aca986bf..3323fe6e 100644
--- a/lib/pages/spaces_management/space_model/models/space_template_model.dart
+++ b/lib/pages/spaces_management/space_model/models/space_template_model.dart
@@ -11,7 +11,7 @@ class SpaceTemplateModel extends Equatable {
List? subspaceModels;
final List? tags;
String internalId;
- DateTime? createdAt;
+ String? createdAt;
@override
List