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