// ignore_for_file: sized_box_for_whitespace

import 'package:byod/helper/widget/style.dart';
import 'package:flutter/material.dart';

import '../helper.dart';
import 'button_modal.dart';

Future<dynamic> buttonDialogGlobal(
    BuildContext context,
    String title,
    String description,
    String textOnOk,
    String textOnCancel,
    void Function() ontapOk,
    void Function() ontapCancel,
    {Color okButtonColor = Colors.indigo,
    Color cancelButtonColor = Colors.red}) {
  return showDialog(
      context: context,
      builder: (BuildContext context) => AlertDialog(
            // title: Text(
            //   textScaleFactor: textScaleFactor,
            //   title,
            //   style: textStyleNormalFont(context),
            // ),
            title: defaultText(
              context,
              title,
              // style: textStyleNormalFont(context),
            ),
            content: Column(
              mainAxisSize: MainAxisSize.min,
              children: [
                Align(
                  alignment: Alignment.topLeft,
                  child: defaultText(
                    context,
                    description,
                    style: textStyleNormalFont(context),
                  ),
                ),
                const SizedBox(height: 10),
                GestureDetector(
                  onTap: () {
                    ontapOk();
                  },
                  child: ButtonComponent(
                    buttonColor: okButtonColor,
                    teksButton: textOnOk,
                  ),
                ),
                const SizedBox(height: 10),
                GestureDetector(
                  onTap: () {
                    ontapCancel();
                  },
                  child: ButtonComponent(
                    buttonColor: Colors.transparent,
                    teksButton: textOnCancel,
                    teksButtonColor: textColorBlack,
                  ),
                )
              ],
            ),
          ));
}
