import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';

class FullScreenImageViewer extends StatelessWidget {
  final bool isSvg;
  final String path;

  const FullScreenImageViewer({super.key, required this.isSvg, required this.path});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.black,
        leading: IconButton(
          icon: Icon(Icons.close, color: AppColors.whiteColor),
          onPressed: () => Navigator.of(context).pop(),
        ),
      ),
      backgroundColor: Colors.black,
      body: Center(
        child: InteractiveViewer(
          child: isSvg
              ? SvgPicture.asset(path, width: double.infinity, fit: BoxFit.contain)
              : Image.asset(width: double.infinity, path, fit: BoxFit.contain),
        ),
      ),
    );
  }
}
