import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:traderscircuit/Utils/Common/CommonAppbar.dart';
import 'package:traderscircuit/Utils/text.dart';
import 'package:traderscircuit/model/AboutUsModel/about_us_model.dart';
import 'package:traderscircuit/view/onBoarding/splashScreen1.dart';
import 'package:traderscircuit/view_model/AboutApi/about_api.dart';

class AboutUs extends StatefulWidget {
  const AboutUs({super.key});

  @override
  State<AboutUs> createState() => _AboutUsState();
}

class _AboutUsState extends State<AboutUs> {
  RxBool isLoading = true.obs;
  AboutUsModel aboutUsModel = AboutUsModel();

  @override
  void initState() {
    AboutUsApi().getAboutUsData().then((value) {
      aboutUsModel = AboutUsModel.fromJson(value.data);
      isLoading.value = false;
    });
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: const CommonAppbar(
        titleTxt: "About Us",
      ),
      backgroundColor: Colors.black,
      extendBody: true,
      body: Obx(
        () => Stack(
          children: [
            const CommonBlurLeft(),
            const CommonBlurRight(),
            isLoading.value
                ? const Center(
                    child: CircularProgressIndicator(
                      color: Color(0xFF9A0000),
                    ),
                  )
                : Stack(
                    children: [
                      Padding(
                        padding: const EdgeInsets.symmetric(
                            horizontal: 16, vertical: 16),
                        child: ListView(
                          physics: const BouncingScrollPhysics(),
                          // mainAxisAlignment: MainAxisAlignment.start,
                          // crossAxisAlignment: CrossAxisAlignment.start,

                          children: [
                            //  CommonDropdownBtn(hint: "hint", items: ["hi", "hii"]),
                            SizedBox(
                              height: 10.h,
                            ),
                            text16W400(
                              aboutUsModel.data!.content!,
                            ),
                            SizedBox(
                              height: 10.h,
                            ),
                          ],
                        ),
                      ),
                    ],
                  ),
          ],
        ),
      ),
    );
  }
}
