fmt: dartfmt
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stream_chat_flutter/src/lazy_load_scroll_view.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
@@ -102,9 +101,7 @@ class _ChannelFileDisplayScreenState extends State<ChannelFileDisplayScreen> {
|
||||
Map<Attachment, Message> media = {};
|
||||
|
||||
for (var item in snapshot.data) {
|
||||
item.message.attachments
|
||||
.where((e) => e.type == 'file')
|
||||
.forEach((e) {
|
||||
item.message.attachments.where((e) => e.type == 'file').forEach((e) {
|
||||
media[e] = item.message;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -103,8 +103,8 @@ class _ChannelMediaDisplayScreenState extends State<ChannelMediaDisplayScreen> {
|
||||
item.message.attachments
|
||||
.where((e) => e.type == 'image' || e.type == 'video')
|
||||
.forEach((e) {
|
||||
VideoPlayerController controller;
|
||||
if(e.type == 'video') {
|
||||
VideoPlayerController controller;
|
||||
if (e.type == 'video') {
|
||||
controller = VideoPlayerController.network(e.assetUrl);
|
||||
controller.initialize();
|
||||
}
|
||||
@@ -156,10 +156,12 @@ class _ChannelMediaDisplayScreenState extends State<ChannelMediaDisplayScreen> {
|
||||
),
|
||||
);
|
||||
},
|
||||
child: media[position].attachment.type == 'image' ? CachedNetworkImage(
|
||||
imageUrl: media[position].attachment.imageUrl,
|
||||
fit: BoxFit.cover,
|
||||
) : VideoPlayer(media[position].videoPlayer),
|
||||
child: media[position].attachment.type == 'image'
|
||||
? CachedNetworkImage(
|
||||
imageUrl: media[position].attachment.imageUrl,
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
: VideoPlayer(media[position].videoPlayer),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user