showEndSleepDialog static method

YYDialog showEndSleepDialog(
  1. BuildContext context,
  2. String title,
  3. String content, {
  4. dynamic yesCallBack()?,
  5. dynamic continueCallBack()?,
  6. dynamic cancelCallBack()?,
})

Implementation

static YYDialog showEndSleepDialog(
  BuildContext context,
  String title,
  String content, {
  Function()? yesCallBack,
  Function()? continueCallBack,
  Function()? cancelCallBack,
}) {
  YYDialog yydialog = DialogUtils.showCustomViewDialog(
      context,
      Container(
        width: MediaQuery.of(context).size.width / 6 * 5,
        // height: 310,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            SizedBox(
              height: 10.h,
            ),
            Image.asset(
              "images/icon_sleep_moon.png",
              width: 80.w,
              height: 80.w,
            ),
            Text(
              "${title}",
              style: GoogleFonts.poppins(fontWeight: FontWeight.w600, fontSize: 16.sp, color: const Color(0xff0b1250)),
            ),
            Text(
              "${content}",
              style: GoogleFonts.poppins(fontWeight: FontWeight.w500, fontSize: 14.sp, color: const Color(0xff0b1250)),
            ),
            SizedBox(
              height: 10.h,
            ),
            SizedBox(
              height: 15.h,
            ),
            FractionallySizedBox(
              widthFactor: 0.7,
              child: GFButton(
                color: Colors.white,
                onPressed: () {
                  Navigator.of(context).pop();
                  continueCallBack?.call();
                },
                shape: GFButtonShape.pills,
                fullWidthButton: true,
                borderSide: BorderSide(color: Color(0xff607AE3), width: 1.w),
                size: 40,
                child: Text(
                  "Mistake, continute tracking",
                  style: GoogleFonts.poppins(fontSize: 14.sp, fontWeight: FontWeight.w500, color: const Color(0xff607AE3)),
                ),
              ),
            ),
            SizedBox(
              height: 15.h,
            ),
            FractionallySizedBox(
              widthFactor: 0.7,
              child: GFButton(
                onPressed: () {
                  Navigator.of(context).pop();
                  yesCallBack?.call();
                },
                shape: GFButtonShape.pills,
                size: 40,
                child: Text(
                  "Accurate sleep, record it",
                  style: GoogleFonts.poppins(fontSize: 14.sp, fontWeight: FontWeight.w500, color: Colors.white),
                ),
              ),
            ),
            SizedBox(
              height: 15.h,
            ),
            FractionallySizedBox(
              widthFactor: 0.7,
              child: GFButton(
                  onPressed: () {
                    Navigator.of(context).pop();
                    cancelCallBack?.call();
                  },
                  color: Colors.transparent,
                  shape: GFButtonShape.pills,
                  size: 40,
                  child: Text(
                    "Delete this sleep session",
                    style: GoogleFonts.poppins(
                        fontSize: 14.sp, fontWeight: FontWeight.w500, color: const Color(0x960B1250), decoration: TextDecoration.underline),
                  )),
            ),
            SizedBox(
              height: 15.h,
            ),
          ],
        ),
      ), () {
    debugPrint("----showCompleteDialog----");
  }, barrierDismissible: false);

  return yydialog;
}