import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
import 'package:uco_mobile_poc/app/core/constants/app_assets.dart';
import 'package:uco_mobile_poc/app/core/constants/form_field_constants.dart';
import 'package:uco_mobile_poc/app/core/constants/translation_keys.dart';
import 'package:uco_mobile_poc/app/custom_widgets/custom_date_time_picker.dart';
import 'package:uco_mobile_poc/app/custom_widgets/custom_dropdown.dart';
import 'package:uco_mobile_poc/app/custom_widgets/custom_input_field.dart';
import 'package:uco_mobile_poc/app/custom_widgets/custom_toasty.dart';
import 'package:uco_mobile_poc/app/modules/login/views/shared/login_widget.dart';
import 'package:uco_mobile_poc/app/res/app_colors.dart';
import 'package:uco_mobile_poc/app/routes/app_pages.dart';

import '../controllers/sample_fields_controller.dart';

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

  @override
  Widget build(BuildContext context) {
    controller.context = context;
    String className = runtimeType.toString().split('.').last;
    return Scaffold(
      persistentFooterButtons: [
        BottomNavigationBar(
          backgroundColor: AppColors.colorSecondary.withOpacity(0.1),
          elevation: 0,
          type: BottomNavigationBarType.fixed,
          items: [
            BottomNavigationBarItem(
              icon: LoginWidgets.bottomTabs(
                context,
                TranslationKeys.makeTranslation(TranslationKeys.textFindUAgent),
                AppAssets.ic_cyber_security,
                () {
                  Get.toNamed(Routes.O_T_P_SCREEN);
                  // LoginWidgets.showBottomSheet(context, BottomSheetLogin.options, (index) {
                  //   BottomSheetLogin option = BottomSheetLogin.options[index];
                  //   if (option.description == TranslationKeys.makeTranslation(TranslationKeys.textLogin)) {}
                  // });
                },
                context.textTheme.bodySmall!.copyWith(fontSize: 12),
              ),
              label: '',
            ),
            BottomNavigationBarItem(
              icon: LoginWidgets.bottomTabs(context, TranslationKeys.makeTranslation(TranslationKeys.textQRPay), AppAssets.ic_QR, () {
                // LoginWidgets.showBottomSheet(context, BottomSheetLogin.options, (index) {
                // BottomSheetLogin option = BottomSheetLogin.options[index];
                // if (option.description == TranslationKeys.makeTranslation(TranslationKeys.textLogin)) {}
                // });
                Toasty.success("Coming Soon.....");
              }, context.textTheme.bodySmall!.copyWith(fontSize: 12)),
              label: '',
            ),
            BottomNavigationBarItem(
              icon: LoginWidgets.bottomTabs(context, TranslationKeys.makeTranslation(TranslationKeys.textHelp), AppAssets.ic_client, () {
                Toasty.success("Coming Soon.....");
              }, context.textTheme.bodySmall!.copyWith(fontSize: 12)),
              label: '',
            ),
            // BottomNavigationBarItem(
            //   icon: LoginWidgets.bottomTabs(context, TranslationKeys.makeTranslation(TranslationKeys.textContactUs), AppAssets.ic_contact_us, () {
            //     showBottomSheet(context);
            //   }),
            //   label: '',
            // ),
          ],
        ),
      ],
      body: SingleChildScrollView(
        child: Column(
          children: [
            GestureDetector(
                onTap: () {
                  // showCurrencyDialog(context);
                },
                child: Align(alignment: Alignment.centerRight, child: Padding(padding: const EdgeInsets.only(right: 8.0, left: 8.0), child: Container(decoration: const BoxDecoration(color: AppColors.colorPrimary, borderRadius: BorderRadius.only(bottomLeft: Radius.circular(20), bottomRight: Radius.circular(20))), height: 60, width: 30, child: Padding(padding: const EdgeInsets.only(top: 28.0), child: SvgPicture.asset(AppAssets.ic_arrow_down, height: 20, width: 20)))))),
            Padding(
              padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 0),
              child: Column(
                children: [
                  const SizedBox(height: 20),
                  SvgPicture.asset(AppAssets.lg_logo_black, height: 100, width: 100),
                  const SizedBox(height: 10),
                  controller.userNameField = CustomInputFieldCustom(
                    refKey: FormFieldConstants.instance().getFormKey("${className}userNameField"),
                    controller: FormFieldConstants.instance().getController("${className}userNameField"),
                    labelText: "User Name",
                  ),
                  const SizedBox(height: 10),
                  controller.passwordField = CustomInputFieldCustom(
                    refKey: FormFieldConstants.instance().getFormKey("${className}passwordField"),
                    controller: FormFieldConstants.instance().getController("${className}passwordField"),
                    labelText: "Password",
                    requiredPasswordIcon: true,
                    isPassword: true,
                  ),
                  const SizedBox(height: 10),
                  controller.dateField = CustomDateTimePicker(
                    refKey: FormFieldConstants.instance().getFormKey("${className}dateField"),
                    controller: FormFieldConstants.instance().getController("${className}dateField"),
                    labelText: "picker",
                  ),
                  const SizedBox(height: 10),
                  controller.genderField = CustomDropDown(
                    listData: [DropDown("id1", "Label1"), DropDown("id2", "Label2"), DropDown("id3", "Label3")].obs,
                    labelText: "Gender",
                    isRequired: true,
                  ),
                ],
              ),
            )
          ],
        ),
      ),
    );
  }
}
