import 'package:fcs/domain/entities/shipment.dart';
import 'package:fcs/helpers/theme.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';

import '../main/util.dart';
import 'shipment_info.dart';

class ShipmentListRow extends StatelessWidget {
  final Shipment shipment;
  final bool isCustomer;
  const ShipmentListRow({Key key, this.shipment, this.isCustomer})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: () {
        Navigator.of(context).push(CupertinoPageRoute(
            builder: (context) => ShipmentInfo(
                  shipment: shipment,
                  isCustomer: isCustomer,
                )));
      },
      child: Container(
        padding: EdgeInsets.only(left: 15, right: 15),
        child: Row(
          children: <Widget>[
            Expanded(
              child: new Padding(
                padding: const EdgeInsets.symmetric(vertical: 16.0),
                child: new Row(
                  children: <Widget>[
                    Padding(
                        padding: EdgeInsets.all(5.0),
                        child: Icon(
                          SimpleLineIcons.direction,
                          color: primaryColor,
                        )),
                    new Expanded(
                      child: new Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: <Widget>[
                          Padding(
                            padding: const EdgeInsets.only(left: 8.0),
                            child: new Text(
                              shipment.shipmentNumber ?? "",
                              style: new TextStyle(
                                  fontSize: 15.0, color: Colors.black),
                            ),
                          ),
                          // Padding(
                          //   padding: const EdgeInsets.only(left: 10.0, top: 3),
                          //   child: new Text(
                          //     "Last ${shipment.last ?? 0} days",
                          //     style: new TextStyle(
                          //         fontSize: 15.0, color: Colors.grey),
                          //   ),
                          // )
                        ],
                      ),
                    ),
                  ],
                ),
              ),
            ),
            Column(
              children: <Widget>[
                Padding(
                  padding: const EdgeInsets.all(0),
                  child: getStatus(shipment.status ?? ""),
                ),
                // Padding(
                //   padding: const EdgeInsets.only(left: 8.0, top: 5, bottom: 5),
                //   child: Row(
                //     children: <Widget>[
                //       new Text(
                //         "(${pickUp.totalWeight ?? "0"}) lb ",
                //         style:
                //             new TextStyle(fontSize: 15.0, color: Colors.grey),
                //       ),
                //       new Text(
                //         "(${pickUp.totalCount ?? "0"}) cartons ",
                //         style:
                //             new TextStyle(fontSize: 15.0, color: Colors.grey),
                //       ),
                //     ],
                //   ),
                // ),
              ],
            )
          ],
        ),
      ),
    );
  }
}
