💄 Optimized attachment list

This commit is contained in:
LittleSheep 2025-01-14 23:17:34 +08:00
parent f494f70003
commit c1b9090e51
3 changed files with 44 additions and 6 deletions

View File

@ -1,6 +1,6 @@
{
"sync": {
"region": "solian-next",
"region": "solian",
"configPath": "roadsign.toml"
},
"deployments": [

View File

@ -106,6 +106,44 @@ class _AttachmentListState extends State<AttachmentList> {
}
if (widget.gridded) {
final fullOfImage =
widget.data.where((ele) => ele?.mediaType == SnMediaType.image).length == widget.data.length;
if(!fullOfImage) {
return Container(
margin: widget.padding ?? EdgeInsets.zero,
decoration: BoxDecoration(
color: backgroundColor,
border: Border(
top: borderSide,
bottom: borderSide,
),
borderRadius: AttachmentList.kDefaultRadius,
),
child: ClipRRect(
borderRadius: AttachmentList.kDefaultRadius,
child: Column(
spacing: 4,
children: widget.data
.mapIndexed(
(idx, ele) => GestureDetector(
child: AspectRatio(
aspectRatio: ele?.data['ratio']?.toDouble() ?? 1,
child: Container(
constraints: constraints,
child: AttachmentItem(
data: ele,
heroTag: heroTags[idx],
fit: BoxFit.cover,
),
),
),
),
)
.toList(),
),
),
);
}
return Container(
margin: widget.padding ?? EdgeInsets.zero,
decoration: BoxDecoration(

View File

@ -1,9 +1,9 @@
id = "solian-next"
id = "solian"
[[locations]]
id = "solian-next"
host = ["sn-next.solsynth.dev"]
id = "solian"
host = ["sn.solsynth.dev"]
path = ["/"]
[[locations.destinations]]
id = "solian-next-web"
uri = "files:///workdir/solian-next?fallback=index.html&index=index.html"
id = "solian-web"
uri = "files:///workdir/solian?fallback=index.html&index=index.html"