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;
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,
child: GestureDetector(
onTap: _toggleDropdown,
@ -61,21 +78,23 @@ class _SpaceTreeDropdownState extends State<SpaceTreeDropdown> {
border: Border.all(color: Colors.grey.shade300),
borderRadius: BorderRadius.circular(12),
),
margin: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
margin: const EdgeInsets.symmetric(
horizontal: 10,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Text(
selectedCommunity?.name ?? 'Select a space',
selectedCommunity?.name ?? 'Please Select',
style: TextStyle(
color: selectedCommunity != null
? Colors.black
: Colors.grey,
? ColorsManager.blackColor
: ColorsManager.textGray,
overflow: TextOverflow.ellipsis,
fontWeight: FontWeight.w400,
fontSize: 15,
fontSize: 13,
),
),
),
@ -88,7 +107,7 @@ class _SpaceTreeDropdownState extends State<SpaceTreeDropdown> {
),
),
height: 45,
width: 35,
width: 33,
child: const Icon(
Icons.keyboard_arrow_down,
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 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<CreateNewRoutinesDialog> {
'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,19 +66,28 @@ class _CreateNewRoutinesDialogState extends State<CreateNewRoutinesDialog> {
mainAxisSize: MainAxisSize.min,
children: [
const Divider(),
const SizedBox(height: 20),
Column(
children: [
Padding(
padding: const EdgeInsets.only(left: 15, right: 15),
child: SpaceTreeDropdown(
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!));
_bloc.add(SpaceOnlyWithDevicesEvent(
_selectedId!));
}
},
),
],
)),
const SizedBox(height: 5),
const SizedBox(height: 8),
Padding(
padding: const EdgeInsets.only(left: 15, right: 15),
child: SpaceDropdown(
@ -90,6 +101,9 @@ class _CreateNewRoutinesDialogState extends State<CreateNewRoutinesDialog> {
},
),
),
],
),
const SizedBox(height: 20),
const Divider(),
Row(
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/utils/color_manager.dart';
class SpaceDropdown extends StatelessWidget {
final List<SpaceModel> 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(