diff --git a/lib/model/expense/add_expense_bottom_sheet.dart b/lib/model/expense/add_expense_bottom_sheet.dart index 6723c44..2d71f5b 100644 --- a/lib/model/expense/add_expense_bottom_sheet.dart +++ b/lib/model/expense/add_expense_bottom_sheet.dart @@ -446,7 +446,7 @@ class _TileContainer extends StatelessWidget { } class _AttachmentsSection extends StatelessWidget { - final List attachments; + final RxList attachments; final ValueChanged onRemove; final VoidCallback onAdd; @@ -458,27 +458,29 @@ class _AttachmentsSection extends StatelessWidget { @override Widget build(BuildContext context) { - return Wrap( - spacing: 8, - runSpacing: 8, - children: [ - ...attachments.map((file) => - _AttachmentTile(file: file, onRemove: () => onRemove(file))), - GestureDetector( - onTap: onAdd, - child: Container( - width: 80, - height: 80, - decoration: BoxDecoration( - border: Border.all(color: Colors.grey.shade400), - borderRadius: BorderRadius.circular(8), - color: Colors.grey.shade100, + return Obx(() => Wrap( + spacing: 8, + runSpacing: 8, + children: [ + ...attachments.map((file) => _AttachmentTile( + file: file, + onRemove: () => onRemove(file), + )), + GestureDetector( + onTap: onAdd, + child: Container( + width: 80, + height: 80, + decoration: BoxDecoration( + border: Border.all(color: Colors.grey.shade400), + borderRadius: BorderRadius.circular(8), + color: Colors.grey.shade100, + ), + child: const Icon(Icons.add, size: 30, color: Colors.grey), + ), ), - child: const Icon(Icons.add, size: 30, color: Colors.grey), - ), - ), - ], - ); + ], + )); } }