
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:shimmer/shimmer.dart';
import '../../../../Controller/Createorder/Createordercontroller.dart';
import '../../../../Controller/Dashboard/Drop/Tabs/Tenantcustomers/Customeraddress/Addcustomer/Addcustomercontroller.dart';
import '../../../../Controller/Dashboard/Drop/Tabs/Tenantcustomers/Tenantcustomercontroller.dart';
import '../../../../Helper/Constants/Assetconstants.dart';
import '../../../../Helper/Constants/Colorconstants.dart';
import '../../../../Helper/Logger.dart';
import '../../../../Helper/toast.dart';
import '../../../../Helper/utility.dart';
import '../../Createorderview.dart';

// class DropCustomerTabView extends StatelessWidget {
//   final int tabIndex;
//
//   DropCustomerTabView({super.key, this.tabIndex = 0});
//
//   DropCustomerTabController dropCustomerTabController = Get.put(DropCustomerTabController());
//   AddDropCustomerController addDropCustomerController = Get.put(AddDropCustomerController());
//
//
//   @override
//   Widget build(BuildContext context) {
//     return GetBuilder<DropCustomerTabController>(
//         initState: (_){
//           if (tabIndex != 0) {
//             print('tabindex ${tabIndex}');
//             dropCustomerTabController.tabIndex =tabIndex;
//           }
//           // orderMainController.tabIndex = tabIndex;
//           dropCustomerTabController.tabController.index = tabIndex;
//           dropCustomerTabController.tabController.addListener(() {
//             if (!dropCustomerTabController.tabController.indexIsChanging) {
//               // dropCustomerTabController.update();
//               dropCustomerTabController.tabIndex = dropCustomerTabController.tabController.index;
//             }
//           });
//
//         },
//         builder: (controller) {
//           return Scaffold(
//             backgroundColor: Colors.grey[100],
//             appBar: AppBar(
//               leading: Padding(
//                 padding: const EdgeInsets.all(5.0),
//                 child:InkWell(
//                     onTap: (){
//
//                       Get.back();
//                     },
//                     child: Icon(Icons.reply,size: 30,color: ColorConstants.secondaryColor,)),
//               ),
//               titleSpacing: 0,
//
//               title: Row(
//                 children: [
//                   Text("Drop address",style: TextStyle(color: ColorConstants.secondaryColor)),
//                   const Spacer(),
//                   InkWell(
//                     onTap: () {
//                       addDropCustomerController.customerFirstNameController.clear();
//                       addDropCustomerController.customerLastNameController.clear();
//                       addDropCustomerController.customerPhoneController.clear();
//                       addDropCustomerController.addressController.clear() ;
//                       addDropCustomerController.doorNoController.clear() ;
//                       addDropCustomerController.landMarkController.clear() ;
//                       addDropCustomerController.predictions.clear();
//                       Get.to(AddCustomerView());
//                     },
//                     child:  Column(
//                       mainAxisAlignment: MainAxisAlignment.end,
//                       children: [
//                         Padding(
//                           padding: EdgeInsets.only(bottom: 3,right: 0),
//                           child: Icon(
//                             Icons.person_add_alt_rounded,
//                             size: 35,
//                             color: Colors.white,
//                           ),
//                         ),
//                       ],
//                     ),
//                   ),
//                   const SizedBox(width: 10,)
//                 ],
//               ),
//               elevation: 0,
//               backgroundColor: ColorConstants.primaryColor,
//               automaticallyImplyLeading: false,
//
//               // backwardsCompatibility: false,
//             ),
//             body: Stack(
//               children: [
//                 Column(
//                   mainAxisAlignment: MainAxisAlignment.start,
//                   crossAxisAlignment: CrossAxisAlignment.start,
//                   children: [
//                     TabBar(tabs: controller.tabs,unselectedLabelColor: ColorConstants.primaryColor,indicatorColor: ColorConstants.primaryColor,indicatorSize: TabBarIndicatorSize.tab,labelColor: ColorConstants.primaryColor,controller: controller.tabController, ),
//                     Expanded(
//                       child: TabBarView(
//                         controller: controller.tabController,
//                         physics: const NeverScrollableScrollPhysics(),
//                         children: [
//                           TenantDropCustomerView(),
//                           TenantDropTenantsView(),
//                         ],
//                       ),
//                     ),
//                   ],
//                 ),
//               ],
//             ),
//           );
//         }
//     );
//   }
// }


