import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../../../constant/style.dart';
import '../../../controller/home/map_passenger_controller.dart';
import 'hexegone_clipper.dart';

GetBuilder<MapPassengerController> hexagonClipper() {
  return GetBuilder<MapPassengerController>(
      builder: ((controller) => controller.rideConfirm
          ? Positioned(
              top: Get.height * .1,
              left: Get.width * .1,
              right: Get.width * .1,
              child: ClipPath(
                clipper:
                    HexagonClipper(), // CustomClipper to create a hexagon shape
                child: AnimatedContainer(
                  duration: const Duration(microseconds: 300),
                  height: 250,
                  width: 250,
                  // decoration: AppStyle.boxDecoration,
                  // gradient: const LinearGradient(
                  //   colors: [AppColor.greenColor, AppColor.secondaryColor],
                  //   begin: Alignment.topLeft,
                  //   end: Alignment.bottomCenter,
                  // ),
                  // border: Border.all(),
                  // color: AppColor.secondaryColor,
                  // borderRadius: BorderRadius.circular(15)),
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: [
                      Text(
                        'Waiting for Driver ...'.tr,
                        style: AppStyle.title,
                      ),
                      // IconButton(
                      //   onPressed: () {
                      //   },
                      //   icon: const Icon(Icons.add),
                      // ),
                      // Text(
                      //   controller.dataCarsLocationByPassenger['message']
                      //           [controller.carsOrder]['phone']
                      //       .toString(),
                      //   style: AppStyle.title,
                      // ),
                      Row(
                        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                        children: [
                          Text(
                            '${controller.dataCarsLocationByPassenger['message'][controller.carsOrder]['first_name']} ${controller.dataCarsLocationByPassenger['message'][controller.carsOrder]['last_name']}',
                            style: AppStyle.title,
                          ),
                          Text(
                            'Age is  '.tr +
                                controller
                                    .dataCarsLocationByPassenger['message']
                                        [controller.carsOrder]['age']
                                    .toString(),
                            style: AppStyle.title,
                          ),
                        ],
                      ),
                      Row(
                        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                        children: [
                          Text(
                            controller.dataCarsLocationByPassenger['message']
                                    [controller.carsOrder]['make']
                                .toString(),
                            style: AppStyle.title,
                          ),
                          Text(
                            controller.dataCarsLocationByPassenger['message']
                                    [controller.carsOrder]['model']
                                .toString(),
                            style: AppStyle.title,
                          ),
                        ],
                      ),
                      Text(
                        'Rating is  '.tr +
                            controller.dataCarsLocationByPassenger['message']
                                    [controller.carsOrder]['ratingDriver']
                                .toString(),
                        style: AppStyle.title,
                      ),
                      Container(
                        decoration: BoxDecoration(border: Border.all(width: 2)),
                        child: Text(
                          controller.dataCarsLocationByPassenger['message']
                                  [controller.carsOrder]['car_plate']
                              .toString(),
                          style: AppStyle.title,
                        ),
                      ),
                    ],
                  ),
                ),
              ),
            )
          : const SizedBox()));
}
