import 'package:clean/base/base_page.dart';
import 'package:clean/base/base_view.dart';
import 'package:clean/data/consts/constants.dart';
import 'package:clean/module/setting/setting_controller.dart';
import 'package:flutter/Material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

import '../../resource/assets.gen.dart';
import '../browser/browser_view.dart';

class SettingPage extends BasePage<SettingController> {
  const SettingPage({super.key});

  @override
  bool statusBarDarkFont() {
    return false;
  }

  @override
  bool immersive() {
    return true;
  }

  @override
  Widget buildBody(BuildContext context) {
    return Stack(
      children: [
        SafeArea(
          child: Container(
            padding: EdgeInsets.only(left: 16.w, top: 14.h, right: 16.w),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.start,
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                GestureDetector(
                  onTap: () {
                    Get.back();
                  },
                  child: Assets.images.iconCommonBack
                      .image(width: 28.w, height: 28.w),
                ),
                SizedBox(
                  height: 12.h,
                ),
                Text(
                  "Settings",
                  style: TextStyle(
                    color: Colors.white,
                    fontSize: 24.sp,
                    fontWeight: FontWeight.w700,
                  ),
                ),
                SizedBox(
                  height: 25.h,
                ),
                Container(
                  height: 124.h,
                  width: 328.w,
                  decoration: BoxDecoration(
                    color: Colors.white.withOpacity(0.12),
                    borderRadius: BorderRadius.all(
                      Radius.circular(10.r),
                    ),
                  ),
                  child: Column(
                    children: [
                      GestureDetector(
                        onTap: () {
                          BrowserPage.start(Constants.privacyPolicy);
                        },
                        child: SizedBox(
                          height: 62.h,
                          child: Row(
                            children: [
                              SizedBox(
                                width: 13.w,
                              ),
                              Assets.images.iconSettingPrivacy
                                  .image(width: 20.w, height: 20.w),
                              SizedBox(
                                width: 8.w,
                              ),
                              Text(
                                "Privacy Policy",
                                style: TextStyle(
                                  color: Colors.white,
                                  fontSize: 16.sp,
                                  fontWeight: FontWeight.w500,
                                ),
                              ),
                              Spacer(),
                              Icon(
                                Icons.arrow_forward,
                                color: Colors.white.withOpacity(0.55),
                              ),
                              SizedBox(
                                width: 15.w,
                              ),
                            ],
                          ),
                        ),
                      ),
                      Container(
                        margin: EdgeInsets.symmetric(horizontal: 16.w),
                        height: 1,
                        color: Colors.white.withOpacity(0.06),
                      ),
                      GestureDetector(
                        onTap: () {
                          BrowserPage.start(Constants.userAgreement);
                        },
                        child: SizedBox(
                          height: 61.h,
                          child: Row(
                            children: [
                              SizedBox(
                                width: 13.w,
                              ),
                              Assets.images.iconSettingAgreement
                                  .image(width: 20.w, height: 20.w),
                              SizedBox(
                                width: 8.w,
                              ),
                              Text(
                                "User Agreement",
                                style: TextStyle(
                                  color: Colors.white,
                                  fontSize: 16.sp,
                                  fontWeight: FontWeight.w500,
                                ),
                              ),
                              Spacer(),
                              Icon(
                                Icons.arrow_forward,
                                color: Colors.white.withOpacity(0.55),
                              ),
                              SizedBox(
                                width: 15.w,
                              ),
                            ],
                          ),
                        ),
                      )
                    ],
                  ),
                )
              ],
            ),
          ),
        ),
        IgnorePointer(
          child: Assets.images.bgHome.image(
            width: 360.w,
          ),
        ),
      ],
    );
  }
}
