Basic fediverse posts displaying

This commit is contained in:
2025-03-13 00:09:28 +08:00
parent f2d913ffec
commit e44320e0fe
13 changed files with 1512 additions and 271 deletions

View File

@ -95,8 +95,9 @@ class _AttachmentListState extends State<AttachmentList> {
),
),
onTap: () {
if (widget.data.firstOrNull?.mediaType != SnMediaType.image)
if (widget.data.firstOrNull?.mediaType != SnMediaType.image) {
return;
}
context.pushTransparentRoute(
AttachmentZoomView(
data: widget.data.where((ele) => ele != null).cast(),
@ -209,7 +210,7 @@ class _AttachmentListState extends State<AttachmentList> {
child: AspectRatio(
aspectRatio: widget.data[0]?.data['ratio']?.toDouble() ?? 1,
child: ScrollConfiguration(
behavior: _AttachmentListScrollBehavior(),
behavior: AttachmentListScrollBehavior(),
child: ListView.separated(
padding: widget.padding,
shrinkWrap: true,
@ -283,7 +284,7 @@ class _AttachmentListState extends State<AttachmentList> {
}
}
class _AttachmentListScrollBehavior extends MaterialScrollBehavior {
class AttachmentListScrollBehavior extends MaterialScrollBehavior {
@override
Set<PointerDeviceKind> get dragDevices =>
{PointerDeviceKind.touch, PointerDeviceKind.mouse};