import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
import '../../../core/constants/app_assets.dart';
import '../../../core/constants/translation_keys.dart';
import '../../../custom_widgets/custom_app_bar.dart';
import '../../../custom_widgets/custom_button.dart';
import '../../../res/app_colors.dart';
import '../../../routes/app_pages.dart';
import '../controllers/utility_bills_selected_category_controller.dart';

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

  @override
  Widget build(BuildContext context) {
    var args = Get.arguments;

    var icon = args["icon"];

    var type = args["billTypes"];

    return Scaffold(
      appBar: DashBoardAppBar(
        title: TranslationKeys.makeTranslation(TranslationKeys.transUtilityBillCategory),
        onBackButtonPressed: () {
          Get.back();
        },
      ),
      body: Column(
        children: [
          Stack(
            children: [
              Container(height: 50, decoration: BoxDecoration(color: AppColors.colorPrimary.withOpacity(0.98), borderRadius: const BorderRadius.only(bottomLeft: Radius.circular(40)))),
              Column(children: [
                Padding(
                  padding: const EdgeInsets.all(8.0),
                  child: Card(
                    surfaceTintColor: Colors.white,
                    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: 1,
                                child: Padding(
                                  padding: const EdgeInsets.all(8.0),
                                  child: Image.asset(AppAssets.ic_government),
                                )),
                            Expanded(
                                flex: 4,
                                child: Padding(
                                  padding: const EdgeInsets.only(left: 12.0),
                                  child: Column(
                                    crossAxisAlignment: CrossAxisAlignment.start,
                                    children: [
                                      Text(
                                        TranslationKeys.makeTranslation(TranslationKeys.transUtilityElectricity),
                                        style: Theme.of(context).textTheme.titleSmall,
                                      ),
                                      const SizedBox(height: 5),
                                      Text(
                                        TranslationKeys.makeTranslation(type),
                                        style: Theme.of(context).textTheme.bodySmall,
                                      ),
                                    ],
                                  ),
                                )),
                            Expanded(flex: 1, child: SvgPicture.asset(icon)),
                          ],
                        )),
                  ),
                ),
                // Align(
                //     alignment: AppSettingController.isRTL.value
                //         ? Alignment.centerRight
                //         : Alignment.centerLeft,
                //     child: Padding(
                //       padding:
                //       EdgeInsets.symmetric(horizontal: 20, vertical: 10),
                //       child: Text(
                //           TranslationKeys.makeTranslation(
                //               TranslationKeys.textEnterConsumerName),
                //           style: Theme.of(context).textTheme.titleSmall),
                //     )),
                Container(
                  margin: const EdgeInsets.symmetric(horizontal: 20, vertical: 18),
                  height: 40,
                  padding: const EdgeInsets.symmetric(horizontal: 3.0),
                  decoration: BoxDecoration(
                    color: Colors.white,
                    border: Border.all(color: Colors.grey),
                    borderRadius: BorderRadius.circular(20.0),
                  ),
                  child: Row(
                    crossAxisAlignment: CrossAxisAlignment.center,
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Expanded(
                        child: TextField(
                          style: Theme.of(context).textTheme.bodySmall?.copyWith(fontWeight: FontWeight.w400, fontSize: 12),
                          decoration: InputDecoration(
                            enabledBorder: InputBorder.none,
                            border: InputBorder.none,
                            focusedBorder: InputBorder.none,
                            hintText: TranslationKeys.makeTranslation(TranslationKeys.textEnterConsumerName),
                          ),
                          // onChanged: (value) => controller.filterList(value),
                        ),
                      ),
                    ],
                  ),
                ),
                Padding(
                  padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
                  child: CustomButton(
                    buttonColor: AppColors.colorButton,
                    onPressed: () {
                      Get.toNamed(
                        Routes.UTILITY_BILLS_SELECTED_CATEGORY_DETAILS,
                      );
                    },
                    buttonText: TranslationKeys.makeTranslation(TranslationKeys.textNext),
                    buttonPadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
                  ),
                ),
              ])
            ],
          ),
        ],
      ),
    );
  }
}
