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/zoomable_image.dart

41 lines
1.0 KiB

9 months ago
import 'package:flutter/material.dart';
import 'package:healthcare_pharmacy/settings.dart';
import 'package:photo_view/photo_view.dart';
class ZoomableImage extends StatelessWidget {
final String imageUrl;
ZoomableImage(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: Center(
child: imageUrl.isNotEmpty
? PhotoView(
imageProvider: NetworkImage(imageUrl),
minScale: PhotoViewComputedScale.contained,
maxScale: PhotoViewComputedScale.contained * 3.0,
)
: Image.asset(
'images/mobilebg.png', // Path to your default image
fit: BoxFit.cover,
),
),
);
}
}