diff --git a/lib/pages/routines/create_new_routines/commu_dropdown.dart b/lib/pages/routines/create_new_routines/commu_dropdown.dart index b6cece30..431e633a 100644 --- a/lib/pages/routines/create_new_routines/commu_dropdown.dart +++ b/lib/pages/routines/create_new_routines/commu_dropdown.dart @@ -51,53 +51,74 @@ class _SpaceTreeDropdownState extends State { : state.communityList; final selectedCommunity = _findCommunity(communities, _selectedSpaceId); - return CompositedTransformTarget( - link: _layerLink, - child: GestureDetector( - onTap: _toggleDropdown, - child: Container( - height: 46, - decoration: BoxDecoration( - border: Border.all(color: Colors.grey.shade300), - borderRadius: BorderRadius.circular(12), + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, ), - margin: const EdgeInsets.symmetric(horizontal: 10, vertical: 8), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 12), - child: Text( - selectedCommunity?.name ?? 'Select a space', - style: TextStyle( - color: selectedCommunity != null - ? Colors.black - : Colors.grey, - overflow: TextOverflow.ellipsis, - fontWeight: FontWeight.w400, - fontSize: 15, - ), + child: Text( + "Community", + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontWeight: FontWeight.w400, + fontSize: 13, + color: ColorsManager.blackColor, ), - ), - Container( - decoration: BoxDecoration( - color: Colors.grey[200], - borderRadius: const BorderRadius.only( - topRight: Radius.circular(10), - bottomRight: Radius.circular(10), - ), - ), - height: 45, - width: 35, - child: const Icon( - Icons.keyboard_arrow_down, - color: ColorsManager.textGray, - ), - ), - ], ), ), - ), + CompositedTransformTarget( + link: _layerLink, + child: GestureDetector( + onTap: _toggleDropdown, + child: Container( + height: 46, + decoration: BoxDecoration( + border: Border.all(color: Colors.grey.shade300), + borderRadius: BorderRadius.circular(12), + ), + margin: const EdgeInsets.symmetric( + horizontal: 10, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 10), + child: Text( + selectedCommunity?.name ?? 'Please Select', + style: TextStyle( + color: selectedCommunity != null + ? ColorsManager.blackColor + : ColorsManager.textGray, + overflow: TextOverflow.ellipsis, + fontWeight: FontWeight.w400, + fontSize: 13, + ), + ), + ), + Container( + decoration: BoxDecoration( + color: Colors.grey[200], + borderRadius: const BorderRadius.only( + topRight: Radius.circular(10), + bottomRight: Radius.circular(10), + ), + ), + height: 45, + width: 33, + child: const Icon( + Icons.keyboard_arrow_down, + color: ColorsManager.textGray, + ), + ), + ], + ), + ), + ), + ), + ], ); }, ); diff --git a/lib/pages/routines/create_new_routines/create_new_routines.dart b/lib/pages/routines/create_new_routines/create_new_routines.dart index a763683d..fe207910 100644 --- a/lib/pages/routines/create_new_routines/create_new_routines.dart +++ b/lib/pages/routines/create_new_routines/create_new_routines.dart @@ -31,7 +31,7 @@ class _CreateNewRoutinesDialogState extends State { final spaces = _bloc.spacesOnlyWithDevices; final isLoadingCommunities = state is CommunitiesLoadingState; final isLoadingSpaces = state is SpaceWithDeviceLoadingState; - String spaceHint = 'Select a community first'; + String spaceHint = 'Please Select'; if (_selectedCommunity != null) { if (isLoadingSpaces) { spaceHint = 'Loading spaces...'; @@ -55,7 +55,9 @@ class _CreateNewRoutinesDialogState extends State { 'Create New Routines', textAlign: TextAlign.center, style: Theme.of(context).textTheme.bodyMedium!.copyWith( - color: ColorsManager.primaryColor, + color: ColorsManager.spaceColor, + fontSize: 20, + fontWeight: FontWeight.w700, ), ), content: Stack( @@ -64,32 +66,44 @@ class _CreateNewRoutinesDialogState extends State { mainAxisSize: MainAxisSize.min, children: [ const Divider(), - Padding( - padding: const EdgeInsets.only(left: 15, right: 15), - child: SpaceTreeDropdown( - selectedSpaceId: _selectedId, - onChanged: (String? newValue) { - setState(() => _selectedId = newValue!); - if (_selectedId != null) { - _bloc.add( - SpaceOnlyWithDevicesEvent(_selectedId!)); - } - }, - )), - const SizedBox(height: 5), - Padding( - padding: const EdgeInsets.only(left: 15, right: 15), - child: SpaceDropdown( - hintMessage: spaceHint, - spaces: spaces, - selectedValue: _selectedSpace, - onChanged: (String? newValue) { - setState(() { - _selectedSpace = newValue; - }); - }, - ), + const SizedBox(height: 20), + Column( + children: [ + Padding( + padding: + const EdgeInsets.only(left: 13, right: 8), + child: Column( + children: [ + SpaceTreeDropdown( + selectedSpaceId: _selectedId, + onChanged: (String? newValue) { + setState(() => _selectedId = newValue!); + if (_selectedId != null) { + _bloc.add(SpaceOnlyWithDevicesEvent( + _selectedId!)); + } + }, + ), + ], + )), + const SizedBox(height: 5), + const SizedBox(height: 8), + Padding( + padding: const EdgeInsets.only(left: 15, right: 15), + child: SpaceDropdown( + hintMessage: spaceHint, + spaces: spaces, + selectedValue: _selectedSpace, + onChanged: (String? newValue) { + setState(() { + _selectedSpace = newValue; + }); + }, + ), + ), + ], ), + const SizedBox(height: 20), const Divider(), Row( mainAxisAlignment: MainAxisAlignment.spaceAround, diff --git a/lib/pages/routines/create_new_routines/space_dropdown.dart b/lib/pages/routines/create_new_routines/space_dropdown.dart index a26ff9f4..1d11b02d 100644 --- a/lib/pages/routines/create_new_routines/space_dropdown.dart +++ b/lib/pages/routines/create_new_routines/space_dropdown.dart @@ -3,7 +3,6 @@ import 'package:flutter/material.dart'; import 'package:syncrow_web/pages/spaces_management/all_spaces/model/space_model.dart'; import 'package:syncrow_web/utils/color_manager.dart'; - class SpaceDropdown extends StatelessWidget { final List spaces; final String? selectedValue; @@ -21,7 +20,7 @@ class SpaceDropdown extends StatelessWidget { @override Widget build(BuildContext context) { return Padding( - padding: const EdgeInsets.all(10.0), + padding: const EdgeInsets.only(left: 10), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -33,7 +32,6 @@ class SpaceDropdown extends StatelessWidget { color: ColorsManager.blackColor, ), ), - const SizedBox(height: 8), SizedBox( child: Container( decoration: BoxDecoration( @@ -90,7 +88,7 @@ class SpaceDropdown extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Expanded( - flex: 5, + flex: 6, child: Padding( padding: const EdgeInsets.only(left: 10), child: Text(