import 'package:driverapp/config/size_config.dart';
import 'package:driverapp/uitl/utils.dart';
import 'package:driverapp/widgets/delivery/distance_in_kilometers.dart';
import 'package:flutter/material.dart';

class CustomerBriefCard extends StatelessWidget {
  final int customerOrderId;
  final int pharmacyOrderId;
  final String time;
  final String customerFirstName;
  final String customerLastName;
  final String mobileNo;
  final String direction;
  final String totalPayment;
  final String deliveryTime;
  final double longitude;
  final double latitude;
  final bool showDistance;
  final dynamic distanceInKilometers;

  CustomerBriefCard({
    this.customerOrderId,
    this.pharmacyOrderId,
    this.time,
    this.customerFirstName,
    this.customerLastName,
    this.mobileNo,
    this.direction,
    this.totalPayment,
    this.deliveryTime,
    this.longitude,
    this.latitude,
    this.showDistance = true,
    this.distanceInKilometers,
  });

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Padding(
        padding: EdgeInsets.only(bottom: 0.0),
        child: Container(
          width: MediaQuery.of(context).orientation == Orientation.landscape
              ? MediaQuery.of(context).size.width * 0.9
              : MediaQuery.of(context).size.width * 0.9,
          height: SizeConfig.heightMultiplier * 30.0, // TODO make it responsive
          decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.only(
                topLeft: Radius.circular(30),
                topRight: Radius.circular(30),
                bottomRight: Radius.circular(30),
                bottomLeft: Radius.circular(30)),
            boxShadow: [
              BoxShadow(
                color: Colors.grey.withOpacity(0.3),
                spreadRadius: 5,
                blurRadius: 7,
                offset: Offset(0, 3),
              ),
            ],
          ),
          child: Container(
            padding: EdgeInsets.only(left: 20, top: 20, right: 20),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisAlignment: MainAxisAlignment.start,
              children: <Widget>[
                Row(
                  children: <Widget>[
                    Expanded(
                      flex: 3,
                      child: Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Text(
                            'Customer Order Id: ${customerOrderId}',
                            style: TextStyle(
                                color: Color(0xff636363),
                                fontWeight: FontWeight.w500,
                                fontSize: 17.5),
                          ),
                          SizedBox(
                            height: 10,
                          ),
                          Text(
                            'Pharmacy Order Id: ${pharmacyOrderId}',
                            style: TextStyle(
                                color: Color(0xff636363),
                                fontWeight: FontWeight.w500,
                                fontSize: 17.5),
                          ),
                        ],
                      ),
                    ),
                    Expanded(
                      child: Padding(
                        padding: EdgeInsets.all(2.0),
                        child: DistanceInKilometers(
                          distanceInKilometers: distanceInKilometers,
                        ),
                      ),
                    ),
                  ],
                ),
                Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                  children: <Widget>[
                    Text(
                      Utils.formatStringToPascalCase(
                          '${customerFirstName} ${customerLastName}'),
                      style: TextStyle(
                        color: Color(0xff343333),
                        fontWeight: FontWeight.bold,
                        fontSize: 20.0,
                      ),
                    ),
//                        SizedBox(
//                          height: MediaQuery.of(context).size.width * 0.00,
//                        ),
                    Text(
                      mobileNo,
                      style: TextStyle(
                          color: Color(0xff14A0A9),
                          fontWeight: FontWeight.w400),
                    ),
                    SizedBox(
                      height: MediaQuery.of(context).size.width * 0.005,
                    ),
                  ],
                ),

//              Text(
//                'Olaya street, behind KFC resturant, next to kingdom towers 2nd floor ofice 277',
//                style: TextStyle(
//                    color: Color(0xFF464748), fontWeight: FontWeight.w600),
//              ),
                SizedBox(
                  height: 10,
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
