import 'package:fcs/domain/entities/carton.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 '../print_qr_code_page.dart'; class CartonRow extends StatelessWidget { final Carton carton; CartonRow({Key? key, required this.carton}) : super(key: key); final double dotSize = 15.0; final DateFormat dateFormat = new DateFormat("dd MMM yyyy"); @override Widget build(BuildContext context) { return Container( decoration: BoxDecoration( border: Border(bottom: BorderSide(color: Colors.grey.shade300)), ), child: Row( children: [ Expanded( child: new Padding( padding: const EdgeInsets.symmetric(vertical: 5.0), child: new Row( children: [ new Text(carton.cartonNumber ?? "", style: new TextStyle(fontSize: 15.0, color: Colors.black)), const SizedBox(width: 15), IconButton( onPressed: () { Navigator.push( context, CupertinoPageRoute( builder: (context) => PrintQrCodePage(carton: carton)), ); }, icon: Icon(AntDesign.qrcode)), ], ), ), ), Column( children: [ carton.cartonWeight == 0 ? Container() : Padding( padding: const EdgeInsets.only(left: 8.0, bottom: 5), child: Row( children: [ new Text( "${carton.cartonWeight.toStringAsFixed(2)} lb", style: new TextStyle( fontSize: 15.0, color: Colors.grey), ), ], ), ), ], ), ], ), ); } }