refactor: update tag display to use a stretched column layout for better text wrapping

This commit is contained in:
pradeepkumar
2026-05-07 15:07:18 +05:30
parent 2760c14954
commit 8a859ff56c

View File

@@ -1857,19 +1857,22 @@ class _AgentEditProfileScreenState
} }
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
if (tags.isNotEmpty) if (tags.isNotEmpty)
Padding( Padding(
padding: const EdgeInsets.only(bottom: 8), padding: const EdgeInsets.only(bottom: 8),
child: Wrap( // Stretched column so each tag pill spans the available width.
spacing: 6, // Long text wraps inside the chip instead of overflowing.
runSpacing: 6, child: Column(
children: tags.map((tag) { crossAxisAlignment: CrossAxisAlignment.stretch,
return Container( children: [
for (int i = 0; i < tags.length; i++) ...[
if (i > 0) const SizedBox(height: 6),
Container(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 12, horizontal: 12,
vertical: 6, vertical: 8,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.accentOrange.withValues(alpha: 0.1), color: AppColors.accentOrange.withValues(alpha: 0.1),
@@ -1879,10 +1882,12 @@ class _AgentEditProfileScreenState
), ),
), ),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Expanded(
tag, child: Text(
tags[i],
softWrap: true,
style: const TextStyle( style: const TextStyle(
fontFamily: 'SourceSerif4', fontFamily: 'SourceSerif4',
fontSize: 13, fontSize: 13,
@@ -1890,22 +1895,28 @@ class _AgentEditProfileScreenState
color: AppColors.primaryDark, color: AppColors.primaryDark,
), ),
), ),
const SizedBox(width: 4), ),
const SizedBox(width: 8),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
final newList = List<String>.from(tags)..remove(tag); final newList = List<String>.from(tags)
..remove(tags[i]);
setValue(newList); setValue(newList);
}, },
child: const Icon( child: const Padding(
padding: EdgeInsets.only(top: 2),
child: Icon(
Icons.close, Icons.close,
size: 14, size: 16,
color: AppColors.hintText, color: AppColors.hintText,
), ),
), ),
),
], ],
), ),
); ),
}).toList(), ],
],
), ),
), ),
TextFormField( TextFormField(