💄 Optimized attachment list
This commit is contained in:
parent
f494f70003
commit
c1b9090e51
@ -1,6 +1,6 @@
|
||||
{
|
||||
"sync": {
|
||||
"region": "solian-next",
|
||||
"region": "solian",
|
||||
"configPath": "roadsign.toml"
|
||||
},
|
||||
"deployments": [
|
||||
|
@ -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(
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user