import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:kaer_with_panels/app/widgets/hi_base_scaffold.dart';
import 'package:kaer_with_panels/app/widgets/kr_local_image.dart';
import 'package:kaer_with_panels/app/modules/hi_anti_lost/controllers/hi_anti_lost_controller.dart';

class HIAntiLostView extends GetView<HIAntiLostController> {
  const HIAntiLostView({super.key});

  @override
  Widget build(BuildContext context) {
    return HIBaseScaffold(
      child: Stack(
        fit: StackFit.expand,
        children: [
          Column(
            children: [
              Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  KrLocalImage(
                    imageName: 'lost-image',
                    imageType: ImageType.png,
                    width: 298.w,
                    height: 385.w,
                  ),
                ],
              ),

              SizedBox(height: 30.w),

              // Save Button
              GestureDetector(
                onTap: controller.saveImage,
                child: Container(
                  width: double.infinity,
                  margin: EdgeInsets.symmetric(horizontal: 40.w),
                  height: 44.h,
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                    color: Theme.of(context).primaryColor,
                    borderRadius: BorderRadius.circular(22.w),
                  ),
                  child: Text(
                    '保存到本地',
                    style: TextStyle(
                      color: Colors.black,
                      fontSize: 16.sp,
                      fontWeight: FontWeight.bold,
                    ),
                  ),
                ),
              ),

              SizedBox(height: 60.h),
            ],
          ),

          // 2. Bottom Button (Follow us on X)
          Positioned(
            bottom: 40.w,
            left: 0,
            right: 0,
            child: Center(
              child: GestureDetector(
                onTap: controller.openTwitter,
                child: KrLocalImage(
                  imageName: 'followX',
                  width: 140,
                  height: 30,
                  imageType: ImageType
                      .png, // Assuming it is png as user said followX.png
                ),
              ),
            ),
          ),

        ],
      ),
    );
  }
}
