mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-10 19:19:17 +03:30
396 lines
13 KiB
Dart
Executable File
396 lines
13 KiB
Dart
Executable File
import 'package:cssd/config/colors.dart';
|
|
import 'package:cssd/models/item_model.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:intl/intl.dart';
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
|
|
class ItemDetailsDataBox extends StatelessWidget {
|
|
const ItemDetailsDataBox({
|
|
Key? key,
|
|
required this.datas,
|
|
required double deviceBlockSize,
|
|
}) : _deviceBlockSize = deviceBlockSize,
|
|
super(key: key);
|
|
|
|
final ItemDetailObject datas;
|
|
final double _deviceBlockSize;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
print(datas.status);
|
|
return Padding(
|
|
padding: EdgeInsets.all(20),
|
|
child: ListView(
|
|
children: <Widget>[
|
|
SizedBox(
|
|
height: 10,
|
|
),
|
|
Text(
|
|
'Item 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: kBlue,
|
|
width: 2,
|
|
),
|
|
),
|
|
),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: <Widget>[
|
|
Text(
|
|
DateFormat.yMMMd().format(
|
|
DateTime.parse(
|
|
datas.createdAt,
|
|
),
|
|
),
|
|
style: TextStyle(
|
|
color: kBlue,
|
|
),
|
|
),
|
|
Divider(),
|
|
Text(
|
|
'ID: ${datas.id}',
|
|
style: TextStyle(
|
|
color: kBlue,
|
|
fontWeight: FontWeight.w700,
|
|
),
|
|
),
|
|
SizedBox(
|
|
height: 30,
|
|
),
|
|
Row(
|
|
children: <Widget>[
|
|
Container(
|
|
width: 35 * _deviceBlockSize,
|
|
child: Text(
|
|
'Item Name',
|
|
style: TextStyle(
|
|
color: Colors.grey,
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: 45 * _deviceBlockSize,
|
|
child: Text(
|
|
datas.name.toString(),
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
),
|
|
overflow: TextOverflow.clip,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
Divider(),
|
|
SizedBox(
|
|
height: 5,
|
|
),
|
|
Row(
|
|
children: <Widget>[
|
|
Container(
|
|
width: 35 * _deviceBlockSize,
|
|
child: Text(
|
|
'Size',
|
|
style: TextStyle(
|
|
color: Colors.grey,
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: 45 * _deviceBlockSize,
|
|
child: Text(
|
|
datas.size.toString(),
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
),
|
|
overflow: TextOverflow.clip,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
Divider(),
|
|
SizedBox(
|
|
height: 5,
|
|
),
|
|
Row(
|
|
children: <Widget>[
|
|
Container(
|
|
width: 35 * _deviceBlockSize,
|
|
child: Text(
|
|
'Specific',
|
|
style: TextStyle(
|
|
color: Colors.grey,
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: 45 * _deviceBlockSize,
|
|
child: Text(
|
|
datas.specific.toString(),
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
),
|
|
overflow: TextOverflow.clip,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
Divider(),
|
|
SizedBox(
|
|
height: 5,
|
|
),
|
|
Row(
|
|
children: <Widget>[
|
|
Container(
|
|
width: 35 * _deviceBlockSize,
|
|
child: Text(
|
|
'Owner',
|
|
style: TextStyle(
|
|
color: Colors.grey,
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: 45 * _deviceBlockSize,
|
|
child: Text(
|
|
datas.userName.toString(),
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
),
|
|
overflow: TextOverflow.clip,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
Divider(),
|
|
SizedBox(
|
|
height: 5,
|
|
),
|
|
Row(
|
|
children: <Widget>[
|
|
Container(
|
|
width: 35 * _deviceBlockSize,
|
|
child: Text(
|
|
'Creator',
|
|
style: TextStyle(
|
|
color: Colors.grey,
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: 45 * _deviceBlockSize,
|
|
child: Text(
|
|
datas.userCreator.toString(),
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
),
|
|
overflow: TextOverflow.clip,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
Divider(),
|
|
SizedBox(
|
|
height: 5,
|
|
),
|
|
Row(
|
|
children: <Widget>[
|
|
Container(
|
|
width: 35 * _deviceBlockSize,
|
|
child: Text(
|
|
'UDI',
|
|
style: TextStyle(
|
|
color: Colors.grey,
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: 45 * _deviceBlockSize,
|
|
child: Text(
|
|
datas.udi.toString(),
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
),
|
|
overflow: TextOverflow.clip,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
Divider(),
|
|
SizedBox(
|
|
height: 5,
|
|
),
|
|
Row(
|
|
children: <Widget>[
|
|
Container(
|
|
width: 35 * _deviceBlockSize,
|
|
child: Text(
|
|
'Date',
|
|
style: TextStyle(
|
|
color: Colors.grey,
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: 45 * _deviceBlockSize,
|
|
child: Text(
|
|
DateFormat('d-M-y').format(
|
|
DateTime.parse(
|
|
datas.createdAt,
|
|
),
|
|
),
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
),
|
|
overflow: TextOverflow.clip,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
Divider(),
|
|
SizedBox(
|
|
height: 5,
|
|
),
|
|
Row(
|
|
children: <Widget>[
|
|
Container(
|
|
width: 35 * _deviceBlockSize,
|
|
child: Text(
|
|
'Description',
|
|
style: TextStyle(
|
|
color: Colors.grey,
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: 45 * _deviceBlockSize,
|
|
child: Text(
|
|
datas.description.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.hospital,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
),
|
|
overflow: TextOverflow.clip,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
Divider(),
|
|
SizedBox(
|
|
height: 5,
|
|
),
|
|
Row(
|
|
children: <Widget>[
|
|
Container(
|
|
width: 35 * _deviceBlockSize,
|
|
child: Text(
|
|
'Status',
|
|
style: TextStyle(
|
|
color: Colors.grey,
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: 45 * _deviceBlockSize,
|
|
child: Text(
|
|
datas.status == 1 ? 'Confirmed' : 'Rejected',
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
color: datas.status == 1 ? kBlue : kPink,
|
|
),
|
|
overflow: TextOverflow.clip,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
Divider(),
|
|
SizedBox(
|
|
height: 10,
|
|
),
|
|
Container(
|
|
width: double.infinity,
|
|
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 20),
|
|
child: ListView.separated(
|
|
shrinkWrap: true,
|
|
itemBuilder: (ctx, index) {
|
|
return Image(image: NetworkImage(datas.filePath![index]));
|
|
},
|
|
separatorBuilder: (ctx, index) => Divider(),
|
|
itemCount: datas.filePath!.length,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
SizedBox(
|
|
height: 20,
|
|
),
|
|
InkWell(
|
|
onTap: () async => await launch(
|
|
'https://cssd-doc.com/Show/Item/${datas.id.toString()}',
|
|
),
|
|
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),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
SizedBox(
|
|
height: 30,
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|