import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:get/get_core/src/get_main.dart';
import 'package:location/dialog/agreement_dialog.dart';
import 'package:location/resource/assets.gen.dart';
import 'package:location/utils/app_info_util.dart';
import 'package:location/utils/common_expand.dart';

import '../../base/base_page.dart';
import '../../resource/string.gen.dart';
import '../../router/app_pages.dart';
import '../../widget/common_view.dart';
import 'about_controller.dart';

class AboutPage extends BasePage<AboutController> {
  const AboutPage({super.key});

  static void start() {
    Get.toNamed(RoutePath.about);
  }

  @override
  Widget buildBody(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.center,
      children: [
        CommonView.buildAppBar(StringName.mineFunAbout,
            backOnTap: controller.back, titleCenter: false),
        SizedBox(height: 48.w),
        Assets.images.iconLogo.image(width: 70.w, height: 70.w),
        SizedBox(height: 8.w),
        Text(StringName.appName,
            style: TextStyle(fontSize: 14.sp, color: Colors.black)),
        SizedBox(height: 2.w),
        Text('当前版本：${appInfoUtil.appVersionName}',
            style: TextStyle(fontSize: 12.sp, color: '#A7A7A7'.color)),
        Spacer(),
        Row(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            GestureDetector(
              onTap: () => controller.onPrivacyPolicyClick(),
              child: Text(StringName.privacyPolicy,
                  style: TextStyle(fontSize: 12.sp, color: '#579AFF'.color)),
            ),
            Text(StringName.loginEtPrivacyAnd,
                style: TextStyle(fontSize: 12.sp, color: '#A7A7A7'.color)),
            GestureDetector(
              onTap: () => controller.onTermOfServiceClick(),
              child: Text(StringName.termOfService,
                  style: TextStyle(fontSize: 12.sp, color: '#579AFF'.color)),
            ),
          ],
        ),
        SizedBox(height: 1.w),
        Text(StringName.recordNumber,
            style: TextStyle(fontSize: 12.sp, color: '#A7A7A7'.color)),
        SizedBox(height: 52.w),
      ],
    );
  }
}
