Solian/lib/widgets/attachments/attachment_list_fullscreen.dart

52 lines
1.4 KiB
Dart
Raw Normal View History

2024-05-20 16:02:39 +00:00
import 'package:flutter/material.dart';
import 'package:solian/models/attachment.dart';
2024-05-22 15:18:01 +00:00
import 'package:solian/widgets/attachments/attachment_item.dart';
2024-05-20 16:02:39 +00:00
2024-05-25 16:11:00 +00:00
class AttachmentListFullScreen extends StatefulWidget {
final String parentId;
2024-05-20 16:02:39 +00:00
final Attachment attachment;
2024-05-25 16:11:00 +00:00
const AttachmentListFullScreen(
{super.key, required this.parentId, required this.attachment});
2024-05-20 16:02:39 +00:00
@override
2024-05-25 16:11:00 +00:00
State<AttachmentListFullScreen> createState() =>
_AttachmentListFullScreenState();
2024-05-20 16:02:39 +00:00
}
2024-05-25 16:11:00 +00:00
class _AttachmentListFullScreenState extends State<AttachmentListFullScreen> {
2024-05-20 16:02:39 +00:00
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Material(
color: Theme.of(context).colorScheme.surface,
2024-05-20 16:02:39 +00:00
child: GestureDetector(
child: SizedBox(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
child: InteractiveViewer(
boundaryMargin: const EdgeInsets.all(128),
minScale: 0.1,
maxScale: 16,
panEnabled: true,
scaleEnabled: true,
child: AttachmentItem(
2024-05-25 16:11:00 +00:00
parentId: widget.parentId,
2024-05-20 16:02:39 +00:00
showHideButton: false,
item: widget.attachment,
fit: BoxFit.contain,
),
),
),
onTap: () {
Navigator.pop(context);
},
),
);
}
}