fix: Fixed icons, timing, copy button
This commit is contained in:
@@ -107,7 +107,7 @@ class _FullScreenImageState extends State<FullScreenImage>
|
|||||||
ImageHeader(
|
ImageHeader(
|
||||||
userName: widget.userName,
|
userName: widget.userName,
|
||||||
sentAt:
|
sentAt:
|
||||||
'Sent at${Jiffy(widget.sentAt.toLocal()).format(' HH:mm')}',
|
'Sent ${getDay(widget.message.createdAt)} at ${Jiffy(widget.sentAt.toLocal()).format('HH:mm')}',
|
||||||
onBackPressed: () {
|
onBackPressed: () {
|
||||||
Navigator.of(context).pop();
|
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")}';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,7 +122,6 @@ class ImageActionsModal extends StatelessWidget {
|
|||||||
urls[currentIndex].split('?')[0]);
|
urls[currentIndex].split('?')[0]);
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
}),
|
}),
|
||||||
_buildButton(context, 'Copy', StreamIcons.copy, () {}),
|
|
||||||
if (StreamChat.of(context).user.id == message.user.id)
|
if (StreamChat.of(context).user.id == message.user.id)
|
||||||
_buildButton(context, 'Delete', StreamIcons.delete,
|
_buildButton(context, 'Delete', StreamIcons.delete,
|
||||||
() {
|
() {
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ class _ImageFooterState extends State<ImageFooter> {
|
|||||||
children: [
|
children: [
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
StreamIcons.share,
|
StreamIcons.share_1,
|
||||||
size: 24.0,
|
size: 24.0,
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user