import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';


import '../../../core/constants/translation_keys.dart';
import '../../../custom_widgets/custom_app_bar.dart';
import '../../../res/app_colors.dart';
import '../controllers/faqs_controller.dart';
import '../controllers/faqs_third_screen_controller.dart';

class FaqsThirdScreenView extends GetView<FaqsController> {
  FaqsThirdScreenView({Key? key, this.description, this.title, this.shortTitle}) : super(key: key);

  var thirdScreenController = Get.find<FaqsThirdController>();

  String? title;
  String? shortTitle;
  String? description;

  @override
  Widget build(BuildContext context) {
    var faqs = controller.faqsModel;
    return Scaffold(
      appBar: DashBoardAppBar(
        title: TranslationKeys.makeTranslation(TranslationKeys.textFaqs),
        onBackButtonPressed: () {
          Get.back();
        },
      ),
      body: Padding(
        padding: const EdgeInsets.symmetric(horizontal: 20.0, vertical: 20.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text(thirdScreenController.subQuestion.title, style: Theme.of(context).textTheme.titleSmall?.copyWith(color: AppColors.black, fontSize: 20, fontWeight: FontWeight.w500)),
           const SizedBox(height: 10),
            Text(faqs.sendingMoney.first.questions.first.subQuestions.first.questionDetails.first.answer, style: Theme.of(context).textTheme.bodySmall?.copyWith( fontSize: 12, fontWeight: FontWeight.w400)),
            const SizedBox(height: 10),
            Text("How to send money with UCO", style: Theme.of(context).textTheme.titleSmall?.copyWith( fontSize: 18, fontWeight: FontWeight.w500, color: AppColors.black)),
            const SizedBox(height: 20),
            Expanded(
             flex: 4,
             child: ListView.builder(
               itemCount: controller.faqsModel.sendingMoney.first.questions.first.subQuestions.first.questionDetails.first.multipleOptions?.length,
               itemBuilder: (context, index) {
               return Column(
                 crossAxisAlignment: CrossAxisAlignment.start,
                 children: [
                   Text(faqs.sendingMoney.first.questions.first.subQuestions.first.questionDetails.first.multipleOptions![index].optionTitle, style: Theme.of(context).textTheme.titleSmall?.copyWith(color: AppColors.black, fontSize: 12, fontWeight: FontWeight.w700)),
                  const SizedBox(height: 10),
                   Text(faqs.sendingMoney.first.questions.first.subQuestions.first.questionDetails.first.multipleOptions![index].optionAnswer, style: Theme.of(context).textTheme.bodySmall?.copyWith(fontSize: 12, fontWeight: FontWeight.w400)),
                   const SizedBox(height: 10),
                 ],
               );
             },),
           ),
          ],
        ),
      ),
    );
  }
}
