import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gap/gap.dart';
import 'package:tanami_app/core/routes/route_name.dart';
import 'package:tanami_app/core/routes/routes.dart';
import 'package:tanami_app/core/styles/app_color.dart';
import 'package:tanami_app/core/styles/app_text.dart';
import 'package:tanami_app/shared/components/button_widget.dart';
import 'package:tanami_app/shared/components/text_widget.dart';

void forgotPinDialog(BuildContext context) {
  showDialog(
    context: context,
    builder: (BuildContext context) {
      return Dialog(
        backgroundColor: AppColor.plainWhite,
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(20),
        ),
        child: Container(
          decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(22),
            color: AppColor.plainWhite,
          ),
          padding: const EdgeInsets.all(16),
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              TextWidget().text17W700(AppText.notificationText,
                  clr: AppColor.plainBlack),
              const Gap(25),
              Padding(
                padding: const EdgeInsets.symmetric(
                  horizontal: 25,
                ),
                child: TextWidget().text15W500(
                  AppText.toRestorePinYouWillBeLoggedOut,
                  clr: AppColor.hintTextColor,
                ),
              ),
              const Gap(40),
              SizedBox(
                width: 0.9.sw,
                height: 55.h,
                child: ButtonWidget().elevatedBtn(
                  txtClr: AppColor.plainWhite,
                  text: AppText.allowText,
                  clr: AppColor.primaryColor2,
                  function: () {
                    goRouter.pushNamed(RouteName.loginScreen, pathParameters: {
                      "fromScreen": "forgot-pin",
                    });
                    goRouter.pop();
                  },
                ),
              ),
              const Gap(10),
              ButtonWidget().textBtn(
                text: TextWidget().text14W700(
                  AppText.declineText,
                  textDecoration: TextDecoration.underline,
                  clr: AppColor.textLabelColor,
                ),
                function: () {
                  goRouter.pop();
                },
              ),
            ],
          ),
        ),
      );
    },
  );
}
