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 pickUp; const ShipmentListRow({Key key, this.pickUp}) : super(key: key); @override Widget build(BuildContext context) { return InkWell( onTap: () { Navigator.of(context).push(CupertinoPageRoute( builder: (context) => ShipmentInfo(shipment: pickUp))); }, child: Container( padding: EdgeInsets.only(left: 15, right: 15), child: Row( children: [ Expanded( child: new Padding( padding: const EdgeInsets.symmetric(vertical: 16.0), child: new Row( children: [ Padding( padding: EdgeInsets.all(5.0), child: Icon( SimpleLineIcons.direction, color: primaryColor, )), new Expanded( child: new Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: const EdgeInsets.only(left: 8.0), child: new Text( pickUp.shipmentNumber, style: new TextStyle( fontSize: 15.0, color: Colors.black), ), ), Padding( padding: const EdgeInsets.only(left: 10.0, top: 10), child: new Text( pickUp.id == null ? '' : "Last ${pickUp.last} days", style: new TextStyle( fontSize: 15.0, color: Colors.grey), ), ) ], ), ), ], ), ), ), Column( children: [ Padding( padding: const EdgeInsets.all(0), child: getStatus(pickUp.currentStatus), ), Padding( padding: const EdgeInsets.only(left: 8.0, top: 5, bottom: 5), child: Row( children: [ new Text( pickUp.weight == null ? '' : pickUp.weight.toString() + 'lb - ', style: new TextStyle(fontSize: 15.0, color: Colors.grey), ), new Text( pickUp.numberOfPackage == null ? "" : pickUp.numberOfPackage.toString() + ' packages', style: new TextStyle(fontSize: 15.0, color: Colors.grey), ), ], ), ), ], ) ], ), ), ); } }