fix: Fixed icons, timing, copy button

This commit is contained in:
Deven Joshi
2020-11-20 17:17:52 +05:30
parent 68e9f98b7f
commit 3c7b10173d
3 changed files with 14 additions and 3 deletions
+13 -1
View File
@@ -107,7 +107,7 @@ class _FullScreenImageState extends State<FullScreenImage>
ImageHeader(
userName: widget.userName,
sentAt:
'Sent at${Jiffy(widget.sentAt.toLocal()).format(' HH:mm')}',
'Sent ${getDay(widget.message.createdAt)} at ${Jiffy(widget.sentAt.toLocal()).format('HH:mm')}',
onBackPressed: () {
Navigator.of(context).pop();
},
@@ -128,4 +128,16 @@ class _FullScreenImageState extends State<FullScreenImage>
),
);
}
String getDay(DateTime dateTime) {
var now = DateTime.now();
if(DateTime(dateTime.year, dateTime.month, dateTime.day) == DateTime(now.year, now.month, now.day)) {
return 'today';
} else if(DateTime(now.year, now.month, now.day).difference(dateTime).inHours < 24) {
return 'yesterday';
} else {
return 'on ${Jiffy(dateTime).format("MMM do")}';
}
}
}
-1
View File
@@ -122,7 +122,6 @@ class ImageActionsModal extends StatelessWidget {
urls[currentIndex].split('?')[0]);
Navigator.pop(context);
}),
_buildButton(context, 'Copy', StreamIcons.copy, () {}),
if (StreamChat.of(context).user.id == message.user.id)
_buildButton(context, 'Delete', StreamIcons.delete,
() {
+1 -1
View File
@@ -86,7 +86,7 @@ class _ImageFooterState extends State<ImageFooter> {
children: [
IconButton(
icon: Icon(
StreamIcons.share,
StreamIcons.share_1,
size: 24.0,
color: Colors.black,
),