Files
2023-11-22 14:53:35 +04:30

303 lines
9.8 KiB
Dart
Executable File

import 'package:cssd/config/colors.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../../models/label_models.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: <Widget>[
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: kLightBlue,
width: 2,
),
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(
DateFormat.yMMMd().format(
DateTime.parse(
datas.createDate,
),
),
style: TextStyle(
color: kLightBlue,
),
),
Divider(),
Text(
'ID: ${datas.id}',
style: TextStyle(
color: kLightBlue,
fontWeight: FontWeight.w700,
),
),
SizedBox(
height: 30,
),
Row(
children: <Widget>[
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: <Widget>[
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: <Widget>[
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: <Widget>[
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: <Widget>[
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: kPink,
),
overflow: TextOverflow.clip,
),
),
],
),
Divider(),
SizedBox(
height: 5,
),
Row(
children: <Widget>[
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(),
SizedBox(
height: 5,
),
Row(
children: <Widget>[
Container(
width: 35 * _deviceBlockSize,
child: Text(
'Hospital Name',
style: TextStyle(
color: Colors.grey,
),
),
),
Container(
width: 45 * _deviceBlockSize,
child: Text(
datas.hospitalName,
style: TextStyle(
fontWeight: FontWeight.w700,
),
overflow: TextOverflow.clip,
),
),
],
),
],
),
),
SizedBox(
height: 20,
),
InkWell(
onTap: () => launch(
'https://cssd-doc.com/Show/Label/${datas.id.toString()}',
// forceSafariVC: true,
// forceWebView: true,
// headers: <String, String>{'my_header_key': 'my_header_value'},
// child: Text('Show Full Details'),
),
child: Container(
padding: EdgeInsets.symmetric(vertical: 20),
width: double.infinity,
decoration: BoxDecoration(
color: Color.fromRGBO(230, 230, 230, 1),
borderRadius: BorderRadius.circular(25),
),
child: Center(
child: Text(
'Show More Details',
style: TextStyle(fontWeight: FontWeight.w700),
),
),
),
)
],
),
);
}
}