fix: attachment builder (#326)

* feat: Changed attachment builder structure

* fix: fixed image attachments

* feat: Added onTaps to remaining attachments

* fix: merged fixes

* add trailing comma

Co-authored-by: Salvatore Giordano <[email protected]>
This commit is contained in:
Deven Joshi
2021-03-11 11:38:00 +01:00
committed by GitHub
co-authored by Salvatore Giordano
parent 1ed11a753f
commit 4b6f1f54b6
4 changed files with 220 additions and 146 deletions
@@ -15,6 +15,7 @@ class GiphyAttachment extends AttachmentWidget {
final MessageTheme messageTheme;
final ShowMessageCallback onShowMessage;
final ValueChanged<ReturnActionType> onReturnAction;
final VoidCallback onAttachmentTap;
const GiphyAttachment({
Key key,
@@ -24,6 +25,7 @@ class GiphyAttachment extends AttachmentWidget {
this.messageTheme,
this.onShowMessage,
this.onReturnAction,
this.onAttachmentTap,
}) : super(key: key, message: message, attachment: attachment, size: size);
@override
@@ -65,7 +67,7 @@ class GiphyAttachment extends AttachmentWidget {
Padding(
padding: const EdgeInsets.all(8.0),
child: GestureDetector(
onTap: () => _onImageTap(context),
onTap: () => onAttachmentTap ?? _onImageTap(context),
child: ClipRRect(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),