attachmentHeader method

dynamic attachmentHeader(
  1. dynamic context,
  2. dynamic ref
)

Implementation

Widget attachmentHeader(BuildContext context, WidgetRef ref) {
  final attachmentTitleTextStyle = Theme.of(context).textTheme.labelLarge;
  return Row(
    children: [
      const Icon(Atlas.paperclip_attachment_thin, size: 14),
      const SizedBox(width: 5),
      Text(
        L10n.of(context).attachments,
        style: attachmentTitleTextStyle,
      ),
      const Spacer(),
      ActerInlineTextButton(
        onPressed: () => selectAttachment(
          context: context,
          onLinkSelected: (title, link) {
            Navigator.pop(context);
            return handleAttachmentSelected(
              context: context,
              ref: ref,
              manager: attachmentManager,
              title: title,
              link: link,
              attachmentType: AttachmentType.link,
              attachments: [],
            );
          },
          onSelected: (files, selectedType) {
            return handleAttachmentSelected(
              context: context,
              ref: ref,
              manager: attachmentManager,
              attachments: files,
              attachmentType: selectedType,
            );
          },
        ),
        child: Text(L10n.of(context).add),
      ),
    ],
  );
}