import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:tone_snap/components/base_appbar.dart';
import 'package:tone_snap/generated/assets.dart';
import 'package:tone_snap/modules/sidea/upload_method/upload_mothod_controller.dart';

class UploadMethodView extends StatelessWidget {
  UploadMethodView({super.key});

  final controller = Get.find<UploadMethodController>();

  @override
  Widget build(BuildContext context) {
    Get.put(UploadMethodController());
    final labelTextStyle = TextStyle(
      color: Colors.white,
      fontSize: 20.sp,
      fontWeight: FontWeight.bold,
    );
    return Stack(
      children: [
        Image.asset(
          Assets.sideAUploadMethodBg,
          width: 1.sw,
          height: 1.sh,
          fit: BoxFit.fill,
        ),
        Scaffold(
          backgroundColor: Colors.transparent,
          appBar: const BaseAppBar('Upload method', backgroundColor: Colors.transparent),
          body: SingleChildScrollView(
            child: Center(
              child: Column(
                children: [
                  SizedBox(height: 88.h),
                  GestureDetector(
                    onTap: controller.goRecordSound,
                    child: Image.asset(
                      Assets.sideAUploadRecordSound,
                      width: 122.w,
                      height: 122.w,
                    ),
                  ),
                  SizedBox(height: 12.h),
                  Text(
                    'Record Sound',
                    style: labelTextStyle,
                  ),
                  SizedBox(height: 94.h),
                  GestureDetector(
                    onTap: controller.openFilePicker,
                    child: Image.asset(
                      Assets.sideAUploadPick,
                      width: 122.w,
                      height: 122.w,
                    ),
                  ),
                  SizedBox(height: 12.h),
                  Text(
                    'Pick From Files',
                    style: labelTextStyle,
                  ),
                ],
              ),
            ),
          ),
        )
      ],
    );
  }
}
