import 'package:fcs/domain/entities/carton.dart'; import 'package:fcs/helpers/theme.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_vector_icons/flutter_vector_icons.dart'; import 'package:intl/intl.dart'; import '../carton_info.dart'; import '../print_qr_code_page.dart'; class CartonListRow extends StatelessWidget { final Carton box; CartonListRow({Key? key, required this.box}) : super(key: key); final double dotSize = 15.0; final DateFormat dateFormat = new DateFormat("dd MMM yyyy"); @override Widget build(BuildContext context) { return InkWell( onTap: () { Navigator.push( context, CupertinoPageRoute(builder: (context) => CartonInfo(carton: box)), ); }, child: Container( padding: EdgeInsets.only(left: 15, right: 15), child: Row( children: [ Expanded( child: new Padding( padding: const EdgeInsets.symmetric(vertical: 10.0), child: new Row( children: [ Container( padding: EdgeInsets.only(left: 0), child: Icon( MaterialCommunityIcons.package, color: primaryColor, size: 30, ), ), new Expanded( child: Padding( padding: const EdgeInsets.only(left: 15.0), child: Row( children: [ new Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ new Text( box.cartonNumber ?? "", style: new TextStyle( fontSize: 15.0, color: Colors.black), ), Padding( padding: const EdgeInsets.only(top: 5), child: new Text( box.userName ?? "", style: new TextStyle( fontSize: 15.0, color: Colors.grey), ), ), ], ), const SizedBox(width: 15), IconButton( onPressed: () { Navigator.push( context, CupertinoPageRoute( builder: (context) => PrintQrCodePage(carton: box)), ); }, icon: Icon(AntDesign.qrcode, color: Colors.black)) ], ), ), ), ], ), ), ), Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text(box.status ?? "", style: TextStyle( color: primaryColor, fontSize: 15, fontWeight: FontWeight.bold)), Padding( padding: const EdgeInsets.only(top: 5), child: Row( children: [ new Text( "${box.cartonWeight.toStringAsFixed(2)} lb", style: new TextStyle(fontSize: 14.0, color: Colors.grey), ), ], ), ), ], ) ], ), ), ); } }