diff --git a/lib/pages/space_tree/view/space_tree_view.dart b/lib/pages/space_tree/view/space_tree_view.dart index 9e5f9725..92bc858d 100644 --- a/lib/pages/space_tree/view/space_tree_view.dart +++ b/lib/pages/space_tree/view/space_tree_view.dart @@ -33,14 +33,12 @@ 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: - widget.isSide == true ? subSectionContainerDecoration : null, + color: ColorsManager.whiteColors, + decoration: widget.isSide == true ? subSectionContainerDecoration : null, child: state is SpaceTreeLoadingState ? const Center(child: CircularProgressIndicator()) : Column( @@ -50,8 +48,7 @@ class _SpaceTreeViewState extends State { decoration: const BoxDecoration( color: ColorsManager.circleRolesBackground, borderRadius: BorderRadius.only( - topRight: Radius.circular(20), - topLeft: Radius.circular(20)), + topRight: Radius.circular(20), topLeft: Radius.circular(20)), ), child: Padding( padding: const EdgeInsets.all(8.0), @@ -60,35 +57,27 @@ class _SpaceTreeViewState extends State { Expanded( child: Container( decoration: BoxDecoration( - borderRadius: const BorderRadius.all( - Radius.circular(20)), - border: Border.all( - color: ColorsManager.grayBorder)), + borderRadius: const BorderRadius.all(Radius.circular(20)), + border: Border.all(color: ColorsManager.grayBorder)), child: TextFormField( - style: - const TextStyle(color: Colors.black), + style: const TextStyle(color: Colors.black), onChanged: (value) { - context - .read() - .add(SearchQueryEvent(value)); + context.read().add(SearchQueryEvent(value)); }, - decoration: textBoxDecoration(radios: 20)! - .copyWith( + decoration: textBoxDecoration(radios: 20)!.copyWith( fillColor: Colors.white, suffixIcon: Padding( - padding: - const EdgeInsets.only(right: 16), + 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), + hintStyle: context.textTheme.bodyMedium?.copyWith( + fontWeight: FontWeight.w400, + fontSize: 12, + color: ColorsManager.textGray), ), ), ), @@ -99,9 +88,7 @@ class _SpaceTreeViewState extends State { ) : CustomSearchBar( onSearchChanged: (query) { - context - .read() - .add(SearchQueryEvent(query)); + context.read().add(SearchQueryEvent(query)); }, ), const SizedBox(height: 16), @@ -117,18 +104,14 @@ 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( @@ -138,39 +121,30 @@ 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, space.uuid ?? '', @@ -178,20 +152,14 @@ class _SpaceTreeViewState extends State { 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), ); @@ -279,8 +247,8 @@ class _SpaceTreeViewState extends State { BuildContext context, SpaceTreeState state, SpaceModel space, CommunityModel community) { 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),