import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/ordersProvider/paymentsProvider.dart';
import 'package:generp/screens/order/editAdjustedOrderList.dart';
import 'package:provider/provider.dart';

import '../../Utils/app_colors.dart';
import '../../Utils/commonWidgets.dart';
import '../finance/FileViewer.dart';
import 'editPaymentDetailsByMode.dart';
import 'ordersDetailsByModes.dart';

class Paymentdetailsbymode extends StatefulWidget {
  final pageTitleName;
  final paymentId;
  final mode;

  const Paymentdetailsbymode({
    super.key,
    required this.pageTitleName,
    required this.paymentId,
    required this.mode,
  });

  @override
  State<Paymentdetailsbymode> createState() => _PaymentdetailsbymodeState();
}

class _PaymentdetailsbymodeState extends State<Paymentdetailsbymode> {
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
      var provider = Provider.of<Paymentsprovider>(context, listen: false);
      provider.paymentsDetailsByModeAPIFunction(
        context,
        widget.paymentId,
        widget.mode,
      );
    });
  }

  @override
  Widget build(BuildContext context) {
    return Consumer<Paymentsprovider>(
      builder: (context, provider, child) {
        var paymentDetails = provider.paymentDetails;
        var adjustList = provider.paidLists;
        return WillPopScope(
          child: Scaffold(
            resizeToAvoidBottomInset: true,
            appBar: appbar2(
              context,
              widget.pageTitleName,
              provider.resetAll,
              paymentDetails.status == "Registered"
                  ? InkResponse(
                    onTap: () {
                      _showOptionsSheet(context);
                    },
                    child: SvgPicture.asset(
                      "assets/svg/ic_more.svg",
                      height: 30,
                    ),
                  )
                  : SizedBox(width: 0),
            ),
            backgroundColor: AppColors.scaffold_bg_color,
            body: Container(
              child: SingleChildScrollView(
                child: Column(
                  children: [
                    Container(
                      decoration: BoxDecoration(
                        color: Colors.white,
                        borderRadius: BorderRadius.circular(16),
                      ),
                      margin: EdgeInsets.symmetric(
                        vertical: 10,
                        horizontal: 10,
                      ),
                      padding: EdgeInsets.symmetric(
                        vertical: 10,
                        horizontal: 10,
                      ),
                      child: Column(
                        children: [
                          Row(
                            children: [
                              Expanded(
                                flex: 1,
                                child: Container(
                                  height: 50,
                                  width: 35,
                                  padding: EdgeInsets.all(8.0),
                                  decoration: BoxDecoration(
                                    color: Color(0xFFFFF3CE),
                                    borderRadius: BorderRadius.circular(8),
                                  ),
                                  child: SvgPicture.asset(
                                    "assets/svg/fin_ic.svg",
                                  ),
                                ),
                              ),
                              SizedBox(width: 10),
                              Expanded(
                                flex: 4,
                                child: SizedBox(
                                  child: Column(
                                    crossAxisAlignment:
                                        CrossAxisAlignment.start,
                                    children: [
                                      Text(
                                        paymentDetails.accountName ?? "-",
                                        style: TextStyle(
                                          fontFamily: "JakartaMedium",
                                          fontSize: 14,
                                          color: AppColors.semi_black,
                                        ),
                                      ),
                                      Text(
                                        "₹${paymentDetails.amount}",
                                        style: TextStyle(
                                          fontFamily: "JakartaMedium",
                                          fontSize: 14,
                                          color: AppColors.app_blue,
                                        ),
                                      ),
                                    ],
                                  ),
                                ),
                              ),
                              Expanded(
                                flex: 2,
                                child: Container(
                                  padding: EdgeInsets.symmetric(
                                    horizontal: 5,
                                    vertical: 10,
                                  ),
                                  decoration: BoxDecoration(
                                    borderRadius: BorderRadius.circular(8),
                                    color: Color(0xFFE3FFE0),
                                  ),
                                  child: Center(
                                    child: Text(
                                      paymentDetails.status ?? "-",
                                      textAlign: TextAlign.center,
                                      style: TextStyle(
                                        fontFamily: "JakartaMedium",
                                        fontSize: 14,
                                        color: Color(0xFF0D9C00),
                                      ),
                                    ),
                                  ),
                                ),
                              ),
                            ],
                          ),
                          Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
                          ...List.generate(provider.subHeadings.length, (j) {
                            return Container(
                              padding: EdgeInsets.symmetric(vertical: 7),
                              child: Row(
                                crossAxisAlignment: CrossAxisAlignment.start,
                                children: [
                                  Expanded(
                                    child: Text(
                                      provider.Headings[j],
                                      style: TextStyle(
                                        fontFamily: "JakartaMedium",
                                        fontSize: 14,
                                        color: AppColors.semi_black,
                                      ),
                                    ),
                                  ),
                                  Expanded(
                                    child: InkResponse(
                                      onTap: () {
                                        if (provider.Headings[j] ==
                                            "Attachment") {
                                          Navigator.push(
                                            context,
                                            MaterialPageRoute(
                                              builder:
                                                  (context) => Fileviewer(
                                                    fileName:
                                                        paymentDetails
                                                            .attachmentViewFileName!,
                                                    fileUrl:
                                                        paymentDetails
                                                            .attachmentDirFilePath!,
                                                  ),
                                            ),
                                          );
                                        }
                                      },
                                      child: Text(
                                        provider.Headings[j] == "Attachment"
                                            ? "View"
                                            : "${provider.subHeadings[j]}",
                                        style: TextStyle(
                                          fontSize: 14,
                                          color:
                                              provider.Headings[j] ==
                                                      "Attachment"
                                                  ? AppColors.app_blue
                                                  : Color(0xFF818181),
                                          decoration:
                                              provider.Headings[j] ==
                                                      "Attachment"
                                                  ? TextDecoration.underline
                                                  : TextDecoration.none,
                                          decorationColor:
                                              provider.Headings[j] ==
                                                      "Attachment"
                                                  ? AppColors.app_blue
                                                  : AppColors.white,
                                        ),
                                      ),
                                    ),
                                  ),
                                ],
                              ),
                            );
                          }),
                        ],
                      ),
                    ),

                    Container(
                      alignment: Alignment.topLeft,
                      padding: EdgeInsets.symmetric(
                        vertical: 5,
                        horizontal: 10,
                      ),
                      child: Text(
                        "Adjusted Order List",
                        style: TextStyle(
                          fontSize: 14,
                          color: AppColors.grey_thick,
                        ),
                      ),
                    ),
                    ListView.builder(
                      scrollDirection: Axis.vertical,
                      shrinkWrap: true,
                      physics: NeverScrollableScrollPhysics(),
                      itemCount: adjustList.length,
                      padding: EdgeInsets.symmetric(
                        horizontal: 10,
                        vertical: 10,
                      ),

                      itemBuilder: (context, index) {
                        return Container(
                          margin: EdgeInsets.symmetric(vertical: 5),
                          padding: EdgeInsets.symmetric(
                            horizontal: 15,
                            vertical: 10,
                          ),
                          decoration: BoxDecoration(
                            color: Colors.white,
                            borderRadius: BorderRadius.circular(20),
                          ),
                          child: Column(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: List.generate(7, (j) {
                              final textheads = [
                                "Order Number",
                                "Order Amount",
                                "Paid Amount",
                                "Balance Amount",
                                "Adjusted Amount",
                                "DateTime",
                                "Actions",
                              ];
                              final textSubheads = [
                                "${adjustList[index].orderNumber}",
                                "${adjustList[index].totalAmount}",
                                "${adjustList[index].paidAmount}",
                                "${adjustList[index].balanceAmount}",
                                "${adjustList[index].adjustedAmount}",
                                "${adjustList[index].datetime}",
                                "View",
                              ];
                              return Container(
                                padding: EdgeInsets.symmetric(
                                  vertical: 6,
                                  horizontal: 0,
                                ),
                                child: Row(
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  children: [
                                    Expanded(
                                      child: Text(
                                        textheads[j].toString(),
                                        maxLines: 2,
                                        overflow: TextOverflow.ellipsis,
                                      ),
                                    ),
                                    Expanded(
                                      child: InkResponse(
                                        onTap: () {
                                          if (textheads[j] == "Actions") {
                                            Navigator.push(
                                              context,
                                              MaterialPageRoute(
                                                builder:
                                                    (
                                                      context,
                                                    ) => Ordersdetailsbymodes(
                                                      pageTitleName:
                                                          "CRM Order Details",
                                                      mode: widget.mode,
                                                      orderId:
                                                          adjustList[index].id,
                                                    ),
                                              ),
                                            );
                                          }
                                        },
                                        child: SizedBox(
                                          // height:45,
                                          width:
                                              MediaQuery.of(
                                                context,
                                              ).size.width *
                                              0.75,
                                          child: Text(
                                            textSubheads[j],
                                            maxLines: 2,
                                            overflow: TextOverflow.ellipsis,
                                            style: TextStyle(
                                              color:
                                                  textheads[j] == "Actions"
                                                      ? AppColors.app_blue
                                                      : Color(0xFF818181),
                                              decoration:
                                                  textheads[j] == "Actions"
                                                      ? TextDecoration.underline
                                                      : TextDecoration.none,
                                              decorationColor:
                                                  textheads[j] == "Actions"
                                                      ? AppColors.app_blue
                                                      : AppColors.white,
                                            ),
                                          ),
                                        ),
                                      ),
                                    ),
                                  ],
                                ),
                              );
                            }),
                          ),
                        );
                      },
                    ),
                  ],
                ),
              ),
            ),
            bottomNavigationBar:
                widget.mode == "self"
                    ? Container(height: 0)
                    : Container(
                      margin: EdgeInsets.symmetric(horizontal: 10),
                      alignment: Alignment.bottomCenter,
                      height: 60,
                      child: Container(
                        margin: EdgeInsets.only(bottom: 10),
                        alignment: Alignment.center,
                        height: 45,
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.center,
                          children: [
                            if (!["self", "admin"].contains(widget.mode)) ...[
                              Expanded(
                                child: InkResponse(
                                  onTap: () {
                                    _showLevelApprovalRejectionSheet(
                                      context,
                                      "Reject",
                                    );
                                  },
                                  child: Container(
                                    decoration: BoxDecoration(
                                      borderRadius: BorderRadius.circular(8),
                                      color: Color(0xFFFFEFEF),
                                      border: Border.all(
                                        color: Color(0xFFED3424),
                                        width: 0.5,
                                      ),
                                    ),
                                    child: Center(
                                      child: Text(
                                        "Reject",
                                        style: TextStyle(
                                          color: Color(0xFFED3424),
                                        ),
                                      ),
                                    ),
                                  ),
                                ),
                              ),

                              SizedBox(width: 10),

                              Expanded(
                                child: InkResponse(
                                  onTap: () {
                                    // provider
                                    //     .approveRejectPaymentRequestAPIFunction(
                                    //   context,
                                    //   provider.requestsDetails.id,
                                    // );
                                    _showLevelApprovalRejectionSheet(
                                      context,
                                      "Approve",
                                    );
                                  },
                                  child: Container(
                                    decoration: BoxDecoration(
                                      borderRadius: BorderRadius.circular(8),
                                      color: Color(0xFFE7FFE5),
                                      border: Border.all(
                                        color: Color(0xFF0D9C00),
                                        width: 0.5,
                                      ),
                                    ),
                                    child: Center(
                                      child: Text(
                                        "Approve",
                                        style: TextStyle(
                                          color: Color(0xFF0D9C00),
                                        ),
                                      ),
                                    ),
                                  ),
                                ),
                              ),
                            ] else if (widget.mode == "admin") ...[
                              Expanded(
                                child: InkResponse(
                                  onTap: () {
                                    _showLevelDeletionSheet(context);
                                  },
                                  child: Container(
                                    decoration: BoxDecoration(
                                      borderRadius: BorderRadius.circular(8),
                                      color: Color(0xFFFFEFEF),
                                      border: Border.all(
                                        color: Color(0xFFED3424),
                                        width: 0.5,
                                      ),
                                    ),
                                    child: Center(
                                      child: Text(
                                        "Delete",
                                        style: TextStyle(
                                          color: Color(0xFFED3424),
                                        ),
                                      ),
                                    ),
                                  ),
                                ),
                              ),
                            ],
                          ],
                        ),
                      ),
                    ),
          ),

          onWillPop: () {
            return onBackPressed(context);
          },
        );
      },
    );
  }



  Future<void> _showOptionsSheet(BuildContext context) {
    return showModalBottomSheet(
      useSafeArea: true,
      isDismissible: true,
      isScrollControlled: true,
      showDragHandle: true,
      backgroundColor: Colors.white,
      enableDrag: true,
      context: context,
      builder: (context) {
        return StatefulBuilder(
          builder: (context, setState) {
            return SafeArea(
              child: Consumer<Paymentsprovider>(
                builder: (context, provider, child) {
                  return Container(
                    margin: EdgeInsets.only(
                      bottom: 15,
                      left: 15,
                      right: 15,
                      top: 10,
                    ),
                    padding: EdgeInsets.only( bottom: MediaQuery.of(context).viewInsets.bottom,),
                    child: SingleChildScrollView(
                      child: Column(
                        mainAxisSize: MainAxisSize.min,
                        children: [
                          SizedBox(height: 15),

                          ...List.generate(2, (index) {
                            final assetnames = ["ic_edit", "ic_edit"];
                            final Headingnames = [
                              "Edit Payment Details",
                              "Edit Adjusted Order",
                            ];
                            return ListTile(
                              onTap: () async{
                                var res;
                                switch (index) {
                                  case 0:
                                    res = await Navigator.push(
                                      context,
                                      MaterialPageRoute(
                                        builder:
                                            (
                                              context,
                                            ) => Editpaymentdetailsbymode(
                                              pageTitleName:
                                                  "Edit Payment (${widget.mode})",
                                              mode: widget.mode,
                                              values: {
                                                "payment_id":
                                                    provider
                                                        .paymentDetails
                                                        .paymentId,
                                                "description":
                                                    provider
                                                        .paymentDetails!
                                                        .description,
                                                "amount":
                                                    provider
                                                        .paymentDetails!
                                                        .amount,
                                                "payment_mode":
                                                    provider
                                                        .paymentDetails!
                                                        .paymentType,
                                                "pay_ref":
                                                    provider
                                                        .paymentDetails!
                                                        .refNo,
                                                "pay_received_date":
                                                    provider
                                                        .paymentDetails!
                                                        .paymentDate,
                                              },
                                            ),
                                      ),
                                    );
                                    break;
                                  case 1:
                                  res = await Navigator.push(
                                      context,
                                      MaterialPageRoute(
                                        builder:
                                            (context) => Editadjustedorderlist(
                                              mode: widget.mode,
                                              pageTitleName:
                                                  "Edit Adjusted Order List (${widget.mode})",

                                              values: {
                                                "account_id":
                                                    provider
                                                        .paymentDetails
                                                        .accId,
                                                "payment_id":
                                                    provider
                                                        .paymentDetails
                                                        .paymentId,
                                                "orders":
                                                    provider.paidLists
                                                        .map(
                                                          (order) => {
                                                            "order_number":
                                                                order
                                                                    .orderNumber,
                                                            "amount":
                                                                order
                                                                    .adjustedAmount,
                                                          },
                                                        )
                                                        .toList(),
                                              },
                                            ),
                                      ),
                                    );
                                    break;
                                }
                                if(res==true){
                                  provider.paymentsDetailsByModeAPIFunction(
                                    context,
                                    widget.paymentId,
                                    widget.mode,
                                  );
                                }
                              },
                              leading: SvgPicture.asset(
                                "assets/svg/${assetnames[index]}.svg",
                              ),
                              title: Text(
                                Headingnames[index],
                                style: TextStyle(fontFamily: "JakartaMedium"),
                              ),
                              trailing: SvgPicture.asset(
                                "assets/svg/arrow_right_new.svg",
                              ),
                            );
                          }),
                        ],
                      ),
                    ),
                  );
                },
              ),
            );
          },
        );
      },
    );
  }

  Future<void> _showLevelApprovalRejectionSheet(BuildContext context, type) {
    return showModalBottomSheet(
      useSafeArea: true,
      isDismissible: true,
      isScrollControlled: true,
      showDragHandle: true,
      backgroundColor: Colors.white,
      enableDrag: true,
      context: context,
      builder: (context) {
        return StatefulBuilder(
          builder: (context, setState) {
            return SafeArea(
              child: Consumer<Paymentsprovider>(
                builder: (context, provider, child) {
                  final details = provider.paymentDetails;
                  return Container(
                    margin: EdgeInsets.only(
                      bottom: 15,
                      left: 15,
                      right: 15,
                      top: 10,
                    ),
                    padding: EdgeInsets.only( bottom: MediaQuery.of(context).viewInsets.bottom,),
                    child: SingleChildScrollView(
                      child: Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        mainAxisSize: MainAxisSize.min,
                        children: [
                          Align(
                            alignment: Alignment.topLeft,
                            child: Text(
                              type == "Approve"
                                  ? "${"Payment Approval"}"
                                  : "${"Payment Reject"}",
                              style: TextStyle(
                                color: AppColors.app_blue,
                                fontSize: 16,
                              ),
                            ),
                          ),
                          Padding(
                            padding: const EdgeInsets.only(
                              bottom: 5.0,
                              top: 8.0,
                            ),
                            child: Text("Remarks"),
                          ),
                          Container(
                            height: 150,
                            alignment: Alignment.center,
                            decoration: BoxDecoration(
                              color: Color(0xFFE9E9E9),
                              borderRadius: BorderRadius.circular(14),
                            ),
                            child: Padding(
                              padding: const EdgeInsets.fromLTRB(
                                10.0,
                                0.0,
                                10,
                                0,
                              ),
                              child: TextFormField(
                                controller:
                                    provider.approvalRejectionController,
                                readOnly: true,
                                keyboardType: TextInputType.text,
                                maxLines: 60,
                                onChanged: provider.onChangeApprovalRejection,
                                style: TextStyle(
                                  color: Color(0xFF818181),
                                  fontSize: 14,
                                ),
                                decoration: InputDecoration(
                                  hintText: "Write Remarks",
                                  hintStyle: TextStyle(
                                    fontWeight: FontWeight.w400,
                                    color: Color(0xFFB4BEC0),
                                    fontSize: 14,
                                  ),

                                  enabledBorder: InputBorder.none,
                                  focusedBorder: InputBorder.none,
                                ),
                              ),
                            ),
                          ),
                          if (provider.approvalRejectionError != null) ...[
                            Container(
                              alignment: Alignment.topLeft,
                              margin: EdgeInsets.only(top: 2.5, left: 25),
                              child: Text(
                                "${provider.approvalRejectionError}",
                                style: TextStyle(
                                  color: Colors.red,
                                  fontSize: 10,
                                ),
                              ),
                            ),
                          ],
                          InkWell(
                            onTap: () {
                              provider.paymentApprovalRejectionAPIFunction(
                                context,
                                provider.paymentDetails.paymentId,
                                type,
                              );
                            },

                            child: Container(
                              alignment: Alignment.center,
                              height: 45,
                              margin: EdgeInsets.only(
                                left: 5.0,
                                right: 5.0,
                                top: 5.0,
                                bottom: 5.0,
                              ),
                              decoration: BoxDecoration(
                                color: AppColors.app_blue, //1487C9
                                borderRadius: BorderRadius.circular(14.0),
                              ),
                              child: Center(
                                child: Text(
                                  "Submit",
                                  textAlign: TextAlign.center,
                                  style: TextStyle(color: Colors.white),
                                ),
                              ),
                            ),
                          ),
                        ],
                      ),
                    ),
                  );
                },
              ),
            );
          },
        );
      },
    );
  }

  Future<void> _showLevelDeletionSheet(BuildContext context) {
    return showModalBottomSheet(
      useSafeArea: true,
      isDismissible: true,
      isScrollControlled: true,
      showDragHandle: true,
      backgroundColor: Colors.white,
      enableDrag: true,
      context: context,
      builder: (context) {
        return StatefulBuilder(
          builder: (context, setState) {
            return SafeArea(
              child: Consumer<Paymentsprovider>(
                builder: (context, provider, child) {
                  return Container(
                    margin: EdgeInsets.only(
                      bottom: 15,
                      left: 15,
                      right: 15,
                      top: 10,
                    ),
                    padding: EdgeInsets.only( bottom: MediaQuery.of(context).viewInsets.bottom,),
                    child: SingleChildScrollView(
                      child: Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        mainAxisSize: MainAxisSize.min,
                        children: [
                          Align(
                            alignment: Alignment.topLeft,
                            child: Text(
                              "Delete Payment",
                              style: TextStyle(
                                color: AppColors.app_blue,
                                fontSize: 16,
                              ),
                            ),
                          ),

                          InkWell(
                            onTap: () {
                              _confirmDeletionSheet(context);
                            },
                            child: Container(
                              alignment: Alignment.center,
                              height: 45,
                              margin: EdgeInsets.only(
                                left: 5.0,
                                right: 5.0,
                                top: 5.0,
                                bottom: 5.0,
                              ),
                              decoration: BoxDecoration(
                                color: AppColors.app_blue, //1487C9
                                borderRadius: BorderRadius.circular(14.0),
                              ),
                              child: Center(
                                child: Text(
                                  "Submit",
                                  textAlign: TextAlign.center,
                                  style: TextStyle(color: Colors.white),
                                ),
                              ),
                            ),
                          ),
                        ],
                      ),
                    ),
                  );
                },
              ),
            );
          },
        );
      },
    );
  }

  Future<void> _confirmDeletionSheet(BuildContext context) {
    return showModalBottomSheet(
      useSafeArea: true,
      isDismissible: true,
      isScrollControlled: true,
      showDragHandle: true,

      enableDrag: true,
      context: context,
      builder: (context) {
        return StatefulBuilder(
          builder: (context, setState) {
            return SafeArea(
              child: Container(
                margin: EdgeInsets.only(
                  bottom: 15,
                  left: 15,
                  right: 15,
                  top: 30,
                ),
                padding: EdgeInsets.only( bottom: MediaQuery.of(context).viewInsets.bottom,),
                child: Consumer<Paymentsprovider>(
                  builder: (context, provider, child) {
                    return SingleChildScrollView(
                      child: Column(
                        mainAxisSize: MainAxisSize.min,
                        children: [
                          Column(
                            crossAxisAlignment: CrossAxisAlignment.center,
                            children: [
                              Text(
                                "Are you sure you want \nto Delete the Payment ?",
                                textAlign: TextAlign.center,
                                style: TextStyle(
                                  fontFamily: "JakartaMedium",
                                  color: AppColors.semi_black,
                                  fontSize: 18,
                                ),
                              ),
                            ],
                          ),
                          SizedBox(height: 20),
                          InkWell(
                            onTap: () {
                              // LoginApiFunction();

                              var f = FocusScope.of(context);

                              if (!f.hasPrimaryFocus) {
                                f.unfocus();
                              }
                              provider.paymentDeletionAPIFunction(
                                context,
                                provider.paymentDetails.paymentId,
                              );
                              //  Navigator.push(context,MaterialPageRoute(builder: (context)=>Profile()));
                            },
                            child: Container(
                              alignment: Alignment.center,
                              height: 45,
                              margin: EdgeInsets.only(
                                left: 5.0,
                                right: 5.0,
                                top: 5.0,
                                bottom: 5.0,
                              ),
                              decoration: BoxDecoration(
                                color: AppColors.app_blue, //1487C9
                                borderRadius: BorderRadius.circular(15.0),
                              ),
                              child: Center(
                                child: Text(
                                  "Yes, Logout",
                                  textAlign: TextAlign.center,
                                  style: TextStyle(
                                    color: Colors.white,
                                    fontFamily: "JakartaMedium",
                                  ),
                                ),
                              ),
                            ),
                          ),

                          InkWell(
                            onTap: () {
                              // LoginApiFunction();

                              var f = FocusScope.of(context);

                              if (!f.hasPrimaryFocus) {
                                f.unfocus();
                              }
                              Navigator.pop(context);
                            },
                            child: Container(
                              alignment: Alignment.center,
                              height: 45,
                              margin: EdgeInsets.only(
                                left: 5.0,
                                right: 5.0,
                                top: 5.0,
                                bottom: 5.0,
                              ),

                              child: Center(
                                child: Text(
                                  "Cancel",
                                  textAlign: TextAlign.center,
                                  style: TextStyle(
                                    color: AppColors.app_blue,
                                    fontFamily: "JakartaMedium",
                                  ),
                                ),
                              ),
                            ),
                          ),
                        ],
                      ),
                    );
                  },
                ),
              ),
            );
          },
        );
      },
    );
  }
}
