import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/utils/utils.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
              ? Utils.buildSvgWithAssets(icon: path, width: double.infinity, fit: BoxFit.contain, applyThemeColor: false)
              : Utils.buildImgWithAssets(icon: path, width: double.infinity, fit: BoxFit.contain),
        ),
      ),
    );
  }
}
