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

