import 'package:flutter/material.dart';

import '../../uitl/date_uitl.dart';
import '../../uitl/translations_delegate_base.dart';

class CustomerBrief extends StatelessWidget {
  final String itemId;
  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;

  CustomerBrief(
      {this.itemId,
      this.time,
      this.customerFirstName,
      this.customerLastName,
      this.mobileNo,
      this.direction,
      this.totalPayment,
      this.deliveryTime,
      this.longitude,
      this.latitude});

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Container(
        width: 350,
        height: 300,
        decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.only(
              topLeft: Radius.circular(45),
              topRight: Radius.circular(45),
              bottomRight: Radius.circular(45),
              bottomLeft: Radius.circular(45)),
          boxShadow: [
            BoxShadow(
              color: Colors.grey.withOpacity(0.3),
              spreadRadius: 5,
              blurRadius: 7,
              offset: Offset(0, 3),
            ),
          ],
        ),
        child: Container(
          padding: EdgeInsets.only(left: 30, top: 10, right: 30),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: <Widget>[
              Row(
                children: <Widget>[
                  Expanded(
                    child: Text('ID: ${itemId}'),
                  ),
                  Expanded(
                    child: Container(
                      margin: EdgeInsets.only(left: 83),
                      width: 10,
                      height: 60,
                      decoration: BoxDecoration(
                        border: Border.all(
                          width: 2.0,
                          color: Color(0xff41bdbb),
                        ),
                        borderRadius: BorderRadius.only(
                          topLeft: Radius.circular(45),
                          topRight: Radius.circular(45),
                          bottomRight: Radius.circular(45),
                          bottomLeft: Radius.circular(45),
                        ),
                      ),
                      child: Container(
                        margin: EdgeInsets.only(left: 12, top: 10),
                        child: Text(
                          '3 min away',
                          style: TextStyle(color: Color(0xff41bdbb)),
                        ),
                      ),
                    ),
                  ),
                ],
              ),
              Text(
                '${customerFirstName} ${customerLastName}',
                style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
              ),
              Text(
                mobileNo,
                style: TextStyle(color: Colors.lightBlue),
              ),
              SizedBox(
                height: 10,
              ),
              Text(
                'Olaya street, behind KFC resturant, next to kingdom towers 2ND floor ofice 277',
                style: TextStyle(fontWeight: FontWeight.w600),
              ),
              SizedBox(
                height: 10,
              ),
              Divider(
                color: Colors.grey,
              ),
              SizedBox(
                height: 20,
              ),
              Column(
                children: <Widget>[
                  Row(
                    children: <Widget>[
                      Text(
                        TranslationBase.of(context).payment,
                      ),
                      SizedBox(
                        width: 170,
                      ),
                      Text(
                        totalPayment.toString(), //'SAR 70',
                        style: TextStyle(fontWeight: FontWeight.bold),
                      ),
                    ],
                  ),
                  SizedBox(
                    height: 20,
                  ),
                  Row(
                    children: <Widget>[
                      Text(
                        TranslationBase.of(context).delivryTime,
                      ),
                      SizedBox(
                        width: 50,
                      ),
                      Text(
                          '${DateUtil.getMonthDayYearDateFormatted(
                              DateUtil.convertStringToDate(
                                  deliveryTime))} ${(DateUtil
                              .convertStringToHours(deliveryTime))}',
                          //'05 Aug 20 - 10:00 AM',
                          style: TextStyle(fontWeight: FontWeight.bold)),
                    ],
                  )
                ],
              ),
            ],
          ),
        ),
      ),
    );
  }
}
