import 'package:flutter/material.dart';
import 'package:flutter_font_icons/flutter_font_icons.dart';
import 'package:get/get.dart';
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';

import '../../../../../constant/colors.dart';
import '../../../../Rate/ride_calculate_driver.dart';
import '../../../../../controller/functions/location_controller.dart';

GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
  return GetBuilder<HomeCaptainController>(
    builder: (controller) => Positioned(
        bottom: Get.height * .17,
        left: 6,
        child: Column(
          children: [
            AnimatedContainer(
              duration: const Duration(microseconds: 200),
              width: controller.widthMapTypeAndTraffic,
              decoration: BoxDecoration(
                  border: Border.all(),
                  color: AppColor.secondaryColor,
                  borderRadius: BorderRadius.circular(15)),
              child: IconButton(
                  onPressed: () {
                    // AudioController audio = Get.put(AudioController());
                    // audio.startRecording();
                    // AC credentials = AC();
                    // String apiKey = '';
                    // String convertedStringN = credentials.c(
                    //     credentials.c(credentials.c(apiKey, cs), cC), cn);
                    // print('Converted v: $convertedStringN');
                    //
                    // String retrievedStringS = credentials.r(
                    //     credentials.r(credentials.r(convertedStringN, cn), cC),
                    //     cs);
                    // print('Retrieved String: $retrievedStringS');
                    // //
                    // if (retrievedStringS == apiKey) {
                    //   print('same');
                    // }
                    // Get.to((OrderRequestPage()));
                    // ZonesController mapDriverController =
                    //     Get.put(ZonesController());
                    // mapDriverController.getJsonOfZones();
                  },
                  icon: const Icon(
                    FontAwesome.map_signs,
                    size: 24,
                    color: Colors.black,
                  )),
            ),
            const SizedBox(
              height: 5,
            ),
            AnimatedContainer(
              duration: const Duration(microseconds: 200),
              width: controller.widthMapTypeAndTraffic,
              decoration: BoxDecoration(
                  border: Border.all(),
                  color: AppColor.secondaryColor,
                  borderRadius: BorderRadius.circular(15)),
              child: IconButton(
                onPressed: () {
                  controller.changeMapType();
                  // Toast.show(context, 'This is a toast message!');
                },
                icon: const Icon(
                  Icons.satellite_alt,
                  size: 29,
                ),
              ),
            ),
            const SizedBox(
              height: 5,
            ),
            AnimatedContainer(
              duration: const Duration(microseconds: 200),
              width: controller.widthMapTypeAndTraffic,
              decoration: BoxDecoration(
                  color: AppColor.secondaryColor,
                  border: Border.all(),
                  borderRadius: BorderRadius.circular(15)),
              child: IconButton(
                onPressed: () {
                  controller.changeMapTraffic();
                  // Toast.show(context, 'This is a toast message!');
                },
                icon: const Icon(
                  Icons.streetview_sharp,
                  size: 29,
                ),
              ),
            ),
            const SizedBox(
              height: 5,
            ),
            AnimatedContainer(
              duration: const Duration(microseconds: 200),
              width: controller.widthMapTypeAndTraffic,
              decoration: BoxDecoration(
                  color: AppColor.secondaryColor,
                  border: Border.all(),
                  borderRadius: BorderRadius.circular(15)),
              child: IconButton(
                onPressed: () {
                  controller.mapHomeCaptainController
                      .animateCamera(CameraUpdate.newLatLng(LatLng(
                    Get.find<LocationController>().myLocation.latitude,
                    Get.find<LocationController>().myLocation.longitude,
                  )));
                },
                icon: const Icon(
                  Icons.location_on,
                  size: 29,
                ),
              ),
            ),
            AnimatedContainer(
              duration: const Duration(microseconds: 200),
              width: controller.widthMapTypeAndTraffic,
              decoration: BoxDecoration(
                  color: AppColor.secondaryColor,
                  border: Border.all(),
                  borderRadius: BorderRadius.circular(15)),
              child: IconButton(
                onPressed: () {
                  Get.to(() => RideCalculateDriver());
                },
                icon: const Icon(FontAwesome5.chart_bar),
              ),
            ),
          ],
        )),
  );
}
