extract on tap
This commit is contained in:
@@ -68,27 +68,7 @@ class GiphyAttachment extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
var res = await Navigator.push(context,
|
_onImageTap(context);
|
||||||
MaterialPageRoute(builder: (_) {
|
|
||||||
final channel = StreamChannel.of(context).channel;
|
|
||||||
|
|
||||||
return StreamChannel(
|
|
||||||
channel: channel,
|
|
||||||
child: FullScreenMedia(
|
|
||||||
mediaAttachments: [
|
|
||||||
attachment,
|
|
||||||
],
|
|
||||||
userName: message.user.name,
|
|
||||||
sentAt: message.createdAt,
|
|
||||||
message: message,
|
|
||||||
onShowMessage: onShowMessage,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}));
|
|
||||||
|
|
||||||
if (res != null) {
|
|
||||||
onReturnAction(res);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
@@ -324,6 +304,31 @@ class GiphyAttachment extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _onImageTap(BuildContext context) async {
|
||||||
|
var res = await Navigator.push(context, MaterialPageRoute(
|
||||||
|
builder: (_) {
|
||||||
|
final channel = StreamChannel.of(context).channel;
|
||||||
|
|
||||||
|
return StreamChannel(
|
||||||
|
channel: channel,
|
||||||
|
child: FullScreenMedia(
|
||||||
|
mediaAttachments: [
|
||||||
|
attachment,
|
||||||
|
],
|
||||||
|
userName: message.user.name,
|
||||||
|
sentAt: message.createdAt,
|
||||||
|
message: message,
|
||||||
|
onShowMessage: onShowMessage,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
));
|
||||||
|
|
||||||
|
if (res != null) {
|
||||||
|
onReturnAction(res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Widget _buildSentAttachment(context) {
|
Widget _buildSentAttachment(context) {
|
||||||
return Container(
|
return Container(
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
|
|||||||
Reference in New Issue
Block a user