This commit is contained in:
Deven Joshi
2020-11-23 16:44:44 +05:30
parent 6424a0c9e5
commit d9507214d7
5 changed files with 135 additions and 116 deletions
+6 -2
View File
@@ -132,9 +132,13 @@ 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)) {
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) {
} else if (DateTime(now.year, now.month, now.day)
.difference(dateTime)
.inHours <
24) {
return 'yesterday';
} else {
return 'on ${Jiffy(dateTime).format("MMM do")}';
+8 -4
View File
@@ -64,9 +64,11 @@ class GiphyAttachment extends StatelessWidget {
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (_) {
return FullScreenImage(
urls: [attachment.imageUrl ??
urls: [
attachment.imageUrl ??
attachment.assetUrl ??
attachment.thumbUrl],
attachment.thumbUrl
],
userName: message.user.name,
sentAt: message.createdAt,
message: message,
@@ -285,9 +287,11 @@ class GiphyAttachment extends StatelessWidget {
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (_) {
return FullScreenImage(
urls: [attachment.imageUrl ??
urls: [
attachment.imageUrl ??
attachment.assetUrl ??
attachment.thumbUrl],
attachment.thumbUrl
],
userName: message.user.name,
sentAt: message.createdAt,
message: message,
+4 -2
View File
@@ -48,9 +48,11 @@ class ImageAttachment extends StatelessWidget {
return StreamChannel(
channel: channel,
child: FullScreenImage(
urls: [attachment.imageUrl ??
urls: [
attachment.imageUrl ??
attachment.assetUrl ??
attachment.thumbUrl],
attachment.thumbUrl
],
userName: message.user.name,
sentAt: message.createdAt,
message: message,
+13 -6
View File
@@ -378,8 +378,9 @@ class _ImageFooterState extends State<ImageFooter> {
child: Material(
child: InkWell(
onTap: () async {
await GallerySaver.saveImage(
widget.urls[widget.currentPage].split('?')[0]);
await GallerySaver.saveImage(widget
.urls[widget.currentPage]
.split('?')[0]);
Navigator.pop(context);
},
child: SizedBox.expand(
@@ -434,7 +435,8 @@ class _ImageFooterState extends State<ImageFooter> {
autofocus: true,
decoration: InputDecoration(
isDense: true,
prefixIconConstraints: BoxConstraints.tight(Size(38.0, 38.0)),
prefixIconConstraints:
BoxConstraints.tight(Size(38.0, 38.0)),
prefixIcon: Transform.scale(
scale: 1.2,
alignment: Alignment.center,
@@ -462,7 +464,10 @@ class _ImageFooterState extends State<ImageFooter> {
width: 8.0,
),
IconButton(
icon: Icon(StreamIcons.close_circle, color: Colors.black.withOpacity(0.5),),
icon: Icon(
StreamIcons.close_circle,
color: Colors.black.withOpacity(0.5),
),
onPressed: () {
modalSetState(() {
_userSearchMode = false;
@@ -533,12 +538,14 @@ class _ImageFooterState extends State<ImageFooter> {
child: Container(
color: Colors.white,
height: 56.0,
child: _loading ? Center(
child: _loading
? Center(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: CircularProgressIndicator(),
),
) : Row(
)
: Row(
children: [
Expanded(
child: Padding(
+5 -3
View File
@@ -113,10 +113,12 @@ class ImageGroup extends StatelessWidget {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
StreamChannel(
builder: (context) => StreamChannel(
channel: channel,
child: FullScreenImage(urls: images.map((e) => e.imageUrl ?? e.thumbUrl ?? e.assetUrl).toList(),
child: FullScreenImage(
urls: images
.map((e) => e.imageUrl ?? e.thumbUrl ?? e.assetUrl)
.toList(),
startIndex: index,
userName: message.user.name,
sentAt: message.createdAt,