change spaceHint and size

This commit is contained in:
mohammad
2025-06-10 11:41:42 +03:00
parent 662fe211eb
commit ed06a760d2
3 changed files with 107 additions and 74 deletions

View File

@ -51,7 +51,24 @@ class _SpaceTreeDropdownState extends State<SpaceTreeDropdown> {
: state.communityList; : state.communityList;
final selectedCommunity = _findCommunity(communities, _selectedSpaceId); final selectedCommunity = _findCommunity(communities, _selectedSpaceId);
return CompositedTransformTarget( return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10,
),
child: Text(
"Community",
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontWeight: FontWeight.w400,
fontSize: 13,
color: ColorsManager.blackColor,
),
),
),
CompositedTransformTarget(
link: _layerLink, link: _layerLink,
child: GestureDetector( child: GestureDetector(
onTap: _toggleDropdown, onTap: _toggleDropdown,
@ -61,21 +78,23 @@ class _SpaceTreeDropdownState extends State<SpaceTreeDropdown> {
border: Border.all(color: Colors.grey.shade300), border: Border.all(color: Colors.grey.shade300),
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
), ),
margin: const EdgeInsets.symmetric(horizontal: 10, vertical: 8), margin: const EdgeInsets.symmetric(
horizontal: 10,
),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 12), padding: const EdgeInsets.symmetric(horizontal: 10),
child: Text( child: Text(
selectedCommunity?.name ?? 'Select a space', selectedCommunity?.name ?? 'Please Select',
style: TextStyle( style: TextStyle(
color: selectedCommunity != null color: selectedCommunity != null
? Colors.black ? ColorsManager.blackColor
: Colors.grey, : ColorsManager.textGray,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontSize: 15, fontSize: 13,
), ),
), ),
), ),
@ -88,7 +107,7 @@ class _SpaceTreeDropdownState extends State<SpaceTreeDropdown> {
), ),
), ),
height: 45, height: 45,
width: 35, width: 33,
child: const Icon( child: const Icon(
Icons.keyboard_arrow_down, Icons.keyboard_arrow_down,
color: ColorsManager.textGray, color: ColorsManager.textGray,
@ -98,6 +117,8 @@ class _SpaceTreeDropdownState extends State<SpaceTreeDropdown> {
), ),
), ),
), ),
),
],
); );
}, },
); );

View File

@ -31,7 +31,7 @@ class _CreateNewRoutinesDialogState extends State<CreateNewRoutinesDialog> {
final spaces = _bloc.spacesOnlyWithDevices; final spaces = _bloc.spacesOnlyWithDevices;
final isLoadingCommunities = state is CommunitiesLoadingState; final isLoadingCommunities = state is CommunitiesLoadingState;
final isLoadingSpaces = state is SpaceWithDeviceLoadingState; final isLoadingSpaces = state is SpaceWithDeviceLoadingState;
String spaceHint = 'Select a community first'; String spaceHint = 'Please Select';
if (_selectedCommunity != null) { if (_selectedCommunity != null) {
if (isLoadingSpaces) { if (isLoadingSpaces) {
spaceHint = 'Loading spaces...'; spaceHint = 'Loading spaces...';
@ -55,7 +55,9 @@ class _CreateNewRoutinesDialogState extends State<CreateNewRoutinesDialog> {
'Create New Routines', 'Create New Routines',
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodyMedium!.copyWith( style: Theme.of(context).textTheme.bodyMedium!.copyWith(
color: ColorsManager.primaryColor, color: ColorsManager.spaceColor,
fontSize: 20,
fontWeight: FontWeight.w700,
), ),
), ),
content: Stack( content: Stack(
@ -64,19 +66,28 @@ class _CreateNewRoutinesDialogState extends State<CreateNewRoutinesDialog> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const Divider(), const Divider(),
const SizedBox(height: 20),
Column(
children: [
Padding( Padding(
padding: const EdgeInsets.only(left: 15, right: 15), padding:
child: SpaceTreeDropdown( const EdgeInsets.only(left: 13, right: 8),
child: Column(
children: [
SpaceTreeDropdown(
selectedSpaceId: _selectedId, selectedSpaceId: _selectedId,
onChanged: (String? newValue) { onChanged: (String? newValue) {
setState(() => _selectedId = newValue!); setState(() => _selectedId = newValue!);
if (_selectedId != null) { if (_selectedId != null) {
_bloc.add( _bloc.add(SpaceOnlyWithDevicesEvent(
SpaceOnlyWithDevicesEvent(_selectedId!)); _selectedId!));
} }
}, },
),
],
)), )),
const SizedBox(height: 5), const SizedBox(height: 5),
const SizedBox(height: 8),
Padding( Padding(
padding: const EdgeInsets.only(left: 15, right: 15), padding: const EdgeInsets.only(left: 15, right: 15),
child: SpaceDropdown( child: SpaceDropdown(
@ -90,6 +101,9 @@ class _CreateNewRoutinesDialogState extends State<CreateNewRoutinesDialog> {
}, },
), ),
), ),
],
),
const SizedBox(height: 20),
const Divider(), const Divider(),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,

View File

@ -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/pages/spaces_management/all_spaces/model/space_model.dart';
import 'package:syncrow_web/utils/color_manager.dart'; import 'package:syncrow_web/utils/color_manager.dart';
class SpaceDropdown extends StatelessWidget { class SpaceDropdown extends StatelessWidget {
final List<SpaceModel> spaces; final List<SpaceModel> spaces;
final String? selectedValue; final String? selectedValue;
@ -21,7 +20,7 @@ class SpaceDropdown extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.only(left: 10),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -33,7 +32,6 @@ class SpaceDropdown extends StatelessWidget {
color: ColorsManager.blackColor, color: ColorsManager.blackColor,
), ),
), ),
const SizedBox(height: 8),
SizedBox( SizedBox(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -90,7 +88,7 @@ class SpaceDropdown extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded( Expanded(
flex: 5, flex: 6,
child: Padding( child: Padding(
padding: const EdgeInsets.only(left: 10), padding: const EdgeInsets.only(left: 10),
child: Text( child: Text(