import 'package:boilerplate/core/di/injection_init.dart';
import 'package:boilerplate/domain/entities/flavor/flavor_data.dart';
import 'package:flutter/material.dart';
import 'package:photo_view/photo_view.dart';

import '../../core/styles/my_dimensions.dart';
import 'ipm_back_button.dart';

class IPMPhotoViewScreen extends StatefulWidget {
  final String url;

  IPMPhotoViewScreen({Key? key, required this.url}) : super(key: key);

  @override
  State<IPMPhotoViewScreen> createState() => _IPMPhotoViewScreenState();
}

class _IPMPhotoViewScreenState extends State<IPMPhotoViewScreen> {
  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        Container(
          child: PhotoView(
            imageProvider: NetworkImage("${widget.url}"),
          ),
        ),
        Positioned(
          top: MediaQuery.of(context).padding.top + MyDimens.dimen10,
          left: MyDimens.dimen10,
          child: Container(
            alignment: Alignment.center,
            padding: EdgeInsets.all(MyDimens.dimen6),
            decoration: BoxDecoration(
              color: Colors.black.withOpacity(0.3),
              borderRadius: BorderRadius.circular(100),
            ),
            child: IPMBackButton(),
          ),
        )
      ],
    );
  }
}