class DropCustomerView extends StatelessWidget {
  DropCustomerView({super.key});

  TenantDropCustomerController tenantDropCustomerController = Get.put(TenantDropCustomerController());
  CreateOrderController createOrderController = Get.put(CreateOrderController());
  final ScrollController scrollController = ScrollController();


  @override
  Widget build(BuildContext context) {

    void onScroll() {
      double maxScroll = scrollController.position.maxScrollExtent;
      double currentScroll = scrollController.position.pixels;

      if (maxScroll == currentScroll && tenantDropCustomerController.hasMore.value) {
        tenantDropCustomerController.getCustomerData();
      }
    }

    scrollController.addListener(onScroll);

    return  Scaffold(
      backgroundColor: Colors.grey[100],
      appBar: AppBar(
        leading: Padding(
          padding: const EdgeInsets.all(5.0),
          child:InkWell(
              onTap: (){
                Get.back();
              },
              child: Icon(Icons.reply,size: 30,color: ColorConstants.secondaryColor,)),
        ),
        titleSpacing: 0,

        title: Row(
          children: [
            Text("Saved address",style: TextStyle(color: ColorConstants.secondaryColor)),
          ],
        ),
        elevation: 0,
        backgroundColor: ColorConstants.primaryColor,
        automaticallyImplyLeading: false,
        // backwardsCompatibility: false,
      ),
      body: GetBuilder<TenantDropCustomerController>(
          initState: (_){
            tenantDropCustomerController.shimmer.value = true;
            // tenantDropCustomerController.getCustomerByTenantId();
            // tenantDropCustomerController.getCustomerData();
            tenantDropCustomerController.refreshData();

          },
          builder: (controller) {
            return Column(
              mainAxisAlignment: MainAxisAlignment.start,
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                Container(
                  padding: EdgeInsets.only(top: 10,bottom: 10),
                  decoration: BoxDecoration(color: ColorConstants.secondaryColor),
                  child: TextField(
                    controller: controller.searchController,
                    textAlignVertical: TextAlignVertical.center,
                    // focusNode: controller.focusNode,
                    onChanged: (data){
                      var keyword = data;
                      print('keyword................${keyword}');
                      if(data.isNotEmpty) {
                        controller.shimmer.value = true;
                        controller.getSearchCustomerData(keyword);
                      }
                      else{
                        controller.shimmer.value = true;
                        controller.refreshData();
                        FocusScope.of(context).unfocus();
                      }
                      controller.update();
                    },
                    decoration: InputDecoration(
                        prefixIcon: IconButton(
                          icon: const Icon(Icons.search),
                          color: Colors.grey[500]!,
                          onPressed: () {

                          },
                        ),
                        hintText: 'Search by customer',
                        hintStyle: TextStyle(
                          color: Colors.grey[500]!,


                        ),
                        suffixIcon: controller.searchController.text.isEmpty ? const SizedBox() : IconButton(
                          icon: const Icon(Icons.cancel),
                          color: Colors.grey[500]!,
                          onPressed: () {
                            controller.shimmer.value = true;
                            controller.refreshData();
                            FocusScope.of(context).unfocus();
                          },
                        ),
                        border: InputBorder.none),
                  ),
                ),
                controller.getCustomerBytenantId.isEmpty && !controller.shimmer.value
                    ? Center(
                    heightFactor: 3.0,
                    child: Column(
                      mainAxisAlignment: MainAxisAlignment.center,
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: [
                        Image(
                          height: 160,
                          width: 160,
                          image: AssetImage(AssetConstants.NoRecords),
                        ),
                        SizedBox(
                          height: 8,
                        ),
                        Text(
                          "No customers at this moment",
                          style: TextStyle(
                              color: Colors.grey[600],
                              fontSize: 18),
                        ),
                      ],
                    )):controller.shimmer.value?Center(
                    heightFactor: 15.0,
                    child: CircularProgressIndicator(color: ColorConstants.primaryColor)):
                controller.shimmer.value?
                queueShimmerCard(context):
                Expanded(
                  child:controller.searchController.text.isEmpty? ListView.builder(
                      controller: scrollController,
                      itemCount: controller.hasMore.value
                          ? controller.getCustomerBytenantId.length + 1
                          : controller.getCustomerBytenantId.length,
                      itemBuilder: (BuildContext context,int index)
                      {
                        if(index < controller.getCustomerBytenantId.length){
                          return Padding(
                            padding: const EdgeInsets.only(
                              top: 10,
                              left: 10,
                              right: 10,

                            ),
                            child: Stack(
                              children: [
                                InkWell(
                                  onTap:(){

                                    createOrderController.dropCustomerId = controller.getCustomerBytenantId[index].customerid;
                                    createOrderController.dropCustomerName = "${controller.getCustomerBytenantId[index].firstname}" + "${controller.getCustomerBytenantId[index].lastname}";
                                    createOrderController.dropCustomerContactNo = controller.getCustomerBytenantId[index].contactno;
                                    createOrderController.dropLandMark = controller.getCustomerBytenantId[index].landmark;
                                    createOrderController.dropDoorNo = controller.getCustomerBytenantId[index].doorno;
                                    createOrderController.dropLocationId = controller.getCustomerBytenantId[index].deliverylocationid;
                                    createOrderController.dropTenantLocationId = controller.getCustomerBytenantId[index].tenantlocationid;
                                    createOrderController.toLatitude = controller.getCustomerBytenantId[index].latitude;
                                    createOrderController.toLongitude = controller.getCustomerBytenantId[index].longitude;
                                    createOrderController.toAddress =controller.getCustomerBytenantId[index].address;

                                    createOrderController.dropAddressController.text = controller.getCustomerBytenantId[index].address??'';
                                    createOrderController.dropContactNameController.text = "${controller.getCustomerBytenantId[index].firstname}" + "${controller.getCustomerBytenantId[index].lastname}";
                                    createOrderController.dropContactNoController.text =  controller.getCustomerBytenantId[index].contactno??'';
                                    createOrderController.dropDoorNoController.text = controller.getCustomerBytenantId[index].doorno??'';
                                    createOrderController.dropLandMarkController.text = controller.getCustomerBytenantId[index].landmark??'';
                                    createOrderController.dropStateController.text = controller.getCustomerBytenantId[index].state ??'';
                                    createOrderController.dropCityController.text = controller.getCustomerBytenantId[index].city??'' ;
                                    createOrderController.dropSuburbController.text = controller.getCustomerBytenantId[index].suburb??'';
                                    createOrderController.dropPostcodeController.text = controller.getCustomerBytenantId[index].postcode??'' ;

                                    logger.i (createOrderController.pickupCustomerId);
                                    logger.i (createOrderController.dropCustomerId);

                                    if(createOrderController.dropCustomerId == createOrderController.pickupCustomerId){
                                      Toast.showToast('Please select different customer it already selected');
                                    }
                                    else{
                                      createOrderController.dropSaveAddress = false;
                                      Get.to(CreateOrderView(dropData:controller.getCustomerBytenantId[index], isDashboard: false,));

                                    }

                                  },
                                  child: Container(
                                    padding: const EdgeInsets.only(
                                        right: 15
                                    ),
                                    decoration: BoxDecoration(
                                      color: ColorConstants.secondaryColor,
                                      boxShadow: const [
                                        BoxShadow(color: Colors.grey)
                                      ],
                                      borderRadius:
                                      const BorderRadius.all(Radius.circular(3)),
                                    ),
                                    height: Get.height*0.15,
                                    child: Row(
                                      mainAxisAlignment:
                                      MainAxisAlignment.start,
                                      crossAxisAlignment:
                                      CrossAxisAlignment.center,
                                      children: [
                                        Expanded(
                                            flex: 3,
                                            child: Container(
                                              padding: const EdgeInsets.all(5),
                                              decoration: BoxDecoration(
                                                color: UtilityPromotion
                                                    .getLightColors(
                                                    controller.getCustomerBytenantId[index].firstname == '' ?'':
                                                    controller.getCustomerBytenantId[index].firstname![0]
                                                        .toString()
                                                )
                                                    .withAlpha(100),
                                                shape: BoxShape.rectangle,
                                              ),
                                              child: Column(
                                                mainAxisAlignment:
                                                MainAxisAlignment.center,
                                                crossAxisAlignment: CrossAxisAlignment.center,
                                                children: [
                                                  SizedBox(height: 10,),
                                                  CircleAvatar(
                                                      backgroundColor:
                                                      Colors.white70,
                                                      radius: 28,
                                                      child: Text(
                                                        controller.getCustomerBytenantId[index].firstname == '' ?'':
                                                        controller.getCustomerBytenantId[index].firstname![0].toString().toUpperCase(),
                                                        style: const TextStyle(
                                                            color: Colors
                                                                .black54,
                                                            fontSize: 22),
                                                      )),
                                                  Spacer(),
                                                  Container(
                                                    padding: EdgeInsets.only(top: 5,bottom: 5,right: 5,left: 5),
                                                    decoration: BoxDecoration(color: ColorConstants.secondaryColor),
                                                    child: Center(
                                                      child: Text(
                                                        '${controller.getCustomerBytenantId[index].suburb}',
                                                        style: TextStyle(
                                                            color: ColorConstants
                                                                .darkGreyColor,
                                                            fontSize: 14,
                                                            fontWeight:
                                                            FontWeight.bold),
                                                        maxLines: 1,
                                                        overflow: TextOverflow.ellipsis,
                                                      ),
                                                    ),
                                                  )
                                                ],
                                              ),
                                            )),
                                        const SizedBox(
                                          width: 10,
                                        ),
                                        Expanded(
                                            flex: 8,
                                            child: Column(
                                              crossAxisAlignment:
                                              CrossAxisAlignment.start,
                                              mainAxisAlignment:
                                              MainAxisAlignment.spaceEvenly,
                                              children: [
                                                Row(
                                                  children: [
                                                    Icon(
                                                      Icons.person,
                                                      color: ColorConstants
                                                          .primaryColor,
                                                      size: 20,
                                                    ),
                                                    const SizedBox(
                                                      width: 5,
                                                    ),
                                                    Row(
                                                      children: [
                                                        Text(
                                                          controller.getCustomerBytenantId[index].firstname ?? "",
                                                          style: TextStyle(
                                                              fontSize: 16,
                                                              color: Colors
                                                                  .grey[600],
                                                              fontWeight:
                                                              FontWeight
                                                                  .w600),
                                                        ),
                                                      ],
                                                    ),

                                                  ],
                                                ),
                                                Row(
                                                  children: [
                                                    Icon(
                                                      Icons.call,
                                                      color:
                                                      ColorConstants.primaryColor,
                                                      size: 20,
                                                    ),
                                                    const SizedBox(
                                                      width: 5,
                                                    ),
                                                    Text(
                                                      '${controller.getCustomerBytenantId[index].contactno}',
                                                      style: TextStyle(
                                                          color: ColorConstants
                                                              .darkGreyColor,
                                                          fontSize: 14,
                                                          fontWeight:
                                                          FontWeight.bold),
                                                    ),
                                                  ],
                                                ),
                                                Row(
                                                  children: [
                                                    Icon(
                                                      Icons.location_on,
                                                      color:
                                                      ColorConstants.primaryColor,
                                                      size: 20,
                                                    ),
                                                    const SizedBox(
                                                      width: 5,
                                                    ),
                                                    Expanded(
                                                      child: Text(
                                                        '${controller.getCustomerBytenantId[index].address}',
                                                        style: TextStyle(
                                                            color: ColorConstants
                                                                .darkGreyColor,
                                                            fontSize: 14,
                                                            fontWeight:
                                                            FontWeight.bold),
                                                        maxLines: 1,
                                                        overflow: TextOverflow.ellipsis,
                                                      ),
                                                    ),
                                                  ],
                                                ),
                                                // SizedBox(
                                                //   height: 10,
                                                // ),
                                              ],
                                            )),
                                      ],
                                    ),
                                  ),
                                ),

                              ],
                            ),
                          );
                        }
                        else{
                          return Padding(
                            padding: const EdgeInsets.all(15),
                            child: Center(
                              child: CircularProgressIndicator(
                                color: ColorConstants.primaryColor,
                              ),
                            ),
                          );
                        }
                      }
                  ):
                  ListView.builder(
                      itemCount: controller.getCustomerBytenantId.length,
                      itemBuilder: (BuildContext context,int index)
                      {
                        return Padding(
                          padding: const EdgeInsets.only(
                            top: 10,
                            left: 10,
                            right: 10,

                          ),
                          child: InkWell(
                            onTap: ()async{
                              createOrderController.dropCustomerId = controller.getCustomerBytenantId[index].customerid;
                              createOrderController.dropCustomerName = "${controller.getCustomerBytenantId[index].firstname}" + "${controller.getCustomerBytenantId[index].lastname}";
                              createOrderController.dropCustomerContactNo = controller.getCustomerBytenantId[index].contactno;
                              createOrderController.dropLandMark = controller.getCustomerBytenantId[index].landmark;
                              createOrderController.dropDoorNo = controller.getCustomerBytenantId[index].doorno;
                              createOrderController.dropLocationId = controller.getCustomerBytenantId[index].deliverylocationid;
                              createOrderController.dropTenantLocationId = controller.getCustomerBytenantId[index].tenantlocationid;
                              createOrderController.toLatitude = controller.getCustomerBytenantId[index].latitude;
                              createOrderController.toLongitude = controller.getCustomerBytenantId[index].longitude;
                              createOrderController.toAddress =controller.getCustomerBytenantId[index].address;

                              createOrderController.dropAddressController.text = controller.getCustomerBytenantId[index].address??'';
                              createOrderController.dropContactNameController.text = "${controller.getCustomerBytenantId[index].firstname}" + "${controller.getCustomerBytenantId[index].lastname}";
                              createOrderController.dropContactNoController.text =  controller.getCustomerBytenantId[index].contactno??'';
                              createOrderController.dropDoorNoController.text = controller.getCustomerBytenantId[index].doorno??'';
                              createOrderController.dropLandMarkController.text = controller.getCustomerBytenantId[index].landmark??'';
                              createOrderController.dropStateController.text = controller.getCustomerBytenantId[index].state ??'';
                              createOrderController.dropCityController.text = controller.getCustomerBytenantId[index].city??'' ;
                              createOrderController.dropSuburbController.text = controller.getCustomerBytenantId[index].suburb??'';
                              createOrderController.dropPostcodeController.text = controller.getCustomerBytenantId[index].postcode??'' ;

                              if(createOrderController.dropCustomerId == createOrderController.pickupCustomerId){
                                Toast.showToast('Please select different customer it already selected');
                              }
                              else{
                                createOrderController.dropSaveAddress = false;
                                Get.to(CreateOrderView(dropData:controller.getCustomerBytenantId[index], isDashboard: false,));

                              }
                            },
                            child: Stack(
                              children: [
                                Container(
                                  padding: const EdgeInsets.only(
                                      right: 15
                                  ),
                                  decoration: BoxDecoration(
                                    color: ColorConstants.secondaryColor,
                                    boxShadow: const [
                                      BoxShadow(color: Colors.grey)
                                    ],
                                    borderRadius:
                                    const BorderRadius.all(Radius.circular(3)),
                                  ),
                                  height: Get.height*0.15,
                                  child: Row(
                                    mainAxisAlignment:
                                    MainAxisAlignment.start,
                                    crossAxisAlignment:
                                    CrossAxisAlignment.center,
                                    children: [
                                      Expanded(
                                          flex: 3,
                                          child: Container(
                                            padding: const EdgeInsets.all(5),
                                            decoration: BoxDecoration(
                                              color: UtilityPromotion
                                                  .getLightColors(
                                                  controller.getCustomerBytenantId[index].firstname![0]
                                                      .toString())
                                                  .withAlpha(100),
                                              shape: BoxShape.rectangle,
                                            ),
                                            child: Column(
                                              mainAxisAlignment:
                                              MainAxisAlignment.center,
                                              children: [
                                                SizedBox(height: 10,),
                                                CircleAvatar(
                                                    backgroundColor:
                                                    Colors.white70,
                                                    radius: 28,
                                                    child: Text(
                                                      controller.getCustomerBytenantId[index].firstname == '' ?'':
                                                      controller.getCustomerBytenantId[index].firstname![0].toString().toUpperCase(),
                                                      style: const TextStyle(
                                                          color: Colors
                                                              .black54,
                                                          fontSize: 22),
                                                    )),
                                                Spacer(),
                                                Container(
                                                  padding: EdgeInsets.only(top: 5,bottom: 5,right: 5,left: 5),
                                                  decoration: BoxDecoration(color: ColorConstants.secondaryColor),
                                                  child: Center(
                                                    child: Text(
                                                      '${controller.getCustomerBytenantId[index].suburb}',
                                                      style: TextStyle(
                                                          color: ColorConstants
                                                              .darkGreyColor,
                                                          fontSize: 14,
                                                          fontWeight:
                                                          FontWeight.bold),
                                                      maxLines: 1,
                                                      overflow: TextOverflow.ellipsis,
                                                    ),
                                                  ),
                                                )
                                              ],
                                            ),
                                          )),
                                      const SizedBox(
                                        width: 10,
                                      ),
                                      Expanded(
                                          flex: 8,
                                          child: Column(
                                            crossAxisAlignment:
                                            CrossAxisAlignment.start,
                                            mainAxisAlignment:
                                            MainAxisAlignment.spaceEvenly,
                                            children: [
                                              Row(
                                                children: [
                                                  Icon(
                                                    Icons.person,
                                                    color: ColorConstants
                                                        .primaryColor,
                                                    size: 20,
                                                  ),
                                                  const SizedBox(
                                                    width: 5,
                                                  ),
                                                  Row(
                                                    children: [
                                                      Text(
                                                        controller.getCustomerBytenantId[index].firstname ?? "",
                                                        style: TextStyle(
                                                            fontSize: 16,
                                                            color: Colors
                                                                .grey[600],
                                                            fontWeight:
                                                            FontWeight
                                                                .w600),
                                                      ),
                                                    ],
                                                  ),
                                                ],
                                              ),
                                              Row(
                                                children: [
                                                  Icon(
                                                    Icons.call,
                                                    color:
                                                    ColorConstants.primaryColor,
                                                    size: 20,
                                                  ),
                                                  const SizedBox(
                                                    width: 5,
                                                  ),
                                                  Text(
                                                    '${controller.getCustomerBytenantId[index].contactno}',
                                                    style: TextStyle(
                                                        color: ColorConstants
                                                            .darkGreyColor,
                                                        fontSize: 14,
                                                        fontWeight:
                                                        FontWeight.bold),
                                                  ),

                                                ],
                                              ),
                                              Row(
                                                children: [
                                                  Icon(
                                                    Icons.location_on,
                                                    color:
                                                    ColorConstants.primaryColor,
                                                    size: 20,
                                                  ),
                                                  const SizedBox(
                                                    width: 5,
                                                  ),
                                                  Expanded(
                                                    child: Text(
                                                      '${controller.getCustomerBytenantId[index].address}',
                                                      style: TextStyle(
                                                          color: ColorConstants
                                                              .darkGreyColor,
                                                          fontSize: 14,
                                                          fontWeight:
                                                          FontWeight.bold),
                                                      maxLines: 1,
                                                      overflow: TextOverflow.ellipsis,
                                                    ),
                                                  ),
                                                ],
                                              ),
                                              // SizedBox(
                                              //   height: 10,
                                              // ),
                                            ],
                                          )),
                                    ],
                                  ),
                                ),

                              ],
                            ),
                          ),
                        );
                      }
                  ),
                ),
              ],

            );
          }
      ),
    );
  }
  queueShimmerCard(BuildContext context) {
    return Expanded(
      child: ListView.builder(
          itemCount: 6,
          itemBuilder: (_, __) {
            return Padding(
              padding: const EdgeInsets.all(3.0),
              child: Shimmer.fromColors(
                enabled: true,
                highlightColor: ColorConstants.lightGreyBg!,
                baseColor: Colors.grey[300]!,
                child: Padding(
                  padding: const EdgeInsets.only(
                    top: 10,
                    left: 10,
                    right: 10,

                  ),
                  child: InkWell(
                    onTap: ()async{

                    },
                    child: Stack(
                      children: [
                        Container(
                          padding: const EdgeInsets.only(
                              right: 15
                          ),
                          decoration: BoxDecoration(
                            color: ColorConstants.secondaryColor,
                            boxShadow: const [
                              BoxShadow(color: Colors.grey)
                            ],
                            borderRadius:
                            const BorderRadius.all(Radius.circular(3)),
                          ),
                          height: Get.height*0.10,
                          child: Row(
                            mainAxisAlignment:
                            MainAxisAlignment.start,
                            crossAxisAlignment:
                            CrossAxisAlignment.center,
                            children: [
                              Expanded(
                                  flex: 2,
                                  child: Container(
                                    padding: const EdgeInsets.all(5),
                                    decoration: const BoxDecoration(
                                      color:Colors.grey,
                                      shape: BoxShape.rectangle,
                                    ),
                                    child:  Column(
                                      mainAxisAlignment:
                                      MainAxisAlignment.center,
                                      children: [
                                        CircleAvatar(
                                            backgroundColor:
                                            Colors.white70,
                                            radius: 28,
                                            child: Text(
                                              '',
                                              style: TextStyle(
                                                  color: Colors
                                                      .black54,
                                                  fontSize: 22),
                                            )),
                                      ],
                                    ),
                                  )),
                              const SizedBox(
                                width: 10,
                              ),
                              Expanded(
                                  flex: 8,
                                  child: Column(
                                    crossAxisAlignment:
                                    CrossAxisAlignment.start,
                                    mainAxisAlignment:
                                    MainAxisAlignment.spaceEvenly,
                                    children: [
                                      Row(
                                        children: [
                                          Icon(
                                            Icons.person,
                                            color: ColorConstants
                                                .primaryColor,
                                            size: 20,
                                          ),
                                          const SizedBox(
                                            width: 5,
                                          ),
                                          Row(
                                            children: [
                                              Text(
                                                "",
                                                style: TextStyle(
                                                    fontSize: 16,
                                                    color: Colors
                                                        .grey[600],
                                                    fontWeight:
                                                    FontWeight
                                                        .w600),
                                              ),
                                            ],
                                          ),
                                        ],
                                      ),
                                      Row(
                                        children: [
                                          Icon(
                                            Icons.call,
                                            color:
                                            ColorConstants.primaryColor,
                                            size: 20,
                                          ),
                                          const SizedBox(
                                            width: 5,
                                          ),
                                          Text(
                                            '',
                                            style: TextStyle(
                                                color: ColorConstants
                                                    .darkGreyColor,
                                                fontSize: 14,
                                                fontWeight:
                                                FontWeight.bold),
                                          ),
                                          const Spacer(),

                                          Text(
                                            '',
                                            style: TextStyle(
                                                color: ColorConstants
                                                    .darkGreyColor,
                                                fontSize: 14,
                                                fontWeight:
                                                FontWeight.bold),
                                          ),
                                        ],
                                      ),
                                      // SizedBox(
                                      //   height: 10,
                                      // ),
                                    ],
                                  )),
                            ],
                          ),
                        ),

                      ],
                    ),
                  ),
                ),
              ),
            );
          }),
    );
  }

}
