You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pharmacy/lib/ZoomedImageView.dart

52 lines
1.3 KiB

import 'package:flutter/material.dart';
import 'package:healthcare_pharmacy/settings.dart';
import 'package:photo_view/photo_view.dart';
class ZoomedImageView extends StatelessWidget {
final String imageUrl;
ZoomedImageView({required this.imageUrl});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: primaryColor, // Set the background color
title: Text('Preview Image'), // Set the title text
actions: [
IconButton(
icon: Icon(Icons.close),
onPressed: () {
Navigator.pop(context);
},
),
],
),
body: GestureDetector(
onTap: () {
Navigator.pop(context);
},
child: Center(
child: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
child: PhotoView(
imageProvider: NetworkImage(imageUrl),
maxScale: PhotoViewComputedScale.contained * 4.0,
minScale: PhotoViewComputedScale.contained,
initialScale: PhotoViewComputedScale.contained,
basePosition: Alignment.center,
),
),
),
),
);
}
}