



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,
            ),
          ),
        ),
      ),
    );
  }
}
