💄 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": { "sync": {
"region": "solian-next", "region": "solian",
"configPath": "roadsign.toml" "configPath": "roadsign.toml"
}, },
"deployments": [ "deployments": [

View File

@ -106,6 +106,44 @@ class _AttachmentListState extends State<AttachmentList> {
} }
if (widget.gridded) { 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( return Container(
margin: widget.padding ?? EdgeInsets.zero, margin: widget.padding ?? EdgeInsets.zero,
decoration: BoxDecoration( decoration: BoxDecoration(

View File

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