import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:uco_mobile_poc/app/core/constants/translation_keys.dart';
import 'package:uco_mobile_poc/app/custom_widgets/custom_app_bar.dart';
import 'package:uco_mobile_poc/app/custom_widgets/custom_button.dart';
import 'package:uco_mobile_poc/app/res/app_colors.dart';

import '../controllers/recipient_details_controller.dart';

class RecipientDetailsView extends GetView<RecipientDetailsController> {
  const RecipientDetailsView({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: DashBoardAppBar(
        title: TranslationKeys.makeTranslation(
            TranslationKeys.textConfirmTransaction),
        onBackButtonPressed: () {
          Get.back();
        },
      ),
      body: Obx(() {
        return Column(
          children: [
            Stack(children: [
              Container(
                  height: 70,
                  decoration:
                  const BoxDecoration(color: AppColors.colorPrimary)),
              Padding(
                padding: const EdgeInsets.only(left: 20, right: 20),
                child: Card(
                  color: AppColors.colorGrey50,
                  margin:
                  const EdgeInsets.symmetric(horizontal: 10, vertical: 20),
                  elevation: 5.0,
                  child: Container(
                      padding: const EdgeInsets.all(8),
                      decoration: const BoxDecoration(
                          borderRadius: BorderRadius.all(
                              Radius.circular(10)) // Add border radius
                      ),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: [
                          Expanded(
                              flex: 2,
                              child: Padding(
                                padding: const EdgeInsets.all(8.0),
                                child: Text(
                                    TranslationKeys.makeTranslation(
                                        TranslationKeys.textRecipient),
                                    style:
                                    Theme
                                        .of(context)
                                        .textTheme
                                        .bodyMedium),
                              )),
                          Expanded(
                              flex: 4,
                              child: Padding(
                                padding: const EdgeInsets.only(
                                    left: 12.0, right: 12.0),
                                child: Column(
                                  crossAxisAlignment: CrossAxisAlignment.end,
                                  children: [
                                    Text(
                                      controller.transactionSubmitRequestModel
                                          .value.crMbmBkmstitle,
                                      style: Theme
                                          .of(context)
                                          .textTheme
                                          .titleSmall,
                                    ),
                                    const SizedBox(height: 5),
                                    Text(
                                      controller.transactionSubmitRequestModel
                                          .value.crMbmBkmsnumber,
                                      style:
                                      Theme
                                          .of(context)
                                          .textTheme
                                          .bodySmall,
                                    ),
                                  ],
                                ),
                              )),
                        ],
                      )),
                ),
              ),
              const SizedBox(height: 20),
              Padding(
                padding: const EdgeInsets.only(top: 80, left: 20, right: 20),
                child: Card(
                  color: AppColors.colorGrey50,
                  margin:
                  const EdgeInsets.symmetric(horizontal: 10, vertical: 20),
                  elevation: 5.0,
                  child: Container(
                      padding: const EdgeInsets.all(15),
                      decoration: const BoxDecoration(
                          borderRadius: BorderRadius.all(
                              Radius.circular(10)) // Add border radius
                      ),
                      child: Column(
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: [
                          Text(
                              TranslationKeys.makeTranslation(
                                  TranslationKeys.textConformation),
                              style: Theme
                                  .of(context)
                                  .textTheme
                                  .titleSmall
                                  ?.copyWith(
                                  fontWeight: FontWeight.w600,
                                  fontSize: 20)),
                          const SizedBox(height: 10),
                          Row(
                            children: [
                              Expanded(
                                  flex: 2,
                                  child: Padding(
                                    padding: const EdgeInsets.all(8.0),
                                    child: Column(
                                      crossAxisAlignment:
                                      CrossAxisAlignment.start,
                                      children: [
                                        Text(
                                            TranslationKeys.makeTranslation(
                                                TranslationKeys
                                                    .textAccountNumber),
                                            style: Theme
                                                .of(context)
                                                .textTheme
                                                .bodyMedium),
                                        const SizedBox(height: 10),
                                        Text(
                                            TranslationKeys.makeTranslation(
                                                TranslationKeys
                                                    .textSendingAmount),
                                            style: Theme
                                                .of(context)
                                                .textTheme
                                                .bodyMedium),
                                        const SizedBox(height: 10),
                                        Text(
                                            TranslationKeys.makeTranslation(
                                                TranslationKeys.textCurrency),
                                            style: Theme
                                                .of(context)
                                                .textTheme
                                                .bodyMedium),
                                        const SizedBox(height: 10),
                                        Text(
                                            TranslationKeys.makeTranslation(
                                                TranslationKeys.textMessage),
                                            style: Theme
                                                .of(context)
                                                .textTheme
                                                .bodyMedium),
                                      ],
                                    ),
                                  )),
                              Expanded(
                                  flex: 2,
                                  child: Padding(
                                    padding: const EdgeInsets.only(
                                        left: 12.0, right: 12.0),
                                    child: Column(
                                      crossAxisAlignment:
                                      CrossAxisAlignment.end,
                                      mainAxisAlignment: MainAxisAlignment.end,
                                      children: [
                                        Text(
                                            controller
                                                .transactionSubmitRequestModel
                                                .value
                                                .crMbmBkmsnumber,
                                            style: Theme
                                                .of(context)
                                                .textTheme
                                                .bodySmall),
                                        const SizedBox(height: 10),
                                        Text(
                                            controller
                                                .transactionSubmitRequestModel
                                                .value
                                                .sgtGntramtfc
                                                .toString(),
                                            style: Theme
                                                .of(context)
                                                .textTheme
                                                .bodySmall),
                                        const SizedBox(height: 10),
                                        Text(
                                            controller
                                                .transactionSubmitRequestModel
                                                .value
                                                .crPcrCurrdesc,
                                            style: Theme
                                                .of(context)
                                                .textTheme
                                                .bodySmall),
                                        const SizedBox(height: 10),
                                        Text(
                                            controller
                                                .transactionSubmitRequestModel
                                                .value
                                                .otdTrancomment,
                                            style: Theme
                                                .of(context)
                                                .textTheme
                                                .bodySmall),
                                      ],
                                    ),
                                  )),
                            ],
                          ),
                          const SizedBox(height: 10),
                          Row(
                            mainAxisAlignment: MainAxisAlignment.spaceAround,
                            children: [
                              CustomButton(
                                onPressed: () {
                                  controller.sendTransaction();
                                },
                                buttonText: TranslationKeys.makeTranslation(
                                    TranslationKeys.textConfirm),
                                buttonColor: AppColors.colorButton,
                                buttonPadding: const EdgeInsets.symmetric(
                                    vertical: 5, horizontal: 20),
                              ),
                              CustomButton(
                                  onPressed: () {
                                    Get.back();
                                  },
                                  buttonText: TranslationKeys.makeTranslation(
                                      TranslationKeys.textCancel),
                                  buttonColor: AppColors.colorSkipBtn,
                                  textStyle: Theme
                                      .of(context)
                                      .textTheme
                                      .labelLarge
                                      ?.copyWith(color: AppColors.black),
                                  sideBorder: const BorderSide(
                                      width: 1,
                                      color: AppColors.colorBorderSkipBtn),
                                  buttonPadding: const EdgeInsets.symmetric(
                                      vertical: 5, horizontal: 20)),
                            ],
                          ),
                        ],
                      )),
                ),
              ),
            ]),
          ],
        );
      }),
    );
  }
}
