⏪ Rollback to old style attachment list
This commit is contained in:
parent
19076f8136
commit
bb7b731602
@ -108,7 +108,7 @@ class _AttachmentListState extends State<AttachmentList> {
|
|||||||
if (widget.gridded) {
|
if (widget.gridded) {
|
||||||
final fullOfImage =
|
final fullOfImage =
|
||||||
widget.data.where((ele) => ele?.mediaType == SnMediaType.image).length == widget.data.length;
|
widget.data.where((ele) => ele?.mediaType == SnMediaType.image).length == widget.data.length;
|
||||||
if(!fullOfImage) {
|
if (!fullOfImage) {
|
||||||
return Container(
|
return Container(
|
||||||
margin: widget.padding ?? EdgeInsets.zero,
|
margin: widget.padding ?? EdgeInsets.zero,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@ -191,8 +191,10 @@ class _AttachmentListState extends State<AttachmentList> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Container(
|
return AspectRatio(
|
||||||
constraints: BoxConstraints(maxHeight: constraints.maxHeight),
|
aspectRatio: widget.data.isNotEmpty ? widget.data.first?.data['ratio']?.toDouble() ?? 1 : 1,
|
||||||
|
child: Container(
|
||||||
|
constraints: constraints,
|
||||||
child: ScrollConfiguration(
|
child: ScrollConfiguration(
|
||||||
behavior: _AttachmentListScrollBehavior(),
|
behavior: _AttachmentListScrollBehavior(),
|
||||||
child: ListView.separated(
|
child: ListView.separated(
|
||||||
@ -209,7 +211,8 @@ class _AttachmentListState extends State<AttachmentList> {
|
|||||||
if (widget.data[idx]?.mediaType != SnMediaType.image) return;
|
if (widget.data[idx]?.mediaType != SnMediaType.image) return;
|
||||||
context.pushTransparentRoute(
|
context.pushTransparentRoute(
|
||||||
AttachmentZoomView(
|
AttachmentZoomView(
|
||||||
data: widget.data.where((ele) => ele != null && ele.mediaType == SnMediaType.image).cast(),
|
data:
|
||||||
|
widget.data.where((ele) => ele != null && ele.mediaType == SnMediaType.image).cast(),
|
||||||
initialIndex: idx,
|
initialIndex: idx,
|
||||||
heroTags: heroTags,
|
heroTags: heroTags,
|
||||||
),
|
),
|
||||||
@ -255,6 +258,7 @@ class _AttachmentListState extends State<AttachmentList> {
|
|||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -415,6 +415,7 @@ class _AttachmentZoomDetailPopup extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
).padding(horizontal: 20, top: 16, bottom: 12),
|
).padding(horizontal: 20, top: 16, bottom: 12),
|
||||||
Expanded(
|
Expanded(
|
||||||
|
child: SingleChildScrollView(
|
||||||
child: Table(
|
child: Table(
|
||||||
columnWidths: {
|
columnWidths: {
|
||||||
0: IntrinsicColumnWidth(),
|
0: IntrinsicColumnWidth(),
|
||||||
@ -487,6 +488,7 @@ class _AttachmentZoomDetailPopup extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
).padding(horizontal: 20, vertical: 8),
|
).padding(horizontal: 20, vertical: 8),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -94,11 +94,14 @@ class _LinkPreviewEntry extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
if (meta.icon?.isNotEmpty ?? false)
|
if (meta.icon?.isNotEmpty ?? false)
|
||||||
StyledWidget(
|
SizedBox(
|
||||||
meta.icon!.endsWith('.svg')
|
width: 36,
|
||||||
? SvgPicture.network(meta.icon!)
|
height: 36,
|
||||||
|
child: meta.icon!.endsWith('.svg')
|
||||||
|
? SvgPicture.network(meta.icon!, width: 36, height: 36)
|
||||||
: UniversalImage(
|
: UniversalImage(
|
||||||
meta.icon!,
|
meta.icon!,
|
||||||
|
noErrorWidget: true,
|
||||||
width: 36,
|
width: 36,
|
||||||
height: 36,
|
height: 36,
|
||||||
cacheHeight: 36,
|
cacheHeight: 36,
|
||||||
|
@ -256,9 +256,8 @@ class PostItem extends StatelessWidget {
|
|||||||
AttachmentList(
|
AttachmentList(
|
||||||
data: displayableAttachments!,
|
data: displayableAttachments!,
|
||||||
bordered: true,
|
bordered: true,
|
||||||
gridded: true,
|
|
||||||
maxHeight: showFullPost ? null : 480,
|
maxHeight: showFullPost ? null : 480,
|
||||||
minWidth: 640,
|
maxWidth: MediaQuery.of(context).size.width - 20,
|
||||||
fit: showFullPost ? BoxFit.cover : BoxFit.contain,
|
fit: showFullPost ? BoxFit.cover : BoxFit.contain,
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user