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:
Faris Armoush
2025-07-03 16:15:31 +03:00
parent b857736e10
commit 757a96ed9f
2 changed files with 48 additions and 51 deletions

View File

@ -16,6 +16,7 @@ class SpaceDetailsActionButtons extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
spacing: 10,
children: [

View File

@ -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,
),
),
),
],
),
],
),
],
),
);
}
}