feat: Update AttachmentsSection to use RxList for reactive attachment management
This commit is contained in:
parent
d0cbfa987d
commit
5f66c4c647
@ -446,7 +446,7 @@ class _TileContainer extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _AttachmentsSection extends StatelessWidget {
|
class _AttachmentsSection extends StatelessWidget {
|
||||||
final List<File> attachments;
|
final RxList<File> attachments;
|
||||||
final ValueChanged<File> onRemove;
|
final ValueChanged<File> onRemove;
|
||||||
final VoidCallback onAdd;
|
final VoidCallback onAdd;
|
||||||
|
|
||||||
@ -458,12 +458,14 @@ class _AttachmentsSection extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Wrap(
|
return Obx(() => Wrap(
|
||||||
spacing: 8,
|
spacing: 8,
|
||||||
runSpacing: 8,
|
runSpacing: 8,
|
||||||
children: [
|
children: [
|
||||||
...attachments.map((file) =>
|
...attachments.map((file) => _AttachmentTile(
|
||||||
_AttachmentTile(file: file, onRemove: () => onRemove(file))),
|
file: file,
|
||||||
|
onRemove: () => onRemove(file),
|
||||||
|
)),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: onAdd,
|
onTap: onAdd,
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -478,7 +480,7 @@ class _AttachmentsSection extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user