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
@@ -72,8 +72,7 @@ class _LabelAddSelectorBoxState extends State<LabelAddSelectorBox> {
color: Colors.black,
),
isExpanded: true,
hint:
Container(
hint: Container(
// width: 100,
height: 70,
padding: const EdgeInsets.symmetric(horizontal: 0),
@@ -84,9 +83,10 @@ class _LabelAddSelectorBoxState extends State<LabelAddSelectorBox> {
style: TextStyle(
fontWeight: FontWeight.w700,
color: Colors.black,
fontSize: 5 * widget._deviceBlockSize
fontSize: 5 * widget._deviceBlockSize,
),
),),
),
),
// Container(
// // width: 100,
// height: 70,
@@ -111,9 +111,12 @@ class _LabelAddSelectorBoxState extends State<LabelAddSelectorBox> {
child: Container(
child: Text(
val['name'],
textDirection: TextDirection.rtl,
overflow: TextOverflow.ellipsis,
style: TextStyle(
// color: _mainFontColor,
fontSize: 4 * widget._deviceBlockSize,
fontWeight: FontWeight.w700,
color: Colors.black,
fontSize: 5 * widget._deviceBlockSize,
),
),
),
@@ -0,0 +1,93 @@
import 'package:cssd/config/routes.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:cssd/providers/labels.dart';
class LabelUpdateButton extends StatelessWidget {
const LabelUpdateButton({
Key key,
@required GlobalKey<FormState> form,
@required this.id,
@required this.lotNumberCTRL,
@required this.cycleNumberCTRL,
@required this.sDateCTRL,
@required this.packageValue,
@required this.eDateCTRL,
@required this.striizerIdCTRL,
@required double deviceBlockSize,
}) : _form = form,
_deviceBlockSize = deviceBlockSize,
super(key: key);
final GlobalKey<FormState> _form;
final String id;
final TextEditingController lotNumberCTRL;
final TextEditingController cycleNumberCTRL;
final TextEditingController sDateCTRL;
final List<String> packageValue;
final TextEditingController eDateCTRL;
final TextEditingController striizerIdCTRL;
final double _deviceBlockSize;
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () {
if (!_form.currentState.validate()) {
return;
}
Provider.of<LabelsProvider>(context).updateLabelResult(
id,
lotNumberCTRL.text,
cycleNumberCTRL.text,
sDateCTRL.text,
// sDateValue,
{'id': packageValue[0], 'name': packageValue[1]},
eDateCTRL.text,
// eDateValue,
striizerIdCTRL.text,
);
showDialog(
context: context,
builder: (ctx) => AlertDialog(
content: Text('Label updated.'),
actions: <Widget>[
FlatButton(
onPressed: () {
Navigator.of(ctx).pop();
},
child: Text('Ok'),
)
],
),
).then((_) {
Navigator.of(context).pushReplacementNamed(Routes.labelResultScreen);
});
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5 * _deviceBlockSize,
vertical: 10,
),
// margin:
// EdgeInsets.symmetric(horizontal: 35, vertical: 15),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.blue, Colors.green],
),
borderRadius: BorderRadius.circular(7),
),
child: Align(
alignment: Alignment.center,
child: Text(
'UPDATE',
style: TextStyle(
color: Colors.white,
fontSize: 5 * _deviceBlockSize,
),
),
),
),
);
}
}
+275 -218
View File
@@ -1,6 +1,8 @@
import 'package:cssd/models/label_models.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({
@@ -17,227 +19,282 @@ class LabelDetailsDataBox extends StatelessWidget {
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,
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(
'LABEL DETAILS',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
letterSpacing: 3,
),
),
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(
'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: Colors.red),
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: 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(
'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: Colors.red),
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,
),
),
],
),
Divider(),
],
),
),
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),
),
),
),
)
],
),
);
}
}
+26 -3
View File
@@ -46,7 +46,7 @@ class LabelItemBox extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
width: 50 * _deviceBlockSize,
width: 30 * _deviceBlockSize,
child: Text(
'Package:',
style: TextStyle(
@@ -56,14 +56,14 @@ class LabelItemBox extends StatelessWidget {
),
),
Container(
width: 50 * _deviceBlockSize,
width: 40 * _deviceBlockSize,
child: Text(
item.package,
overflow: TextOverflow.ellipsis,
),
),
Container(
width: 50 * _deviceBlockSize,
width: 30 * _deviceBlockSize,
child: Row(
children: <Widget>[
Text(
@@ -91,6 +91,29 @@ class LabelItemBox extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
InkWell(
customBorder: CircleBorder(),
onTap: () {
Navigator.of(context).pushReplacementNamed(
Routes.labelUpdateScreen,
arguments: item.id,
);
},
child: Container(
padding: EdgeInsets.all(7),
width: 10 * _deviceBlockSize,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.edit,
size: 6 * _deviceBlockSize,
color: Colors.white,
),
),
),
SizedBox(width: _deviceBlockSize,),
InkWell(
customBorder: CircleBorder(),
onTap: () {
+12 -7
View File
@@ -1,5 +1,5 @@
import 'package:cssd/config/routes.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
class FilterScanSaveButton extends StatelessWidget {
const FilterScanSaveButton({
@@ -7,7 +7,9 @@ class FilterScanSaveButton extends StatelessWidget {
@required GlobalKey<FormState> form,
@required this.idCTRL,
@required double deviceBlockSize,
}) : _form = form, _deviceBlockSize = deviceBlockSize, super(key: key);
}) : _form = form,
_deviceBlockSize = deviceBlockSize,
super(key: key);
final GlobalKey<FormState> _form;
final TextEditingController idCTRL;
@@ -17,20 +19,23 @@ class FilterScanSaveButton extends StatelessWidget {
Widget build(BuildContext context) {
return InkWell(
onTap: () {
if (! _form.currentState.validate()) {
if (!_form.currentState.validate()) {
return;
}
Navigator.of(context).pushNamed(
Routes.labelDetailScreen,
arguments: idCTRL.text,
launch(
'https://cssd-doc.com/Show/Label/${idCTRL.text}',
);
// Navigator.of(context).pushNamed(
// Routes.labelDetailScreen,
// arguments: idCTRL.text,
// );
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5 * _deviceBlockSize,
vertical: 10,
),
margin: EdgeInsets.symmetric(horizontal: 20),
margin: EdgeInsets.only(bottom: 50,left: 20,right: 20),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.blue, Colors.green],
+11 -11
View File
@@ -1,7 +1,7 @@
import 'package:barcode_scan/barcode_scan.dart';
import 'package:cssd/config/routes.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:url_launcher/url_launcher.dart';
class LabelScanBox extends StatelessWidget {
const LabelScanBox({
@@ -24,9 +24,8 @@ class LabelScanBox extends StatelessWidget {
return 'null';
}
} on PlatformException catch (_) {
return 'access';
}
catch (_){
return 'access';
} catch (_) {
return 'error';
}
@@ -70,15 +69,16 @@ class LabelScanBox extends StatelessWidget {
print('cancel');
} else if (result == 'error') {
print('error');
}
else if(result == 'access'){
} else if (result == 'access') {
print('access');
}
else {
Navigator.of(context).pushNamed(
Routes.labelDetailScreen,
arguments: result,
} else {
launch(
'https://cssd-doc.com/Show/Label/$result',
);
// Navigator.of(context).pushNamed(
// Routes.labelDetailScreen,
// arguments: result,
// );
}
},
);