import 'package:diplomaticquarterapp/models/Appointments/doctor_pre_post_image.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class DoctorPostPreImagesContent extends StatefulWidget {
  final DoctorPrePostImages doctorPrePostImages;

  const DoctorPostPreImagesContent({this.doctorPrePostImages});

  @override
  DoctorPostPreImagesContentState createState() => DoctorPostPreImagesContentState();
}

class DoctorPostPreImagesContentState extends State<DoctorPostPreImagesContent> {
  @override
  Widget build(BuildContext context) {
    var images = widget.doctorPrePostImages;
    return Center(
      child: Material(
        color: Colors.transparent,
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            Row(
              children: [
                Expanded(
                    child: Column(
                  children: [
                    Text(
                      "Before",
                      style: TextStyle(color: Colors.white, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),
                    ),
                    SizedBox(
                      height: 10,
                    ),
                    Image.memory(
                      images.getPreBytes(),
                      errorBuilder: (ctx, err, trace) {
                        return Container(
                          color: Colors.grey.withOpacity(0.25),
                        );
                      },
                    )
                  ],
                )),
                Divider(color: Colors.grey.withOpacity(0.5)),
                Expanded(
                    child: Column(
                  children: [
                    Text(
                      "After",
                      style: TextStyle(color: Colors.white, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),
                    ),
                    SizedBox(
                      height: 10,
                    ),
                    Image.memory(
                      images.getPostBytes(),
                      errorBuilder: (ctx, err, trace) {
                        return Container(
                          color: Colors.grey.withOpacity(0.25),
                        );
                      },
                    )
                  ],
                ))
              ],
            ),
          ],
        ),
      ),
    );
  }
}
