// 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.transparent,
  Color textCancelColor = textColorBlack,
  bool isOkeButtonShow = true,
}) {
  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: textStyleDialog(),
                  ),
                ),
                const SizedBox(height: 10),
                (isOkeButtonShow)
                    ? GestureDetector(
                        onTap: () {
                          ontapOk();
                        },
                        child: ButtonComponent(
                          buttonColor: okButtonColor,
                          teksButton: textOnOk,
                        ),
                      )
                    : const SizedBox(),
                (isOkeButtonShow)
                    ? const SizedBox(height: 10)
                    : const SizedBox(),
                GestureDetector(
                  onTap: () {
                    ontapCancel();
                  },
                  child: ButtonComponent(
                    buttonColor: Colors.transparent,
                    teksButton: textOnCancel,
                    teksButtonColor: textColorBlack,
                  ),
                )
              ],
            ),
          ));
}
