import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:SEFER/constant/style.dart';
import 'package:SEFER/views/widgets/mycircular.dart';

import '../../../../controller/home/captin/help/help_controller.dart';
import '../../../widgets/my_scafold.dart';

class HelpDetailsReplayPage extends StatelessWidget {
  const HelpDetailsReplayPage({super.key});

  @override
  Widget build(BuildContext context) {
    Get.find<HelpController>();
    return GetBuilder<HelpController>(
        builder: (helpController) => MyScafolld(
              title: 'Help Details'.tr,
              body: [
                helpController.isLoading
                    ? const MyCircularProgressIndicator()
                    : Column(
                        children: [
                          Padding(
                            padding: const EdgeInsets.symmetric(horizontal: 10),
                            child: Row(
                                mainAxisAlignment: MainAxisAlignment.start,
                                children: [
                                  Card(
                                    elevation: 3,
                                    child: Container(
                                      width: Get.width * .66,
                                      color: Colors.transparent,
                                      child: Padding(
                                        padding: const EdgeInsets.all(8.0),
                                        child: Text(
                                          helpController.qustion,
                                          style: AppStyle.title,
                                        ),
                                      ),
                                    ),
                                  ),
                                ]),
                          ),
                          Row(
                              mainAxisAlignment: MainAxisAlignment.end,
                              children: [
                                Card(
                                  elevation: 3,
                                  child: Container(
                                    color: Colors.transparent,
                                    width: Get.width * .66,
                                    child: Padding(
                                      padding: const EdgeInsets.all(8.0),
                                      child: helpController.status ==
                                                  'not yet' ||
                                              helpController
                                                      .helpQuestionRepleyDate[
                                                          'message']['replay']
                                                      .toString() ==
                                                  'not yet'
                                          ? Text(
                                              'No Response yet.'.tr,
                                              style: AppStyle.title,
                                            )
                                          : Text(
                                              helpController
                                                  .helpQuestionRepleyDate[
                                                      'message']['replay']
                                                  .toString(),
                                              style: AppStyle.title,
                                            ),
                                    ),
                                  ),
                                ),
                              ]),
                        ],
                      )
              ],
              isleading: true,
            ));
  }
}
