mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 14:47:23 +00:00
Refactor SpaceDetailsActionButtons and SpaceIconPicker: Adjust layout properties for improved responsiveness and user experience. Set mainAxisSize to min in SpaceDetailsActionButtons and simplify the layout in SpaceIconPicker for better alignment and interaction. This enhances maintainability and adheres to Clean Architecture principles.
This commit is contained in:
@ -16,6 +16,7 @@ class SpaceDetailsActionButtons extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
spacing: 10,
|
||||
children: [
|
||||
|
@ -17,64 +17,60 @@ class SpaceIconPicker extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(height: 50),
|
||||
Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: context.screenWidth * 0.1,
|
||||
height: context.screenWidth * 0.1,
|
||||
decoration: const BoxDecoration(
|
||||
color: ColorsManager.boxColor,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
return Center(
|
||||
child: Stack(
|
||||
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: context.screenWidth * 0.175,
|
||||
height: context.screenHeight * 0.175,
|
||||
decoration: const BoxDecoration(
|
||||
color: ColorsManager.boxColor,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
SvgPicture.asset(
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: SvgPicture.asset(
|
||||
iconPath,
|
||||
width: context.screenWidth * 0.04,
|
||||
height: context.screenWidth * 0.04,
|
||||
width: context.screenWidth * 0.08,
|
||||
height: context.screenHeight * 0.08,
|
||||
),
|
||||
Positioned(
|
||||
top: 20,
|
||||
right: 20,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
showDialog<String?>(
|
||||
context: context,
|
||||
builder: (context) => SpaceIconSelectionDialog(
|
||||
selectedIcon: iconPath,
|
||||
),
|
||||
).then((value) {
|
||||
if (value != null) {
|
||||
if (context.mounted) {
|
||||
context.read<SpaceDetailsModelBloc>().add(
|
||||
UpdateSpaceDetailsIcon(value),
|
||||
);
|
||||
}
|
||||
),
|
||||
Positioned.directional(
|
||||
top: 12,
|
||||
start: context.screenHeight * 0.06,
|
||||
textDirection: Directionality.of(context),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
showDialog<String?>(
|
||||
context: context,
|
||||
builder: (context) => SpaceIconSelectionDialog(
|
||||
selectedIcon: iconPath,
|
||||
),
|
||||
).then((value) {
|
||||
if (value != null) {
|
||||
if (context.mounted) {
|
||||
context.read<SpaceDetailsModelBloc>().add(
|
||||
UpdateSpaceDetailsIcon(value),
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
width: 24,
|
||||
height: 24,
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.white,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: SvgPicture.asset(
|
||||
Assets.iconEdit,
|
||||
width: 16,
|
||||
height: 16,
|
||||
),
|
||||
}
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: SvgPicture.asset(
|
||||
Assets.iconEdit,
|
||||
width: 16,
|
||||
height: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user