import 'package:cssd/models/label_models.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; class LabelDetailsDataBox extends StatelessWidget { const LabelDetailsDataBox({ Key key, @required this.datas, @required double deviceBlockSize, }) : _deviceBlockSize = deviceBlockSize, super(key: key); final LabelDetailsObject datas; final double _deviceBlockSize; @override Widget build(BuildContext context) { return Padding( padding: EdgeInsets.all(20), child: ListView(children: [ SizedBox( height: 10, ), Text( 'LABEL DETAILS', style: TextStyle( fontWeight: FontWeight.w700, fontSize: 5 * _deviceBlockSize, letterSpacing: 3, ), ), SizedBox( height: 10, ), Container( padding: EdgeInsets.all(10), decoration: BoxDecoration( color: Color.fromRGBO(235, 235, 235, 1), border: Border( left: BorderSide( color: Colors.black54, width: 2, ), ), ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ Text( DateFormat.yMMMd().format( DateTime.parse( datas.createDate, ), ), style: TextStyle( color: Colors.red, ), ), Divider(), Text( 'ID: ${datas.id}', style: TextStyle( color: Colors.red, fontWeight: FontWeight.w700, ), ), SizedBox( height: 30, ), Row( children: [ Container( width: 35 * _deviceBlockSize, child: Text( 'Sterilizer ID', style: TextStyle( color: Colors.grey, ), ), ), Container( width: 45 * _deviceBlockSize, child: Text( datas.sterileId.toString(), style: TextStyle( fontWeight: FontWeight.w700, ), overflow: TextOverflow.clip, ), ), ], ), Divider(), SizedBox( height: 5, ), Row( children: [ Container( width: 35 * _deviceBlockSize, child: Text( 'Cycle Number', style: TextStyle( color: Colors.grey, ), ), ), Container( width: 45 * _deviceBlockSize, child: Text( datas.cycleNumber.toString(), style: TextStyle( fontWeight: FontWeight.w700, ), overflow: TextOverflow.clip, ), ), ], ), Divider(), SizedBox( height: 5, ), Row( children: [ Container( width: 35 * _deviceBlockSize, child: Text( 'Lot Number', style: TextStyle( color: Colors.grey, ), ), ), Container( width: 45 * _deviceBlockSize, child: Text( datas.lotNumber.toString(), style: TextStyle( fontWeight: FontWeight.w700, ), overflow: TextOverflow.clip, ), ), ], ), Divider(), SizedBox( height: 5, ), Row( children: [ Container( width: 35 * _deviceBlockSize, child: Text( 'Sterile Date', style: TextStyle( color: Colors.grey, ), ), ), Container( width: 45 * _deviceBlockSize, child: Text( DateFormat('y-M-d').format( DateTime.parse( datas.sterileDate, ), ), style: TextStyle( fontWeight: FontWeight.w700, ), overflow: TextOverflow.clip, ), ), ], ), Divider(), SizedBox( height: 5, ), Row( children: [ Container( width: 35 * _deviceBlockSize, child: Text( 'Expire Date', style: TextStyle( color: Colors.grey, ), ), ), Container( width: 45 * _deviceBlockSize, child: Text( DateFormat('y-M-d').format( DateTime.parse( datas.expireDate, ), ), style: TextStyle( fontWeight: FontWeight.w700, color: Colors.red), overflow: TextOverflow.clip, ), ), ], ), Divider(), SizedBox( height: 5, ), Row( children: [ Container( width: 35 * _deviceBlockSize, child: Text( 'Package', style: TextStyle( color: Colors.grey, ), ), ), Container( width: 45 * _deviceBlockSize, child: Text( datas.package.toString(), style: TextStyle( fontWeight: FontWeight.w700, ), overflow: TextOverflow.clip, ), ), ], ), Divider(), ], ), ), ]), ); } }