feat: Added message reply

This commit is contained in:
Deven Joshi
2021-01-20 16:21:03 +05:30
parent ded8b37e61
commit d48ccf15df
8 changed files with 84 additions and 26 deletions
@@ -13,6 +13,7 @@ class GiphyAttachment extends StatelessWidget {
final Message message;
final Size size;
final ShowMessageCallback onShowMessage;
final ValueChanged<ReturnActionType> onReturnAction;
const GiphyAttachment({
Key key,
@@ -21,6 +22,7 @@ class GiphyAttachment extends StatelessWidget {
this.message,
this.size,
this.onShowMessage,
this.onReturnAction,
}) : super(key: key);
@override
@@ -65,8 +67,9 @@ class GiphyAttachment extends StatelessWidget {
Padding(
padding: const EdgeInsets.all(8.0),
child: GestureDetector(
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (_) {
onTap: () async {
var res = await Navigator.push(context,
MaterialPageRoute(builder: (_) {
final channel = StreamChannel.of(context).channel;
return StreamChannel(
@@ -82,6 +85,10 @@ class GiphyAttachment extends StatelessWidget {
),
);
}));
if (res != null) {
onReturnAction(res);
}
},
child: ClipRRect(
borderRadius: BorderRadius.only(
@@ -320,8 +327,9 @@ class GiphyAttachment extends StatelessWidget {
Widget _buildSentAttachment(context) {
return Container(
child: GestureDetector(
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (_) {
onTap: () async {
var res =
await Navigator.push(context, MaterialPageRoute(builder: (_) {
var channel = StreamChannel.of(context).channel;
return StreamChannel(
@@ -337,6 +345,10 @@ class GiphyAttachment extends StatelessWidget {
),
);
}));
if (res != null) {
onReturnAction(res);
}
},
child: Stack(
children: [