import 'package:betting/commom/utils/color_utils.dart';
import 'package:betting/commom/widget/loading_custom.dart';
import 'package:betting/view/mobile/splash/started/started_controller.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

import '../../../../commom/app_cache.dart';
import '../../../../routes/app_pages.dart';


class StartedPage extends GetView<StartedController> {
  @override
  final controller = Get.put(StartedController());

  StartedPage({super.key});

  @override
  Widget build(BuildContext context) {
    return  Scaffold(
      backgroundColor: Colors.black,
      resizeToAvoidBottomInset: true,
      body: Obx(() => controller.isReady.value?Container(
        decoration: const BoxDecoration(
          image: DecorationImage(
            image: AssetImage("assets/images/background_app_betting.jpg"),
            fit: BoxFit.cover,
          ),
        ),
        child: Column(
          children: [
            Expanded(child: Container()),
            Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Text("Welcome to Betting",
                    textAlign: TextAlign.center,
                    style: TextStyle(
                        fontSize: 35.sp,
                        color: Colors.white,
                        fontFamily: 'assets/font/static/Inter-Medium.ttf',
                        fontWeight: FontWeight.w500)),
                Container(
                  margin: EdgeInsets.only(top: 16.h,left: 16.w,right: 16.w),
                  child:  Text(
                    'We and our partners store and/or access information on a device, such as unique IDs in cookies to process personal data. You may accept or manage your choices by clicking below, including your right to object where legitimate interest is used, or at any time in the privacy policy page. These choices will be signaled to our partners and will not affect browsing data.',
                    textAlign: TextAlign.center,
                    style: TextStyle(
                        color: const Color.fromRGBO(133, 133, 133, 1),
                        fontSize: 14.sp,
                        fontFamily: 'static/Inter-Regular.ttf'),
                  ),
                ),
              ],
            ),
            Expanded(child: Container()),
            Container(
              margin: EdgeInsets.fromLTRB(16.w, 0.h, 16.w, 32.h),
              width: double.infinity,
              height: 32.h,
              child: ElevatedButton(
                  onPressed: () {

                    controller.requestToken();
                  },
                  style: ElevatedButton.styleFrom(
                      shape: RoundedRectangleBorder(
                          borderRadius: BorderRadius.circular(6)),
                      backgroundColor: ColorUtils.PRIMARY_COLOR),
                  child:  Text(
                    'Get Started',
                    style: TextStyle(fontSize: 16.sp,color: Colors.black),
                  )),
            ),
          ],
        ),
      ):const LoadingCustom()),
    );
  }
}
