feat: Improve comment action buttons layout and spacing in ContactDetailScreen
This commit is contained in:
parent
38ae9e3571
commit
dbd4a42b7a
@ -430,17 +430,15 @@ class _ContactDetailScreenState extends State<ContactDetailScreen> {
|
||||
|
||||
return AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
padding: MySpacing.xy(8, 7),
|
||||
padding: MySpacing.xy(12, 12),
|
||||
decoration: BoxDecoration(
|
||||
color: isEditing ? Colors.indigo[50] : Colors.white,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
border: Border.all(
|
||||
color: isEditing ? Colors.indigo : Colors.grey.shade300,
|
||||
width: 1.2,
|
||||
),
|
||||
boxShadow: const [
|
||||
BoxShadow(color: Colors.black12, blurRadius: 4, offset: Offset(0, 2))
|
||||
],
|
||||
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@ -468,10 +466,16 @@ class _ContactDetailScreenState extends State<ContactDetailScreen> {
|
||||
),
|
||||
),
|
||||
// Action buttons
|
||||
// Action buttons (reduced spacing between delete & edit)
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
// 🔹 Restore button for inactive comments
|
||||
if (!comment.isActive)
|
||||
IconButton(
|
||||
visualDensity: VisualDensity.compact,
|
||||
padding: EdgeInsets.zero,
|
||||
constraints: const BoxConstraints(),
|
||||
icon: const Icon(Icons.restore,
|
||||
color: Colors.green, size: 20),
|
||||
tooltip: "Restore",
|
||||
@ -492,11 +496,19 @@ class _ContactDetailScreenState extends State<ContactDetailScreen> {
|
||||
barrierDismissible: false,
|
||||
);
|
||||
},
|
||||
)
|
||||
else
|
||||
),
|
||||
|
||||
// 🔹 Delete + Edit icons for active comments (tightened spacing)
|
||||
if (comment.isActive)
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
IconButton(
|
||||
icon:
|
||||
const Icon(Icons.delete, color: Colors.red, size: 20),
|
||||
visualDensity: VisualDensity.compact,
|
||||
padding: EdgeInsets.zero,
|
||||
constraints: const BoxConstraints(),
|
||||
icon: const Icon(Icons.delete,
|
||||
color: Colors.red, size: 20),
|
||||
tooltip: "Delete",
|
||||
onPressed: () async {
|
||||
await Get.dialog(
|
||||
@ -516,12 +528,19 @@ class _ContactDetailScreenState extends State<ContactDetailScreen> {
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
width:
|
||||
4), // 👈 reduce icon gap here (was ~12 by default)
|
||||
IconButton(
|
||||
visualDensity: VisualDensity.compact,
|
||||
padding: EdgeInsets.zero,
|
||||
constraints: const BoxConstraints(),
|
||||
icon: Icon(
|
||||
isEditing ? Icons.close : Icons.edit,
|
||||
size: 20,
|
||||
color: Colors.indigo,
|
||||
),
|
||||
tooltip: isEditing ? "Cancel Edit" : "Edit",
|
||||
onPressed: () {
|
||||
directoryController.editingCommentId.value =
|
||||
isEditing ? null : comment.id;
|
||||
@ -531,6 +550,8 @@ class _ContactDetailScreenState extends State<ContactDetailScreen> {
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
if (isEditing && quillController != null)
|
||||
CommentEditorCard(
|
||||
controller: quillController,
|
||||
|
Loading…
x
Reference in New Issue
Block a user