import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:ride/constant/colors.dart';
import 'package:ride/constant/style.dart';
import 'package:ride/controller/auth/captin/register_captin_controller.dart';
import 'package:ride/views/widgets/elevated_btn.dart';
import 'package:ride/views/widgets/my_scafold.dart';

class VerifyEmailCaptainPage extends StatelessWidget {
  VerifyEmailCaptainPage({super.key});
  RegisterCaptainController registerCaptinController =
      Get.put(RegisterCaptainController());
  @override
  Widget build(BuildContext context) {
    return MyScafolld(
      title: 'Verify Email For Captain'.tr,
      body: [
        Positioned(
            top: 10,
            left: 20,
            child: Text(
              'We sent 5 digit to your Email provided'.tr,
              style: AppStyle.title.copyWith(fontSize: 20),
            )),
        GetBuilder<RegisterCaptainController>(
            builder: (controller) => Positioned(
                  top: 100,
                  left: 80,
                  right: 80,
                  child: Padding(
                    padding: const EdgeInsets.all(10),
                    child: Column(
                      children: [
                        SizedBox(
                          width: 100,
                          child: TextField(
                            controller: registerCaptinController.verifyCode,
                            decoration: InputDecoration(
                              labelStyle: AppStyle.title,
                              border: const OutlineInputBorder(),
                              hintText: '5 digit'.tr,
                              counterStyle: AppStyle.number,
                              hintStyle: AppStyle.subtitle
                                  .copyWith(color: AppColor.accentColor),
                            ),
                            maxLength: 5,
                            keyboardType: TextInputType.number,
                          ),
                        ),
                        const SizedBox(
                          height: 30,
                        ),
                        MyElevatedButton(
                            title: 'Send Verfication Code'.tr,
                            onPressed: () {
                              registerCaptinController.sendVerifications();
                            })
                      ],
                    ),
                  ),
                )),
      ],
      isleading: true,
    );
  }

  Padding verifyEmail() {
    return Padding(
      padding: const EdgeInsets.symmetric(horizontal: 10),
      child: Container(
        decoration: BoxDecoration(
          border: Border.all(
            color: AppColor.accentColor,
            width: 2,
          ),
          borderRadius: BorderRadius.circular(8),
        ),
        child: const Padding(
          padding: EdgeInsets.all(10),
          child: SizedBox(
            width: 20,
            child: TextField(
              maxLength: 1,
              keyboardType: TextInputType.number,
            ),
          ),
        ),
      ),
    );
  }
}
