Reactions

This commit is contained in:
2024-04-15 23:08:32 +08:00
parent 11a3d8f39b
commit 7e42d95904
13 changed files with 449 additions and 137 deletions

View File

@@ -1,29 +1,28 @@
import 'package:flutter/material.dart';
class AttachmentScreen extends StatelessWidget {
final String tag;
final String url;
final String? tag;
const AttachmentScreen({super.key, required this.tag, required this.url});
const AttachmentScreen({super.key, this.tag, required this.url});
@override
Widget build(BuildContext context) {
final image = 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.0,
child: Image.network(url, fit: BoxFit.contain),
),
);
return Scaffold(
body: GestureDetector(
child: Center(
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.0,
child: Hero(
tag: tag,
child: Image.network(url, fit: BoxFit.contain),
),
),
),
child: tag != null ? Hero(tag: tag!, child: image) : image,
),
onTap: () {
Navigator.pop(context);