import 'package:fcs/domain/entities/carton.dart'; import 'package:fcs/helpers/theme.dart'; import 'package:fcs/pages/main/util.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:intl/intl.dart'; import 'delivery_info.dart'; class DeliveryListRow extends StatefulWidget { final Carton box; const DeliveryListRow({Key key,this.box}):super(key:key); @override _DeliveryListRowState createState() => _DeliveryListRowState(); } class _DeliveryListRowState extends State { final double dotSize = 15.0; Carton _box = new Carton(); final DateFormat dateFormat = new DateFormat("dd MMM yyyy"); @override void initState() { super.initState(); _box = widget.box; } @override Widget build(BuildContext context) { return InkWell( onTap: () { Navigator.push( context, CupertinoPageRoute(builder: (context) => DeliveryInfo(box: _box)), ); }, 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: [ Container( padding: EdgeInsets.only(left: 5, right: 10), child: Icon( MaterialCommunityIcons.truck_fast, color: primaryColor, size: 30, ), ), new Expanded( child: new Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: const EdgeInsets.only(left: 8.0), child: new Text( _box.cartonNumber ?? "", style: new TextStyle( fontSize: 15.0, color: Colors.black), ), ), Padding( padding: const EdgeInsets.only(left: 10.0, top: 10), child: new Text( _box.userName ?? "", style: new TextStyle( fontSize: 15.0, color: Colors.grey), ), ) ], ), ), ], ), ), ), Column( children: [ Padding( padding: const EdgeInsets.all(0), child: getStatus(_box.status == null ? "" : _box.status), ), Padding( padding: const EdgeInsets.only(left: 8.0, top: 5, bottom: 5), child: Row( children: [ new Text( "${_box.actualWeight?.toString() ?? ''} lb", style: new TextStyle(fontSize: 15.0, color: Colors.grey), ), ], ), ), ], ) ], ), ), ); } }