getCheckoutUiTemplate function

String getCheckoutUiTemplate({
  1. required String className,
  2. required String isLoading,
})

Implementation

String getCheckoutUiTemplate(
    {required String className, required String isLoading}) {
  return '''
CustomBody(
      title: "Checkout",
      isLoading: $isLoading,
      backgroundColor: AppColors.background,
      bottomNavigationBar: Container(
        padding: EdgeInsets.all(20.sp),
        decoration: BoxDecoration(
          color: AppColors.white,
          boxShadow: [
            BoxShadow(color: AppColors.black.withOpacity(0.05), blurRadius: 10, offset: const Offset(0, -5)),
          ],
        ),
        child: SizedBox(
          width: double.infinity,
          child: ElevatedButton(
            onPressed: () {},
            style: ElevatedButton.styleFrom(
              backgroundColor: AppColors.primary,
              padding: EdgeInsets.symmetric(vertical: 16.sp),
              shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16.sp)),
            ),
            child: TextWidget(text: "Place Order", color: AppColors.white, fontWeight: FontWeight.bold, textSize: 16.sp),
          ),
        ),
      ),
      child: SingleChildScrollView(
        padding: EdgeInsets.all(20.sp),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            ${_buildSectionHeader("Shipping Address")},
            SizedBox(height: 12.sp),
            Container(
              padding: EdgeInsets.all(16.sp),
              decoration: BoxDecoration(
                color: AppColors.white,
                borderRadius: BorderRadius.circular(16.sp),
                border: Border.all(color: AppColors.primary, width: 1.5),
              ),
              child: Row(
                children: [
                  Container(
                    padding: EdgeInsets.all(10.sp),
                    decoration: BoxDecoration(color: AppColors.primary.withOpacity(0.1), shape: BoxShape.circle),
                    child: Icon(Icons.location_on_rounded, color: AppColors.primary, size: 20.sp),
                  ),
                  SizedBox(width: 15.sp),
                  Expanded(
                    child: Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        TextWidget(text: "Home Address", fontWeight: FontWeight.bold, textSize: 15.sp),
                        SizedBox(height: 4.sp),
                        TextWidget(text: "123 Street Name, Mumbai, India", color: AppColors.grey, textSize: 13.sp),
                      ],
                    ),
                  ),
                  Icon(Icons.check_circle, color: AppColors.primary, size: 24.sp),
                ],
              ),
            ),

            SizedBox(height: 30.sp),
            ${_buildSectionHeader("Payment Method")},
            SizedBox(height: 12.sp),
            ${_buildPaymentOption('Icons.credit_card_rounded', "Credit Card", "**** **** **** 1234", true)},
            SizedBox(height: 12.sp),
            ${_buildPaymentOption('Icons.account_balance_wallet_rounded', "Google Pay", "gpay@upi", false)},

            SizedBox(height: 30.sp),
            ${_buildSectionHeader("Order Summary")},
            SizedBox(height: 12.sp),
            Container(
              padding: EdgeInsets.all(16.sp),
              decoration: BoxDecoration(
                color: AppColors.white,
                borderRadius: BorderRadius.circular(16.sp),
              ),
              child: Column(
                children: [
                  ${_buildSummaryRow("Items (3)", "\\\$340.00")},
                  ${_buildSummaryRow("Shipping", "\\\$10.00")},
                  ${_buildSummaryRow("Discount", "-\\\$10.00", isDiscount: true)},
                  const Divider(height: 30),
                  ${_buildSummaryRow("Total Amount", "\\\$340.00", isTotal: true)},
                ],
              ),
            ),
          ],
        ),
      ),
    )''';
}