import 'package:hmg_patient_app/uitl/utils_new.dart';
import 'package:flutter/material.dart';
import 'package:photo_view/photo_view.dart';

class PhotoViewPage extends StatelessWidget {
  String image;

  PhotoViewPage(this.image);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        width: double.infinity,
        height: double.infinity,
        child: Stack(
          children: [
            Align(
              alignment: Alignment.center,
              child: PhotoView(
                imageProvider: AssetImage(image),
              ),
            ),
            Align(
              alignment: Alignment.topRight,
              child: SafeArea(
                child: Container(
                  decoration: containerColorRadiusBorder(
                    Colors.black.withOpacity(0.2),
                    1000,
                    Colors.white,
                  ),
                  margin: EdgeInsets.all(12),
                  child: IconButton(
                    icon: Icon(
                      Icons.close,
                      color: Colors.white,
                    ),
                    onPressed: () {
                      Navigator.pop(context);
                    },
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
