import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/pages/settings/settings.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

import '../../routes.dart';

class ConfirmSendEmailDialog extends StatefulWidget {
  final String email;
  final GestureTapCallback onTapSendEmail;

  ConfirmSendEmailDialog({this.email, this.onTapSendEmail});

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

class _ConfirmSendEmailDialogState extends State<ConfirmSendEmailDialog> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return SimpleDialog(
      contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0),
      title: Center(
        child: Texts(
          TranslationBase.of(context).confirm,
          color: Colors.black,
        ),
      ),
      children: [
        Column(
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            Center(
              child: Texts(
                TranslationBase.of(context).sendConfEmail,
                fontSize: 14,
                color: Colors.grey,
              ),
            ),
            Texts(
              widget.email,
              color: Colors.grey,
            ),
            SizedBox(
              height: 5,
            ),
            Divider(),
            SizedBox(
              height: 5.0,
            ),
            InkWell(
              onTap: () {
                Navigator.pop(context);
              },
              child: Container(
                width: double.maxFinite,
                child: Center(
                  child: Texts(
                    TranslationBase.of(context).cancel,
                    color: Colors.red,
                  ),
                ),
              ),
            ),
            SizedBox(
              height: 15.0,
            ),
            InkWell(
              onTap: () {
                Navigator.pop(context);
                widget.onTapSendEmail();
              },
              child: Container(
                width: double.maxFinite,
                child: Center(
                  child: Texts(TranslationBase.of(context).sendEmail),
                ),
              ),
            ),
            SizedBox(
              height: 15.0,
            ),
            InkWell(
              onTap: ()
              {
                Navigator.pop(context);
                Navigator.push(
                  context,
                  FadePage(
                    page: Settings(type: 1,),
                  ),
                );

              },
              child: Container(
                width: double.maxFinite,
                child: Center(
                  child: Texts(TranslationBase.of(context).updateEmail),
                ),
              ),
            ),
            SizedBox(
              height: 20.0,
            ),
          ],
        )
      ],
    );
  }
}
