This commit is contained in:
erfan hayat'bakhsh
2020-08-01 14:16:20 +04:30
parent 30f10dca2e
commit e4d29c4e3c
71 changed files with 5018 additions and 2319 deletions
+266 -206
View File
@@ -1,6 +1,8 @@
import 'package:cssd/models/cycles_models.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../../models/cycles_models.dart';
class CycleDetailsDataBox extends StatelessWidget {
const CycleDetailsDataBox({
@@ -17,215 +19,273 @@ class CycleDetailsDataBox extends StatelessWidget {
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.all(20),
child: ListView(children: <Widget>[
SizedBox(
height: 10,
),
Text(
'CYCLE DETAILS',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
letterSpacing: 3,
child: ListView(
children: <Widget>[
SizedBox(
height: 10,
),
),
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,
Text(
'CYCLE 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: <Widget>[
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: <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(
'Date',
style: TextStyle(
color: Colors.grey,
),
),
),
Container(
width: 45 * _deviceBlockSize,
child: Text(
DateFormat('d-M-y').format(
DateTime.parse(
datas.date,
),
),
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.hospitalName,
style: TextStyle(
fontWeight: FontWeight.w700,
),
overflow: TextOverflow.clip,
),
),
],
),
Divider(),
SizedBox(
height: 30,
),
Text(
'LABELS INCLUDED',
style: TextStyle(
color: Colors.orange,
letterSpacing: 3,
fontWeight: FontWeight.w700,
fontSize: 4.5 * _deviceBlockSize,
),
),
Container(
width: double.infinity,
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 20),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
border: Border.all(
color: Colors.grey,
),
),
child: ListView.separated(
shrinkWrap: true,
itemBuilder: (ctx, index) => RichText(
text: TextSpan(
text: 'Label ID ',
style: TextStyle(
color: Colors.grey,
fontFamily: 'montserrat',
),
// style: DefaultTextStyle.of(context).style,
children: <TextSpan>[
TextSpan(
text: datas.labels[index],
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.orange,
),
),
],
),
),
separatorBuilder: (ctx, index) => Divider(),
itemCount: datas.labels.length,
),
),
SizedBox(
height: 50,
)
],
),
),
SizedBox(height: 20,),
InkWell(
onTap: () async=> await launch(
'https://cssd-doc.com/Show/Cycle/${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),
),
),
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
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: <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(
'Date',
style: TextStyle(
color: Colors.grey,
),
),
),
Container(
width: 45 * _deviceBlockSize,
child: Text(
DateFormat('d-M-y').format(
DateTime.parse(
datas.date,
),
),
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: 30,
),
Text(
'LABELS INCLUDED',
style: TextStyle(
color: Colors.orange,
letterSpacing: 3,
fontWeight: FontWeight.w700,
fontSize: 4.5 * _deviceBlockSize,
),
),
Container(
width: double.infinity,
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 20),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
border: Border.all(
color: Colors.grey,
),
),
child: ListView.separated(
shrinkWrap: true,
itemBuilder: (ctx, index) => RichText(
text: TextSpan(
text: 'Label ID ',
style: TextStyle(color: Colors.grey,fontFamily: 'montserrat',),
// style: DefaultTextStyle.of(context).style,
children: <TextSpan>[
TextSpan(
text: datas.labels[index],
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.orange,
),
),
],
),
),
separatorBuilder: (ctx, index) => Divider(),
itemCount: datas.labels.length,
),
),
SizedBox(height: 50,)
],
),
),
]),
SizedBox(height: 30,)
],
),
);
}
}
@@ -1,17 +1,21 @@
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class CycleFilterSelectorBox extends StatefulWidget {
const CycleFilterSelectorBox({
Key key,
@required double deviceBlockSize,
@required this.hospitalCTRL,
@required this.hospitalVals,
}) : _deviceBlockSize = deviceBlockSize,
const CycleFilterSelectorBox(
{Key key,
@required double deviceBlockSize,
@required this.hospitalCTRL,
@required this.hospitalVals,
@required String label})
: _deviceBlockSize = deviceBlockSize,
_label = label,
super(key: key);
final double _deviceBlockSize;
final TextEditingController hospitalCTRL;
final List<Map<String, String>> hospitalVals;
final String _label;
@override
_CycleFilterSelectorBoxState createState() => _CycleFilterSelectorBoxState();
@@ -47,7 +51,7 @@ class _CycleFilterSelectorBoxState extends State<CycleFilterSelectorBox> {
width: widget._deviceBlockSize,
),
Text(
'Package',
widget._label,
style: TextStyle(
fontSize: 3.5 * widget._deviceBlockSize,
color: Colors.grey,