mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
change spaceHint and size
This commit is contained in:
@ -51,53 +51,74 @@ class _SpaceTreeDropdownState extends State<SpaceTreeDropdown> {
|
||||
: 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,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
|
@ -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,32 +66,44 @@ class _CreateNewRoutinesDialogState extends State<CreateNewRoutinesDialog> {
|
||||
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,
|
||||
|
@ -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(
|
||||
|
Reference in New Issue
Block a user