showDoubleChooseAlert function

Future<bool?> showDoubleChooseAlert({
  1. required String title,
  2. required String left,
  3. required String right,
  4. GestureTapCallback? rightTap,
  5. GestureTapCallback? leftTap,
  6. Widget? center,
  7. ModalWindowsOptions? options,
  8. DialogOptions? dialogOptions,
})

Implementation

Future<bool?> showDoubleChooseAlert({
  required String title,
  required String left,
  required String right,
  GestureTapCallback? rightTap,
  GestureTapCallback? leftTap,
  Widget? center,

  /// 底层modal配置
  ModalWindowsOptions? options,
  DialogOptions? dialogOptions,
}) async {
  final content = Universal(
      constraints: const BoxConstraints(minHeight: 60),
      padding: const EdgeInsets.all(20),
      children: [
        TextLarge(title, maxLines: 10),
        const SizedBox(height: 30),
        if (center != null) center.marginOnly(bottom: 15)
      ]);
  final value = await DoubleChooseWindows(
          content: content,
          left: Universal(
              height: 40,
              decoration: const BoxDecoration(
                  border: Border(
                top: BorderSide(color: UCS.lineColor, width: 1),
                right: BorderSide(color: UCS.lineColor, width: 0.5),
              )),
              alignment: Alignment.center,
              onTap: leftTap ?? pop,
              child: TextNormal(left, fontWeight: FontWeights.semiBold)),
          right: Universal(
              height: 40,
              onTap: rightTap,
              alignment: Alignment.center,
              decoration: const BoxDecoration(
                  border: Border(
                top: BorderSide(color: UCS.lineColor, width: 1),
                left: BorderSide(color: UCS.lineColor, width: 0.5),
              )),
              child: TextNormal(right,
                  color: Global().mainColor, fontWeight: FontWeights.semiBold)),
          options: options,
          decoration: BoxDecoration(
              color: UCS.white, borderRadius: BorderRadius.circular(6)))
      .show(options: dialogOptions);
  return value ?? false;
}