import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:sefer_admin1/views/admin/captain/register_captain.dart';
import 'package:sefer_admin1/views/widgets/my_scafold.dart';

import '../../../constant/colors.dart';
import '../../../controller/admin/register_captain_controller.dart';

class DriversCantRegister extends StatelessWidget {
  const DriversCantRegister({super.key});

  @override
  Widget build(BuildContext context) {
    Get.put(RegisterCaptainController());
    return MyScafolld(
        title: 'drivers cant register'.tr,
        body: [
          GetBuilder<RegisterCaptainController>(builder: (mainController) {
            return ListView.builder(
              itemCount: mainController.driverNotCompleteRegistration.length,
              itemBuilder: (context, index) {
                final driver =
                    mainController.driverNotCompleteRegistration[index];
                return Padding(
                  padding: const EdgeInsets.all(8.0),
                  child: InkWell(
                    onTap: () {
                      Get.to(() => RegisterCaptain(), arguments: {
                        "phone_number": driver['phone_number'].toString(),
                        'driverId': driver['driverId'].toString(),
                        'email': driver['email'].toString(),
                      });
                    },
                    child: Container(
                      color: driver['note'] == null
                          ? AppColor.greenColor
                          : AppColor.accentColor,
                      child: Column(
                        children: [
                          Text(driver['phone_number'].toString()),
                          Text(driver['driverId'].toString()),
                          Text(driver['email'].toString()),
                        ],
                      ),
                    ),
                  ),
                );
              },
            );
          }),
        ],
        isleading: true);
  }
}
