✨ Moment editor
This commit is contained in:
@ -20,70 +20,68 @@ class FeedItem extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.grey[50],
|
||||
child: ListTile(
|
||||
title: Text(item.author.name),
|
||||
leading: CircleAvatar(
|
||||
backgroundImage: NetworkImage(item.author.avatar),
|
||||
),
|
||||
subtitle: Text(
|
||||
getDescription(item.author.description),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
softWrap: false,
|
||||
),
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.grey[50],
|
||||
child: ListTile(
|
||||
title: Text(item.author.name),
|
||||
leading: CircleAvatar(
|
||||
backgroundImage: NetworkImage(item.author.avatar),
|
||||
),
|
||||
subtitle: Text(
|
||||
getDescription(item.author.description),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
softWrap: false,
|
||||
),
|
||||
),
|
||||
Markdown(
|
||||
data: item.content,
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
),
|
||||
hasAttachments()
|
||||
? Container(
|
||||
decoration: const BoxDecoration(
|
||||
border: Border(
|
||||
top: BorderSide(width: 0.3, color: Color(0xffdedede))),
|
||||
),
|
||||
Markdown(
|
||||
data: item.content,
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
),
|
||||
hasAttachments()
|
||||
? Container(
|
||||
decoration: const BoxDecoration(
|
||||
border: Border(
|
||||
top: BorderSide(width: 0.3, color: Color(0xffdedede))),
|
||||
),
|
||||
child: FlutterCarousel(
|
||||
options: CarouselOptions(
|
||||
height: 240.0,
|
||||
showIndicator: true,
|
||||
slideIndicator: const CircularSlideIndicator(),
|
||||
),
|
||||
child: FlutterCarousel(
|
||||
options: CarouselOptions(
|
||||
height: 240.0,
|
||||
showIndicator: true,
|
||||
slideIndicator: const CircularSlideIndicator(),
|
||||
),
|
||||
items: item.attachments?.map((x) {
|
||||
return Builder(
|
||||
builder: (BuildContext context) {
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
margin: const EdgeInsets.symmetric(horizontal: 5.0),
|
||||
child: InkWell(
|
||||
child: Image.network(
|
||||
getFileUrl(x.fileId),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.push(context,
|
||||
MaterialPageRoute(builder: (_) {
|
||||
return ImageLightbox(
|
||||
url: getFileUrl(x.fileId),
|
||||
);
|
||||
}));
|
||||
},
|
||||
items: item.attachments?.map((x) {
|
||||
return Builder(
|
||||
builder: (BuildContext context) {
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
margin: const EdgeInsets.symmetric(horizontal: 5.0),
|
||||
child: InkWell(
|
||||
child: Image.network(
|
||||
getFileUrl(x.fileId),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
)
|
||||
: Container(),
|
||||
],
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.push(context,
|
||||
MaterialPageRoute(builder: (_) {
|
||||
return ImageLightbox(
|
||||
url: getFileUrl(x.fileId),
|
||||
);
|
||||
}));
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
)
|
||||
: Container(),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user