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 '../carton/print_qr_code_page.dart'; import 'carton_search.dart'; class CartonListRow extends StatelessWidget { final CallbackCartonSelect? callbackCartonSelect; final Carton carton; CartonListRow({Key? key, required this.carton, this.callbackCartonSelect}) : super(key: key); final double dotSize = 15.0; @override Widget build(BuildContext context) { return Container( decoration: BoxDecoration( border: Border( bottom: BorderSide(color: Colors.grey.shade300), ), ), child: InkWell( onTap: () { Navigator.pop(context); if (callbackCartonSelect != null) callbackCartonSelect!(carton); }, child: Container( padding: EdgeInsets.only(left: 15, right: 15), child: Row( children: [ Expanded( child: new Padding( padding: const EdgeInsets.symmetric(vertical: 7.0), child: new Row( children: [ Container( padding: EdgeInsets.only(left: 5), child: Icon( MaterialCommunityIcons.package, color: primaryColor, size: 30, ), ), new Expanded( child: Padding( padding: const EdgeInsets.only(left: 18.0), child: Row( children: [ new Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ new Text( carton.cartonNumber ?? "", style: new TextStyle( fontSize: 15.0, color: Colors.black), ), Padding( padding: const EdgeInsets.only(top: 5), child: new Text( carton.consigneeName ?? "", style: new TextStyle( fontSize: 15.0, color: Colors.grey), ), ), ], ), const SizedBox(width: 15), IconButton( onPressed: () { Navigator.push( context, CupertinoPageRoute( builder: (context) => PrintQrCodePage(carton: carton)), ); }, icon: Icon(AntDesign.qrcode, color: Colors.black)) ], ), ), ), ], ), ), ), Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text(carton.status ?? "", style: TextStyle( color: primaryColor, fontSize: 15, fontWeight: FontWeight.bold)), Padding( padding: const EdgeInsets.only(top: 5), child: Row( children: [ new Text( "${carton.cartonWeight.toStringAsFixed(2)} lb", style: new TextStyle(fontSize: 15.0, color: Colors.grey), ), ], ), ), ], ) ], ), ), ), ); } }