import 'package:hmg_patient_app/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'package:hmg_patient_app/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

// ignore: must_be_immutable
class ConfirmCancelOrderDialog extends StatefulWidget {
  final  CMCViewModel model;
  final Function onTap;

  ConfirmCancelOrderDialog({Key? key, required this.model, required this.onTap});

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

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

  @override
  Widget build(BuildContext context) {
    return SimpleDialog(
      contentPadding: EdgeInsets.fromLTRB(28.0, 2.0, 28.0, 0.0),
      title: Text(
        TranslationBase.of(context).confirm,
        style: TextStyle(
          fontSize: 16,
          fontWeight: FontWeight.bold,
          letterSpacing: -0.46,
        ),
      ),
      children: [
        Column(
          children: [
            Divider(),
            Center(
              child: Text(
                TranslationBase.of(context).cancelOrderMsg,
                style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, letterSpacing: -0.46, color: Colors.grey[600]),
              ),
            ),
            SizedBox(
              height: 12.0,
            ),
            Row(
              // mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: <Widget>[
                Expanded(
                  flex: 1,
                  child: InkWell(
                    onTap: () {
                      Navigator.pop(context);
                    },
                    child: Padding(
                      padding: const EdgeInsets.all(8.0),
                      child: Container(
                        child: Center(
                          child: Text(
                            TranslationBase.of(context).cancel.toUpperCase(),
                            style: TextStyle(
                              fontSize: 14,
                              fontWeight: FontWeight.w700,
                              letterSpacing: -0.46,
                              color: Colors.red,
                            ),
                          ),
                        ),
                      ),
                    ),
                  ),
                ),
                Container(
                  width: 1,
                  height: 30,
                  color: Colors.grey[500],
                ),
                Expanded(
                  flex: 1,
                  child: InkWell(
                    onTap: () async {
                      widget.onTap();
                      Navigator.pop(context);
                    },
                    child: Padding(
                      padding: const EdgeInsets.all(8.0),
                      child: Center(
                          child: Text(
                        TranslationBase.of(context).ok.toUpperCase(),
                        style: TextStyle(
                          fontSize: 14,
                          fontWeight: FontWeight.w700,
                          letterSpacing: -0.46,
                        ),
                      )),
                    ),
                  ),
                ),
              ],
            ),
            SizedBox(
              height: 5.0,
            ),
          ],
        )
      ],
    );
  }
}
