fmt
This commit is contained in:
@@ -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")}';
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user