Improve back button function in all screens

This commit is contained in:
hanie.khodkari
2025-03-19 18:38:40 +03:30
parent d99ecb2783
commit 58cd3d9f3f
35 changed files with 4715 additions and 5007 deletions
+248 -269
View File
@@ -75,297 +75,276 @@ class _CycleAddScreenState extends State<CycleAddScreen> {
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
return Consumer<CyclesProvider>(builder: (context, cyclesProvider, _) {
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
// cyclesProvider.resetLoadingButton();
// Navigator.pushReplacementNamed(
// context,
// Routes.cycleResultScreen,
// );
// return true;
},
child: SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Cycles',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () {
cyclesProvider.resetLoadingButton();
Navigator.of(context)
.pushReplacementNamed(Routes.cycleResultScreen);
},
return SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Cycles',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: Form(
key: _form,
child: Padding(
padding: EdgeInsets.all(20),
child: ListView(
// crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Add a Cycle',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 6 * _deviceBlockSize,
letterSpacing: 3,
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () {
cyclesProvider.resetLoadingButton();
Navigator.of(context)
.pushReplacementNamed(Routes.cycleResultScreen);
},
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
),
SizedBox(
height: 20,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Strilizer ID required!';
}
return null;
},
controller: striizerIdCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons
.sortNumericDown,
size: 7 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Strilizer ID',
contentPadding:
EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
)
: Form(
key: _form,
child: Padding(
padding: EdgeInsets.all(20),
child: ListView(
// crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Add a Cycle',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 6 * _deviceBlockSize,
letterSpacing: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
SizedBox(
height: 20,
),
keyboardType:
TextInputType.visiblePassword,
textInputAction:
TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(
_cycleNumberFocusNode);
},
),
),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result ==
'error') {
print('error');
} else if (result ==
'access') {
print('access');
} else {
print(result);
striizerIdCTRL.text =
result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Strilizer ID required!';
}
return null;
},
controller: striizerIdCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 7 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Strilizer ID',
contentPadding:
EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType:
TextInputType.visiblePassword,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context).requestFocus(
_cycleNumberFocusNode);
},
),
),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
striizerIdCTRL.text = result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
),
],
),
SizedBox(
height: 20,
),
TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Cycle number required!';
}
return null;
},
controller: cycleNumberCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 7 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Cycle Number',
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _cycleNumberFocusNode,
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_descriptionFocosNode);
},
),
SizedBox(
height: 30,
),
CycleAddDatePicker(
dateCTRL: dateCTRL,
deviceBlockSize: _deviceBlockSize,
),
SizedBox(
height: 20.0,
),
Container(
margin: EdgeInsets.symmetric(vertical: 10),
child: Text(
'Labels included',
style: TextStyle(
color: kPink,
letterSpacing: 2,
fontSize: 5 * _deviceBlockSize,
),
),
),
),
),
],
),
SizedBox(
height: 20,
),
TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Cycle number required!';
}
return null;
},
controller: cycleNumberCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 7 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Cycle Number',
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _cycleNumberFocusNode,
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context).requestFocus(
_descriptionFocosNode);
},
),
SizedBox(
height: 30,
),
CycleAddDatePicker(
dateCTRL: dateCTRL,
deviceBlockSize: _deviceBlockSize,
),
SizedBox(
height: 20.0,
),
Container(
margin:
EdgeInsets.symmetric(vertical: 10),
child: Text(
'Labels included',
style: TextStyle(
color: kPink,
letterSpacing: 2,
fontSize: 5 * _deviceBlockSize,
),
),
),
Consumer<CyclesProvider>(
builder: (ctx, cycleProvider, _) =>
ListView.builder(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (ctx, index) =>
AddLabelBox(
Consumer<CyclesProvider>(
builder: (ctx, cycleProvider, _) =>
ListView.builder(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (ctx, index) => AddLabelBox(
text: 'Select Labels included',
iconColor: kPinkSub,
deviceBlockSize: _deviceBlockSize,
values:
cycleProvider.labelValues[index],
cycleProvider.labelValues[index],
vals: cycleProvider.labelVals,
initialLabelValue:
cycleProvider.initialLabelValue,
cycleProvider.initialLabelValue,
index: index,
hasRemoveButton:
cycleProvider.labelValues.length >
1
? true
: false,
cycleProvider.labelValues.length > 1
? true
: false,
),
itemCount:
cycleProvider.labelValues.length,
),
),
SizedBox(
height: 30,
),
TextFormField(
controller: descriptionCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 7 * _deviceBlockSize,
itemCount:
cycleProvider.labelValues.length,
),
),
SizedBox(
height: 30,
),
TextFormField(
controller: descriptionCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 7 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Description',
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.multiline,
focusNode: _descriptionFocosNode,
minLines: 1,
maxLines: 5,
),
SizedBox(
height: 70,
),
CycleAddSaveButton(
form: _form,
labelValues: Provider.of<CyclesProvider>(
context,
listen: false,
).labelValues,
cycleNumberCTRL: cycleNumberCTRL,
dateValue: dateCTRL.text,
descriptionCTRL: descriptionCTRL,
striizerIdCTRL: striizerIdCTRL,
deviceBlockSize: _deviceBlockSize,
),
SizedBox(
height: 100,
),
],
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Description',
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.multiline,
focusNode: _descriptionFocosNode,
minLines: 1,
maxLines: 5,
),
SizedBox(
height: 70,
),
CycleAddSaveButton(
form: _form,
labelValues: Provider.of<CyclesProvider>(
context,
listen: false,
).labelValues,
cycleNumberCTRL: cycleNumberCTRL,
dateValue: dateCTRL.text,
descriptionCTRL: descriptionCTRL,
striizerIdCTRL: striizerIdCTRL,
deviceBlockSize: _deviceBlockSize,
),
SizedBox(
height: 100,
),
],
),
),
)
: ConnectionErrorBox();
},
),
)
: ConnectionErrorBox();
},
),
),
),);
),
);
});
}
}
+35 -42
View File
@@ -52,51 +52,44 @@ class _CycleDetailScreenState extends State<CycleDetailScreen> {
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
},
child: SafeArea(
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Cycles',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
return SafeArea(
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Cycles',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: isEmpty
? Center(
child: Text('This Cycle doesnt exists!'),
)
: CycleDetailsDataBox(
datas: datas!,
deviceBlockSize: _deviceBlockSize,
)
: ConnectionErrorBox();
}),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
),
),
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: isEmpty
? Center(
child: Text('This Cycle doesnt exists!'),
)
: CycleDetailsDataBox(
datas: datas!,
deviceBlockSize: _deviceBlockSize,
)
: ConnectionErrorBox();
}),
),
);
}
+249 -261
View File
@@ -91,271 +91,259 @@ class _CycleFilterScreenState extends State<CycleFilterScreen> {
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
// Navigator.pushReplacementNamed(
// context,
// Routes.cycleResultScreen,
// );
// return true;
},
child: SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Cycles',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context)
.pushReplacementNamed(Routes.cycleResultScreen),
return SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Cycles',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: Padding(
padding: EdgeInsets.all(20),
child: ListView(
// crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Filter Cycles',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
),
SizedBox(
height: 20,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: cycleIdCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Cycle ID',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context).requestFocus(
_cycleNumberFocusNode);
},
),
),
// Spacer(),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
cycleIdCTRL.text = result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
),
],
),
SizedBox(
height: 30,
),
TextFormField(
controller: cycleNumberCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Cycle Number',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _cycleNumberFocusNode,
keyboardType: TextInputType.visiblePassword,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_strilizerIdFocusNode);
},
),
SizedBox(
height: 30,
),
Row(
children: [
Flexible(
flex: 8,
child: TextField(
controller: striizerIdCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Strilizer ID',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _strilizerIdFocusNode,
keyboardType:
TextInputType.visiblePassword,
textInputAction: TextInputAction.done,
),
),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
striizerIdCTRL.text = result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
),
],
),
SizedBox(
height: 20,
),
FilterHospitalBox(
deviceBlockSize: _deviceBlockSize,
hospitalCTRL: hospitalCTRL,
hospitalVals: hospitalVals,
label: 'Hospital',
),
SizedBox(
height: 20,
),
CycleFilterDatePicker(
dateCTRL: dateCTRL,
deviceBlockSize: _deviceBlockSize,
),
SizedBox(
height: 70,
),
CycleFilterSaveButton(
hospitalVals: hospitalVals,
hospitalCTRL: hospitalCTRL,
cycleIdCTRL: cycleIdCTRL,
cycleNumberCTRL: cycleNumberCTRL,
striizerIdCTRL: striizerIdCTRL,
dateCTRL: dateCTRL,
deviceBlockSize: _deviceBlockSize,
),
SizedBox(
height: 100,
),
],
),
)
: ConnectionErrorBox();
},
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context)
.pushReplacementNamed(Routes.cycleResultScreen),
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: Padding(
padding: EdgeInsets.all(20),
child: ListView(
// crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Filter Cycles',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
),
SizedBox(
height: 20,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: cycleIdCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Cycle ID',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context).requestFocus(
_cycleNumberFocusNode);
},
),
),
// Spacer(),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
cycleIdCTRL.text = result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
),
],
),
SizedBox(
height: 30,
),
TextFormField(
controller: cycleNumberCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Cycle Number',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _cycleNumberFocusNode,
keyboardType: TextInputType.visiblePassword,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_strilizerIdFocusNode);
},
),
SizedBox(
height: 30,
),
Row(
children: [
Flexible(
flex: 8,
child: TextField(
controller: striizerIdCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Strilizer ID',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _strilizerIdFocusNode,
keyboardType:
TextInputType.visiblePassword,
textInputAction: TextInputAction.done,
),
),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
striizerIdCTRL.text = result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
),
],
),
SizedBox(
height: 20,
),
FilterHospitalBox(
deviceBlockSize: _deviceBlockSize,
hospitalCTRL: hospitalCTRL,
hospitalVals: hospitalVals,
label: 'Hospital',
),
SizedBox(
height: 20,
),
CycleFilterDatePicker(
dateCTRL: dateCTRL,
deviceBlockSize: _deviceBlockSize,
),
SizedBox(
height: 70,
),
CycleFilterSaveButton(
hospitalVals: hospitalVals,
hospitalCTRL: hospitalCTRL,
cycleIdCTRL: cycleIdCTRL,
cycleNumberCTRL: cycleNumberCTRL,
striizerIdCTRL: striizerIdCTRL,
dateCTRL: dateCTRL,
deviceBlockSize: _deviceBlockSize,
),
SizedBox(
height: 100,
),
],
),
)
: ConnectionErrorBox();
},
),
),
),
);
@@ -323,7 +323,7 @@ class CycleResultFloatingButton extends StatelessWidget {
InkWell(
customBorder: CircleBorder(),
onTap: () {
Navigator.of(context).pushReplacementNamed(Routes.cycleAddScreen);
Navigator.of(context).pushNamed(Routes.cycleAddScreen);
},
child: Container(
padding: EdgeInsets.all(_deviceBlockSize),
+150 -157
View File
@@ -28,181 +28,174 @@ class _CycleScanScreenState extends State<CycleScanScreen> {
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
},
child: SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Cycles',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
return SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Cycles',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? ListView(
padding: EdgeInsets.symmetric(horizontal: 20),
children: <Widget>[
Container(
padding: EdgeInsets.only(top: 30),
child: Text(
'Looking for a Cycle?',
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black,
fontSize: 5.5 * _deviceBlockSize,
fontWeight: FontWeight.w700,
letterSpacing: 3,
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? ListView(
padding: EdgeInsets.symmetric(horizontal: 20),
children: <Widget>[
Container(
padding: EdgeInsets.only(top: 30),
child: Text(
'Looking for a Cycle?',
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black,
fontSize: 5.5 * _deviceBlockSize,
fontWeight: FontWeight.w700,
letterSpacing: 3,
),
),
GestureDetector(
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
height: 200,
decoration: BoxDecoration(border: Border.all()),
child: Center(
child: Text(
'Please Scan The Cycle Barcode',
style: TextStyle(
color: Colors.black,
fontSize: 5 * _deviceBlockSize,
fontWeight: FontWeight.w100,
letterSpacing: 3,
),
textAlign: TextAlign.center,
),
),
),
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
launch(
'https://cssd-doc.com/Show/Cycle/$result',
);
// Navigator.of(context).pushNamed(
// Routes.cycleDetailScreen,
// arguments: result,
// );
}
},
);
},
),
SizedBox(
height: 10.0,
),
Form(
key: _form,
child: TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Id required!!';
}
return null;
},
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
),
GestureDetector(
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
height: 200,
decoration: BoxDecoration(border: Border.all()),
child: Center(
child: Text(
'Please Scan The Cycle Barcode',
style: TextStyle(
color: Colors.black,
fontSize: 5 * _deviceBlockSize,
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Or enter a cycle ID',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
focusedBorder: UnderlineInputBorder(
// borderRadius: BorderRadius.only(Radius.circular(4)),
borderSide: BorderSide(
color: Colors.grey,
),
letterSpacing: 3,
),
textAlign: TextAlign.center,
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
),
),
SizedBox(
height: 70,
),
InkWell(
onTap: () {
if (!_form.currentState!.validate()) {
return;
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
launch(
'https://cssd-doc.com/Show/Cycle/$result',
);
// Navigator.of(context).pushNamed(
// Routes.cycleDetailScreen,
// arguments: result,
// );
}
},
);
},
),
SizedBox(
height: 10.0,
),
Form(
key: _form,
child: TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Id required!!';
}
launch(
'https://cssd-doc.com/Show/Cycle/${idCTRL.text}',
);
// Navigator.of(context).pushNamed(
// Routes.cycleDetailScreen,
// arguments: idCTRL.text,
// );
return null;
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5 * _deviceBlockSize,
vertical: 10,
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [kPink, kPinkSub],
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Or enter a cycle ID',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
focusedBorder: UnderlineInputBorder(
// borderRadius: BorderRadius.only(Radius.circular(4)),
borderSide: BorderSide(
color: Colors.grey,
),
borderRadius: BorderRadius.circular(7),
),
child: Align(
alignment: Alignment.center,
child: Text(
'Search',
style: TextStyle(
color: Colors.white,
fontSize: 5 * _deviceBlockSize,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
),
),
SizedBox(
height: 70,
),
InkWell(
onTap: () {
if (!_form.currentState!.validate()) {
return;
}
launch(
'https://cssd-doc.com/Show/Cycle/${idCTRL.text}',
);
// Navigator.of(context).pushNamed(
// Routes.cycleDetailScreen,
// arguments: idCTRL.text,
// );
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5 * _deviceBlockSize,
vertical: 10,
),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [kPink, kPinkSub],
),
borderRadius: BorderRadius.circular(7),
),
child: Align(
alignment: Alignment.center,
child: Text(
'Search',
style: TextStyle(
color: Colors.white,
fontSize: 5 * _deviceBlockSize,
),
),
),
),
],
)
: ConnectionErrorBox();
},
),
),
],
)
: ConnectionErrorBox();
},
),
),
),
+261 -273
View File
@@ -115,283 +115,271 @@ class _ItemAddScreenState extends State<ItemAddScreen> {
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
final itemProviderObject = Provider.of<ItemProvider>(context);
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
// Navigator.pushReplacementNamed(
// context,
// Routes.itemResultScreen,
// );
// return true;
},
child: SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Items',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context)
.pushReplacementNamed(Routes.itemResultScreen),
return SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Items',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isLoading
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: Form(
key: _form,
child: Padding(
padding: EdgeInsets.all(20),
child: ListView(
children: <Widget>[
Text(
'Add an Item',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 6 * _deviceBlockSize,
letterSpacing: 3,
),
),
SizedBox(
height: 20,
),
TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Name required!';
}
return null;
},
controller: nameCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 7 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Item Name',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemSizeFocusNode);
},
),
SizedBox(
height: 30,
),
TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Size required!';
}
return null;
},
controller: sizeCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 7 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Size',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemSizeFocusNode,
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemSpecificFocusNode);
},
),
SizedBox(
height: 30,
),
TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Specific required!';
}
return null;
},
controller: specificCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 7 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Specific',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemSpecificFocusNode,
keyboardType: TextInputType.visiblePassword,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemUdiFocusNode);
},
),
SizedBox(
height: 30,
),
TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'UDI required!';
}
return null;
},
controller: udiCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 7 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'UDI',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemUdiFocusNode,
keyboardType: TextInputType.visiblePassword,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_descriptionFocusNode);
},
),
SizedBox(
height: 30,
),
TextFormField(
controller: descriptionCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 7 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Description',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.multiline,
focusNode: _descriptionFocusNode,
minLines: 1,
maxLines: 5,
),
SizedBox(
height: 30.0,
),
UploaderImage(
deviceBlockSize: _deviceBlockSize,
providerObject: itemProviderObject,
),
SizedBox(
height: 70,
),
ItemAddSaveButton(
onTap: () {
_saveForm(
nameCTRL.text,
sizeCTRL.text,
specificCTRL.text,
udiCTRL.text,
descriptionCTRL.text,
itemProviderObject);
},
deviceBlockSize: _deviceBlockSize,
),
SizedBox(
height: 100,
),
],
),
),
)
: ConnectionErrorBox();
},
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context)
.pushReplacementNamed(Routes.itemResultScreen),
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isLoading
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: Form(
key: _form,
child: Padding(
padding: EdgeInsets.all(20),
child: ListView(
children: <Widget>[
Text(
'Add an Item',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 6 * _deviceBlockSize,
letterSpacing: 3,
),
),
SizedBox(
height: 20,
),
TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Name required!';
}
return null;
},
controller: nameCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 7 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Item Name',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemSizeFocusNode);
},
),
SizedBox(
height: 30,
),
TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Size required!';
}
return null;
},
controller: sizeCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 7 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Size',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemSizeFocusNode,
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemSpecificFocusNode);
},
),
SizedBox(
height: 30,
),
TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Specific required!';
}
return null;
},
controller: specificCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 7 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Specific',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemSpecificFocusNode,
keyboardType: TextInputType.visiblePassword,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemUdiFocusNode);
},
),
SizedBox(
height: 30,
),
TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'UDI required!';
}
return null;
},
controller: udiCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 7 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'UDI',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemUdiFocusNode,
keyboardType: TextInputType.visiblePassword,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_descriptionFocusNode);
},
),
SizedBox(
height: 30,
),
TextFormField(
controller: descriptionCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 7 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Description',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.multiline,
focusNode: _descriptionFocusNode,
minLines: 1,
maxLines: 5,
),
SizedBox(
height: 30.0,
),
UploaderImage(
deviceBlockSize: _deviceBlockSize,
providerObject: itemProviderObject,
),
SizedBox(
height: 70,
),
ItemAddSaveButton(
onTap: () {
_saveForm(
nameCTRL.text,
sizeCTRL.text,
specificCTRL.text,
udiCTRL.text,
descriptionCTRL.text,
itemProviderObject);
},
deviceBlockSize: _deviceBlockSize,
),
SizedBox(
height: 100,
),
],
),
),
)
: ConnectionErrorBox();
},
),
),
),
);
+312 -324
View File
@@ -84,334 +84,322 @@ class _ItemFilterScreenState extends State<ItemFilterScreen> {
final _media = MediaQuery.of(context);
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
// Navigator.pushReplacementNamed(
// context,
// Routes.itemResultScreen,
// );
// return true;
},
child: SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Items',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context)
.pushReplacementNamed(Routes.itemResultScreen),
return SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Items',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: Padding(
padding: EdgeInsets.all(20),
child: ListView(
children: <Widget>[
Text(
'Filter Items',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
),
SizedBox(
height: 20,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Item ID',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemNameFocusNode);
},
),
),
// Spacer(),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
idCTRL.text = result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
),
],
),
SizedBox(
height: 30,
),
TextFormField(
controller: nameCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Item Name',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemNameFocusNode,
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemUdiFocusNode);
},
),
SizedBox(
height: 30,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: udiCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'UDI',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemUdiFocusNode,
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemSizeFocusNode);
},
),
),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
udiCTRL.text = result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
),
],
),
SizedBox(
height: 30.0,
),
TextFormField(
controller: sizeCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Size',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemSizeFocusNode,
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemSpecificFocusNode);
},
),
SizedBox(
height: 30,
),
TextFormField(
controller: specificCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Specific',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemSpecificFocusNode,
keyboardType: TextInputType.visiblePassword,
textInputAction: TextInputAction.next,
),
SizedBox(
height: 30,
),
FilterHospitalBox(
deviceBlockSize: _deviceBlockSize,
hospitalCTRL: hospitalCTRL,
hospitalVals: hospitalVals,
label: 'Hospital',
),
SizedBox(
height: 90,
),
ItemFilterSaveButton(
hospitalVals: hospitalVals,
hospitalCTRL: hospitalCTRL,
idCTRL: idCTRL,
nameCTRL: nameCTRL,
udiCTRL: udiCTRL,
sizeCTRL: sizeCTRL,
specificCTRL: specificCTRL,
deviceBlockSize: _deviceBlockSize,
firstColor: kBlue,
secondColor: kBlueSub,
push: Routes.itemResultScreen,
),
SizedBox(
height: 100,
),
],
),
)
: ConnectionErrorBox();
},
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context)
.pushReplacementNamed(Routes.itemResultScreen),
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: Padding(
padding: EdgeInsets.all(20),
child: ListView(
children: <Widget>[
Text(
'Filter Items',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
),
SizedBox(
height: 20,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Item ID',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemNameFocusNode);
},
),
),
// Spacer(),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
idCTRL.text = result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
),
],
),
SizedBox(
height: 30,
),
TextFormField(
controller: nameCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Item Name',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemNameFocusNode,
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemUdiFocusNode);
},
),
SizedBox(
height: 30,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: udiCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'UDI',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemUdiFocusNode,
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemSizeFocusNode);
},
),
),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
udiCTRL.text = result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
),
],
),
SizedBox(
height: 30.0,
),
TextFormField(
controller: sizeCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Size',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemSizeFocusNode,
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemSpecificFocusNode);
},
),
SizedBox(
height: 30,
),
TextFormField(
controller: specificCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Specific',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemSpecificFocusNode,
keyboardType: TextInputType.visiblePassword,
textInputAction: TextInputAction.next,
),
SizedBox(
height: 30,
),
FilterHospitalBox(
deviceBlockSize: _deviceBlockSize,
hospitalCTRL: hospitalCTRL,
hospitalVals: hospitalVals,
label: 'Hospital',
),
SizedBox(
height: 90,
),
ItemFilterSaveButton(
hospitalVals: hospitalVals,
hospitalCTRL: hospitalCTRL,
idCTRL: idCTRL,
nameCTRL: nameCTRL,
udiCTRL: udiCTRL,
sizeCTRL: sizeCTRL,
specificCTRL: specificCTRL,
deviceBlockSize: _deviceBlockSize,
firstColor: kBlue,
secondColor: kBlueSub,
push: Routes.itemResultScreen,
),
SizedBox(
height: 100,
),
],
),
)
: ConnectionErrorBox();
},
),
),
),
);
+1 -1
View File
@@ -352,7 +352,7 @@ class ItemResultFloatingButton extends StatelessWidget {
InkWell(
customBorder: CircleBorder(),
onTap: () {
Navigator.of(context).pushReplacementNamed(Routes.itemAddScreen);
Navigator.of(context).pushNamed(Routes.itemAddScreen);
},
child: Container(
padding: EdgeInsets.all(_deviceBlockSize),
+150 -158
View File
@@ -5,7 +5,6 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../config/routes.dart';
import '../../providers/connectivity.dart';
import '../../widgets/Global/internet_error.dart';
@@ -26,181 +25,174 @@ class _ItemScanScreenState extends State<ItemScanScreen> {
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
},
child: SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Items',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
return SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Items',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? ListView(
padding: EdgeInsets.symmetric(horizontal: 20),
children: <Widget>[
Container(
padding: EdgeInsets.only(top: 30),
child: Text(
'Looking for an Item?',
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black,
fontSize: 5.5 * _deviceBlockSize,
fontWeight: FontWeight.w700,
letterSpacing: 3,
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? ListView(
padding: EdgeInsets.symmetric(horizontal: 20),
children: <Widget>[
Container(
padding: EdgeInsets.only(top: 30),
child: Text(
'Looking for an Item?',
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black,
fontSize: 5.5 * _deviceBlockSize,
fontWeight: FontWeight.w700,
letterSpacing: 3,
),
),
GestureDetector(
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
height: 200,
decoration: BoxDecoration(border: Border.all()),
child: Center(
child: Text(
'Please Scan The Item Barcode',
style: TextStyle(
color: Colors.black,
fontSize: 5 * _deviceBlockSize,
fontWeight: FontWeight.w100,
letterSpacing: 3,
),
textAlign: TextAlign.center,
),
),
),
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
launch(
'https://cssd-doc.com/Show/Item/$result',
);
// Navigator.of(context).pushNamed(
// Routes.cycleDetailScreen,
// arguments: result,
// );
}
},
);
},
),
SizedBox(
height: 10.0,
),
Form(
key: _form,
child: TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Id required!!';
}
return null;
},
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
),
GestureDetector(
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
height: 200,
decoration: BoxDecoration(border: Border.all()),
child: Center(
child: Text(
'Please Scan The Item Barcode',
style: TextStyle(
color: Colors.black,
fontSize: 5 * _deviceBlockSize,
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Or enter an Item ID',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
focusedBorder: UnderlineInputBorder(
// borderRadius: BorderRadius.only(Radius.circular(4)),
borderSide: BorderSide(
color: Colors.grey,
),
letterSpacing: 3,
),
textAlign: TextAlign.center,
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
),
),
SizedBox(
height: 70,
),
InkWell(
onTap: () {
if (!_form.currentState!.validate()) {
return;
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
launch(
'https://cssd-doc.com/Show/Item/$result',
);
// Navigator.of(context).pushNamed(
// Routes.cycleDetailScreen,
// arguments: result,
// );
}
},
);
},
),
SizedBox(
height: 10.0,
),
Form(
key: _form,
child: TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Id required!!';
}
launch(
'https://cssd-doc.com/Show/Item/${idCTRL.text}',
);
// Navigator.of(context).pushNamed(
// Routes.cycleDetailScreen,
// arguments: idCTRL.text,
// );
return null;
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5 * _deviceBlockSize,
vertical: 10,
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [kBlue, kBlueSub],
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Or enter an Item ID',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
focusedBorder: UnderlineInputBorder(
// borderRadius: BorderRadius.only(Radius.circular(4)),
borderSide: BorderSide(
color: Colors.grey,
),
borderRadius: BorderRadius.circular(7),
),
child: Align(
alignment: Alignment.center,
child: Text(
'Search',
style: TextStyle(
color: Colors.white,
fontSize: 5 * _deviceBlockSize,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
),
),
SizedBox(
height: 70,
),
InkWell(
onTap: () {
if (!_form.currentState!.validate()) {
return;
}
launch(
'https://cssd-doc.com/Show/Item/${idCTRL.text}',
);
// Navigator.of(context).pushNamed(
// Routes.cycleDetailScreen,
// arguments: idCTRL.text,
// );
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5 * _deviceBlockSize,
vertical: 10,
),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [kBlue, kBlueSub],
),
borderRadius: BorderRadius.circular(7),
),
child: Align(
alignment: Alignment.center,
child: Text(
'Search',
style: TextStyle(
color: Colors.white,
fontSize: 5 * _deviceBlockSize,
),
),
),
),
],
)
: ConnectionErrorBox();
},
),
),
],
)
: ConnectionErrorBox();
},
),
),
),
+287 -303
View File
@@ -77,314 +77,298 @@ class _LabelAddScreenState extends State<LabelAddScreen> {
// String initialLabelValue;
return Consumer<LabelsProvider>(
builder: (context, labelsProvider, _) {
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
// labelsProvider.resetLoadingButton();
// Navigator.pushReplacementNamed(
// context,
// Routes.labelResultScreen,
// );
// return true;
},
child: SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Labels',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () {
labelsProvider.resetLoadingButton();
Navigator.of(context)
.pushReplacementNamed(Routes.labelResultScreen);
},
return SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Labels',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: Form(
key: _form,
child: Padding(
padding: EdgeInsets.all(20),
child: ListView(
children: <Widget>[
Text(
'Add a Label',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 6 * _deviceBlockSize,
letterSpacing: 3,
),
),
SizedBox(
height: 20,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
onChanged: (val) {
setState(() {
lotNumberCTRL.text = val +
' - ' +
cycleNumberCTRL.text;
});
},
validator: (val) {
if (val!.isEmpty) {
return 'Strilizer ID required!';
}
return null;
},
controller: striizerIdCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons
.sortNumericDown,
size: 7 * _deviceBlockSize),
isDense: true,
labelText: 'Strilizer ID',
contentPadding:
EdgeInsets.symmetric(
vertical: 2,
horizontal: 3),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize:
4 * _deviceBlockSize,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType:
TextInputType.visiblePassword,
textInputAction:
TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(
_cycleNumberFocusNode);
},
),
),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result ==
'error') {
print('error');
} else if (result ==
'access') {
print('access');
} else {
print(result);
striizerIdCTRL.text =
result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
),
],
),
SizedBox(
height: 20,
),
TextFormField(
onChanged: (val) {
setState(
() {
lotNumberCTRL.text =
striizerIdCTRL.text +
' - ' +
val;
},
);
},
validator: (val) {
if (val!.isEmpty) {
return 'Cycle number required!';
}
return null;
},
controller: cycleNumberCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 7 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Cycle Number',
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _cycleNumberFocusNode,
keyboardType: TextInputType.number,
textInputAction: TextInputAction.done,
),
SizedBox(
height: 20,
),
TextFormField(
readOnly: true,
controller: lotNumberCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 7 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Lot Number',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType:
TextInputType.visiblePassword,
),
SizedBox(
height: 20,
),
Container(
margin:
EdgeInsets.symmetric(vertical: 10),
child: Text(
'Packages included',
style: TextStyle(
color: kLightBlue,
letterSpacing: 2,
fontSize: 5 * _deviceBlockSize,
),
),
),
Consumer<LabelsProvider>(
builder: (ctx, labelProvider, _) {
return ListView.builder(
physics:
NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (ctx, index) =>
AddPackageBox(
text: 'Package ID',
iconColor: kLightBlueSub,
deviceBlockSize: _deviceBlockSize,
values: labelProvider
.packageValues[index],
vals: labelProvider.packageVals,
initialLabelValue: labelProvider
.initialPackageValue,
index: index,
),
itemCount: labelProvider
.packageValues.length,
);
}),
SizedBox(
height: 10,
),
LabelAddDatePicker(
dateCTRL: sDateCTRL,
deviceBlockSize: _deviceBlockSize,
label: 'Sterile Date',
),
SizedBox(
height: 20,
),
LabelAddDatePicker(
dateCTRL: eDateCTRL,
deviceBlockSize: _deviceBlockSize,
label: 'Expire Date',
),
SizedBox(
height: 70,
),
LabelAddSaveButton(
form: _form,
lotNumberCTRL: lotNumberCTRL,
cycleNumberCTRL: cycleNumberCTRL,
sDateCTRL: sDateCTRL,
packageValue:
Provider.of<LabelsProvider>(
context,
listen: false,
).packageValues,
eDateCTRL: eDateCTRL,
striizerIdCTRL: striizerIdCTRL,
deviceBlockSize: _deviceBlockSize,
),
SizedBox(
height: 100,
),
],
),
),
)
: ConnectionErrorBox();
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () {
labelsProvider.resetLoadingButton();
Navigator.of(context)
.pushReplacementNamed(Routes.labelResultScreen);
},
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: Form(
key: _form,
child: Padding(
padding: EdgeInsets.all(20),
child: ListView(
children: <Widget>[
Text(
'Add a Label',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 6 * _deviceBlockSize,
letterSpacing: 3,
),
),
SizedBox(
height: 20,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
onChanged: (val) {
setState(() {
lotNumberCTRL.text = val +
' - ' +
cycleNumberCTRL.text;
});
},
validator: (val) {
if (val!.isEmpty) {
return 'Strilizer ID required!';
}
return null;
},
controller: striizerIdCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons
.sortNumericDown,
size: 7 * _deviceBlockSize),
isDense: true,
labelText: 'Strilizer ID',
contentPadding:
EdgeInsets.symmetric(
vertical: 2,
horizontal: 3),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType:
TextInputType.visiblePassword,
textInputAction:
TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(
_cycleNumberFocusNode);
},
),
),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result ==
'error') {
print('error');
} else if (result ==
'access') {
print('access');
} else {
print(result);
striizerIdCTRL.text =
result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
),
],
),
SizedBox(
height: 20,
),
TextFormField(
onChanged: (val) {
setState(
() {
lotNumberCTRL.text =
striizerIdCTRL.text +
' - ' +
val;
},
);
},
validator: (val) {
if (val!.isEmpty) {
return 'Cycle number required!';
}
return null;
},
controller: cycleNumberCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 7 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Cycle Number',
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _cycleNumberFocusNode,
keyboardType: TextInputType.number,
textInputAction: TextInputAction.done,
),
SizedBox(
height: 20,
),
TextFormField(
readOnly: true,
controller: lotNumberCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 7 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Lot Number',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType:
TextInputType.visiblePassword,
),
SizedBox(
height: 20,
),
Container(
margin:
EdgeInsets.symmetric(vertical: 10),
child: Text(
'Packages included',
style: TextStyle(
color: kLightBlue,
letterSpacing: 2,
fontSize: 5 * _deviceBlockSize,
),
),
),
Consumer<LabelsProvider>(
builder: (ctx, labelProvider, _) {
return ListView.builder(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (ctx, index) =>
AddPackageBox(
text: 'Package ID',
iconColor: kLightBlueSub,
deviceBlockSize: _deviceBlockSize,
values: labelProvider
.packageValues[index],
vals: labelProvider.packageVals,
initialLabelValue:
labelProvider.initialPackageValue,
index: index,
),
itemCount:
labelProvider.packageValues.length,
);
}),
SizedBox(
height: 10,
),
LabelAddDatePicker(
dateCTRL: sDateCTRL,
deviceBlockSize: _deviceBlockSize,
label: 'Sterile Date',
),
SizedBox(
height: 20,
),
LabelAddDatePicker(
dateCTRL: eDateCTRL,
deviceBlockSize: _deviceBlockSize,
label: 'Expire Date',
),
SizedBox(
height: 70,
),
LabelAddSaveButton(
form: _form,
lotNumberCTRL: lotNumberCTRL,
cycleNumberCTRL: cycleNumberCTRL,
sDateCTRL: sDateCTRL,
packageValue: Provider.of<LabelsProvider>(
context,
listen: false,
).packageValues,
eDateCTRL: eDateCTRL,
striizerIdCTRL: striizerIdCTRL,
deviceBlockSize: _deviceBlockSize,
),
SizedBox(
height: 100,
),
],
),
),
)
: ConnectionErrorBox();
},
),
),
),
);
+35 -42
View File
@@ -52,51 +52,44 @@ class _LabelDetailScreenState extends State<LabelDetailScreen> {
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
},
child: SafeArea(
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Labels',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
return SafeArea(
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Labels',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: isEmpty
? Center(
child: Text('This Label dos\'nt exists!'),
)
: LabelDetailsDataBox(
datas: datas!,
deviceBlockSize: _deviceBlockSize,
)
: ConnectionErrorBox();
}),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
),
),
body: Consumer<ConnectivityProvider>(builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: isEmpty
? Center(
child: Text('This Label dos\'nt exists!'),
)
: LabelDetailsDataBox(
datas: datas!,
deviceBlockSize: _deviceBlockSize,
)
: ConnectionErrorBox();
}),
),
);
}
+239 -251
View File
@@ -80,261 +80,249 @@ class _LabelFilterScreenState extends State<LabelFilterScreen> {
final _media = MediaQuery.of(context);
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
// Navigator.pushReplacementNamed(
// context,
// Routes.labelResultScreen,
// );
// return true;
},
child: SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Labels',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context)
.pushReplacementNamed(Routes.labelResultScreen),
return SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Labels',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: Padding(
padding: EdgeInsets.all(20),
child: ListView(
children: <Widget>[
Text(
'Filter Labels',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
),
SizedBox(
height: 20,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: labelIdCTRl,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Label ID',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context).requestFocus(
_cycleNumberFocusNode);
},
),
),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
labelIdCTRl.text = result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
),
],
),
SizedBox(
height: 30,
),
TextFormField(
controller: cycleNumberCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Cycle Number',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _cycleNumberFocusNode,
keyboardType: TextInputType.visiblePassword,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_strilizerIdFocusNode);
},
),
SizedBox(
height: 30,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: striizerIdCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Strilizer ID',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
textInputAction: TextInputAction.done,
keyboardType:
TextInputType.visiblePassword,
focusNode: _strilizerIdFocusNode,
),
),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
striizerIdCTRL.text = result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
),
],
),
SizedBox(
height: 30,
),
LabelFilterSelectorBox(
deviceBlockSize: _deviceBlockSize,
hospitalCTRL: hospitalCTRL,
hospitalVals: hospitalVals,
),
SizedBox(
height: 70,
),
LabelFilterSaveButton(
hospitalVals: hospitalVals,
hospitalCTRL: hospitalCTRL,
labelIdCTRl: labelIdCTRl,
cycleNumberCTRL: cycleNumberCTRL,
striizerIdCTRL: striizerIdCTRL,
deviceBlockSize: _deviceBlockSize,
),
SizedBox(
height: 50,
),
// DropDownBox(values: ['Washer ID']),
],
),
)
: ConnectionErrorBox();
},
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context)
.pushReplacementNamed(Routes.labelResultScreen),
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: Padding(
padding: EdgeInsets.all(20),
child: ListView(
children: <Widget>[
Text(
'Filter Labels',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
),
SizedBox(
height: 20,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: labelIdCTRl,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Label ID',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context).requestFocus(
_cycleNumberFocusNode);
},
),
),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
labelIdCTRl.text = result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
),
],
),
SizedBox(
height: 30,
),
TextFormField(
controller: cycleNumberCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Cycle Number',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _cycleNumberFocusNode,
keyboardType: TextInputType.visiblePassword,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_strilizerIdFocusNode);
},
),
SizedBox(
height: 30,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: striizerIdCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Strilizer ID',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
textInputAction: TextInputAction.done,
keyboardType:
TextInputType.visiblePassword,
focusNode: _strilizerIdFocusNode,
),
),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
striizerIdCTRL.text = result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
),
],
),
SizedBox(
height: 30,
),
LabelFilterSelectorBox(
deviceBlockSize: _deviceBlockSize,
hospitalCTRL: hospitalCTRL,
hospitalVals: hospitalVals,
),
SizedBox(
height: 70,
),
LabelFilterSaveButton(
hospitalVals: hospitalVals,
hospitalCTRL: hospitalCTRL,
labelIdCTRl: labelIdCTRl,
cycleNumberCTRL: cycleNumberCTRL,
striizerIdCTRL: striizerIdCTRL,
deviceBlockSize: _deviceBlockSize,
),
SizedBox(
height: 50,
),
// DropDownBox(values: ['Washer ID']),
],
),
)
: ConnectionErrorBox();
},
),
),
),
);
+59 -66
View File
@@ -30,79 +30,72 @@ class _LabelScanScreenState extends State<LabelScanScreen> {
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
},
child: SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Labels',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
return SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Labels',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? ListView(
padding: EdgeInsets.symmetric(horizontal: 20),
children: <Widget>[
Container(
padding: EdgeInsets.only(top: 30),
child: Text(
'Looking for a Label?',
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black,
fontSize: 5.5 * _deviceBlockSize,
fontWeight: FontWeight.w700,
letterSpacing: 3,
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? ListView(
padding: EdgeInsets.symmetric(horizontal: 20),
children: <Widget>[
Container(
padding: EdgeInsets.only(top: 30),
child: Text(
'Looking for a Label?',
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black,
fontSize: 5.5 * _deviceBlockSize,
fontWeight: FontWeight.w700,
letterSpacing: 3,
),
),
LabelScanBox(),
SizedBox(
height: 10,
),
Form(
key: _form,
child: LabelScanInputBox(
idCTRL: idCTRL,
deviceBlockSize: _deviceBlockSize,
),
),
SizedBox(
height: 70,
),
FilterScanSaveButton(
form: _form,
),
LabelScanBox(),
SizedBox(
height: 10,
),
Form(
key: _form,
child: LabelScanInputBox(
idCTRL: idCTRL,
deviceBlockSize: _deviceBlockSize,
),
],
)
: ConnectionErrorBox();
},
),
),
SizedBox(
height: 70,
),
FilterScanSaveButton(
form: _form,
idCTRL: idCTRL,
deviceBlockSize: _deviceBlockSize,
),
],
)
: ConnectionErrorBox();
},
),
),
),
@@ -52,58 +52,51 @@ class _MyItemsDetailScreenState extends State<MyItemsDetailScreen> {
final _media = MediaQuery.of(context);
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
},
child: SafeArea(
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'My Items',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
return SafeArea(
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'My Items',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: isEmpty
? Center(
child: Text('This Item does\'nt exists!'),
)
: MyItemsDetailsDataBox(
datas: datas!,
deviceBlockSize: _deviceBlockSize,
push: () {
Navigator.pushNamed(
context, Routes.itemsTransferScreen,
arguments: datas);
},
)
: ConnectionErrorBox();
},
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: isEmpty
? Center(
child: Text('This Item does\'nt exists!'),
)
: MyItemsDetailsDataBox(
datas: datas!,
deviceBlockSize: _deviceBlockSize,
push: () {
Navigator.pushNamed(
context, Routes.itemsTransferScreen,
arguments: datas);
},
)
: ConnectionErrorBox();
},
),
),
);
}
+301 -313
View File
@@ -53,323 +53,311 @@ class _MyItemsFilterScreenState extends State<MyItemsFilterScreen> {
final _media = MediaQuery.of(context);
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
// Navigator.pushReplacementNamed(
// context,
// Routes.myItemsResultScreen,
// );
// return true;
},
child: SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'My Items',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context)
.pushReplacementNamed(Routes.myItemsResultScreen),
return SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'My Items',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: Padding(
padding: EdgeInsets.all(20),
child: ListView(
children: <Widget>[
Text(
'Filter My Items',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
),
SizedBox(
height: 20,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Item ID',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemNameFocusNode);
},
),
),
// Spacer(),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
idCTRL.text = result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
),
],
),
SizedBox(
height: 30,
),
TextFormField(
controller: nameCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Item Name',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemNameFocusNode,
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemUdiFocusNode);
},
),
SizedBox(
height: 30,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: udiCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'UDI',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemUdiFocusNode,
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemSizeFocusNode);
},
),
),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
idCTRL.text = result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
),
],
),
SizedBox(
height: 30.0,
),
TextFormField(
controller: sizeCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Size',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemSizeFocusNode,
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemSpecificFocusNode);
},
),
SizedBox(
height: 30,
),
TextFormField(
controller: specificCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Specific',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemSpecificFocusNode,
keyboardType: TextInputType.visiblePassword,
textInputAction: TextInputAction.next,
),
SizedBox(
height: 90,
),
MyItemFilterSaveButton(
idCTRL: idCTRL,
nameCTRL: nameCTRL,
udiCTRL: udiCTRL,
sizeCTRL: sizeCTRL,
specificCTRL: specificCTRL,
deviceBlockSize: _deviceBlockSize,
firstColor: kDarkBlue,
secondColor: kDarkBlueSub,
push: Routes.myItemsResultScreen,
),
SizedBox(
height: 100,
),
],
),
)
: ConnectionErrorBox();
},
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context)
.pushReplacementNamed(Routes.myItemsResultScreen),
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: Padding(
padding: EdgeInsets.all(20),
child: ListView(
children: <Widget>[
Text(
'Filter My Items',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
),
SizedBox(
height: 20,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Item ID',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemNameFocusNode);
},
),
),
// Spacer(),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
idCTRL.text = result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
),
],
),
SizedBox(
height: 30,
),
TextFormField(
controller: nameCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Item Name',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemNameFocusNode,
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemUdiFocusNode);
},
),
SizedBox(
height: 30,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: udiCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'UDI',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemUdiFocusNode,
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemSizeFocusNode);
},
),
),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
idCTRL.text = result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
),
],
),
SizedBox(
height: 30.0,
),
TextFormField(
controller: sizeCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Size',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemSizeFocusNode,
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_itemSpecificFocusNode);
},
),
SizedBox(
height: 30,
),
TextFormField(
controller: specificCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Specific',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _itemSpecificFocusNode,
keyboardType: TextInputType.visiblePassword,
textInputAction: TextInputAction.next,
),
SizedBox(
height: 90,
),
MyItemFilterSaveButton(
idCTRL: idCTRL,
nameCTRL: nameCTRL,
udiCTRL: udiCTRL,
sizeCTRL: sizeCTRL,
specificCTRL: specificCTRL,
deviceBlockSize: _deviceBlockSize,
firstColor: kDarkBlue,
secondColor: kDarkBlueSub,
push: Routes.myItemsResultScreen,
),
SizedBox(
height: 100,
),
],
),
)
: ConnectionErrorBox();
},
),
),
),
);
+150 -157
View File
@@ -26,181 +26,174 @@ class _MyItemsScanScreenState extends State<MyItemsScanScreen> {
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
final double _deviceWidth = _media.size.width;
final double _deviceBlockSize = _deviceWidth / 100;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
},
child: SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'My Items',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
return SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'My Items',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? ListView(
padding: EdgeInsets.symmetric(horizontal: 20),
children: <Widget>[
Container(
padding: EdgeInsets.only(top: 30),
child: Text(
'Looking for an Item?',
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black,
fontSize: 5.5 * _deviceBlockSize,
fontWeight: FontWeight.w700,
letterSpacing: 3,
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? ListView(
padding: EdgeInsets.symmetric(horizontal: 20),
children: <Widget>[
Container(
padding: EdgeInsets.only(top: 30),
child: Text(
'Looking for an Item?',
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black,
fontSize: 5.5 * _deviceBlockSize,
fontWeight: FontWeight.w700,
letterSpacing: 3,
),
),
GestureDetector(
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
height: 200,
decoration: BoxDecoration(border: Border.all()),
child: Center(
child: Text(
'Please Scan The Item Barcode',
style: TextStyle(
color: Colors.black,
fontSize: 5 * _deviceBlockSize,
fontWeight: FontWeight.w100,
letterSpacing: 3,
),
textAlign: TextAlign.center,
),
),
),
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
launch(
'https://cssd-doc.com/Show/Item/$result',
);
// Navigator.of(context).pushNamed(
// Routes.cycleDetailScreen,
// arguments: result,
// );
}
},
);
},
),
SizedBox(
height: 10.0,
),
Form(
key: _form,
child: TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Id required!!';
}
return null;
},
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
),
GestureDetector(
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
height: 200,
decoration: BoxDecoration(border: Border.all()),
child: Center(
child: Text(
'Please Scan The Item Barcode',
style: TextStyle(
color: Colors.black,
fontSize: 5 * _deviceBlockSize,
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Or enter an Item ID',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
focusedBorder: UnderlineInputBorder(
// borderRadius: BorderRadius.only(Radius.circular(4)),
borderSide: BorderSide(
color: Colors.grey,
),
letterSpacing: 3,
),
textAlign: TextAlign.center,
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
),
),
SizedBox(
height: 70,
),
InkWell(
onTap: () {
if (!_form.currentState!.validate()) {
return;
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
launch(
'https://cssd-doc.com/Show/Item/$result',
);
// Navigator.of(context).pushNamed(
// Routes.cycleDetailScreen,
// arguments: result,
// );
}
},
);
},
),
SizedBox(
height: 10.0,
),
Form(
key: _form,
child: TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Id required!!';
}
launch(
'https://cssd-doc.com/Show/Item/${idCTRL.text}',
);
// Navigator.of(context).pushNamed(
// Routes.cycleDetailScreen,
// arguments: idCTRL.text,
// );
return null;
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5 * _deviceBlockSize,
vertical: 10,
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [kDarkBlue, kDarkBlueSub],
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Or enter an Item ID',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
focusedBorder: UnderlineInputBorder(
// borderRadius: BorderRadius.only(Radius.circular(4)),
borderSide: BorderSide(
color: Colors.grey,
),
borderRadius: BorderRadius.circular(7),
),
child: Align(
alignment: Alignment.center,
child: Text(
'Search',
style: TextStyle(
color: Colors.white,
fontSize: 5 * _deviceBlockSize,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
),
),
SizedBox(
height: 70,
),
InkWell(
onTap: () {
if (!_form.currentState!.validate()) {
return;
}
launch(
'https://cssd-doc.com/Show/Item/${idCTRL.text}',
);
// Navigator.of(context).pushNamed(
// Routes.cycleDetailScreen,
// arguments: idCTRL.text,
// );
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5 * _deviceBlockSize,
vertical: 10,
),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [kDarkBlue, kDarkBlueSub],
),
borderRadius: BorderRadius.circular(7),
),
child: Align(
alignment: Alignment.center,
child: Text(
'Search',
style: TextStyle(
color: Colors.white,
fontSize: 5 * _deviceBlockSize,
),
),
),
),
],
)
: ConnectionErrorBox();
},
),
),
],
)
: ConnectionErrorBox();
},
),
),
),
@@ -79,250 +79,240 @@ class _ItemsTransferScreenState extends State<ItemsTransferScreen> {
final _media = MediaQuery.of(context);
final double _deviceWidth = _media.size.width;
final double _deviceBlockSize = _deviceWidth / 100;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
},
child: SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Item Details',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
return SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Item Details',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? Padding(
padding: EdgeInsets.only(
top: 20,
right: 20,
bottom: 40,
left: 20,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
ResultBanner(
deviceBlockSize: _deviceBlockSize,
text: 'Transfer to',
hasFilterObject: false,
push: Routes.myItemsFilterScreen,
),
SizedBox(
height: 20.0,
),
ResultSearchBox(
searchCTRL: searchCTRL,
text: 'user',
text2: 'name or ID',
deviceBlockSize: _deviceBlockSize,
textInputType: TextInputType.visiblePassword,
onChanged: (value) {
Provider.of<UsersProvider>(context,
listen: false)
.searchUsers(value);
},
),
SizedBox(
height: 20,
),
Expanded(
child: Consumer<UsersProvider>(
builder: (context, userResults, _) {
return userResults.isLoading
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: userResults.usersBox?.length != null
? ListView.builder(
controller: sc,
itemBuilder: (context, index) {
return TransferDataBox(
deviceBlockSize:
_deviceBlockSize,
user: userResults
.usersBox?[index],
clickColor: kDarkBlue,
isClicked: userResults
.selectedUserIndex ==
index,
onTap: (userId) {
Provider.of<UsersProvider>(
context,
listen: false,
).selectUser(index);
print(userId);
Provider.of<UsersProvider>(
context,
listen: false)
.saveUserId = userId;
Provider.of<UsersProvider>(
context,
listen: false)
.selectedUserForItems =
userResults
.usersBox?[index];
},
);
},
itemCount:
userResults.usersBox?.length,
shrinkWrap: true,
)
: Container(
child: Center(
child: Text(
"There is no user to show."),
),
);
},
),
),
TransferDestroyButton(
deviceBlockSize: _deviceBlockSize,
firstColor: kDarkBlue,
secondColor: kDarkBlueSub,
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
'Are you sure to transfer this Item?',
style: TextStyle(
fontSize: 4 * _deviceBlockSize,
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? Padding(
padding: EdgeInsets.only(
top: 20,
right: 20,
bottom: 40,
left: 20,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
ResultBanner(
deviceBlockSize: _deviceBlockSize,
text: 'Transfer to',
hasFilterObject: false,
push: Routes.myItemsFilterScreen,
),
SizedBox(
height: 20.0,
),
ResultSearchBox(
searchCTRL: searchCTRL,
text: 'user',
text2: 'name or ID',
deviceBlockSize: _deviceBlockSize,
textInputType: TextInputType.visiblePassword,
onChanged: (value) {
Provider.of<UsersProvider>(context, listen: false)
.searchUsers(value);
},
),
SizedBox(
height: 20,
),
Expanded(
child: Consumer<UsersProvider>(
builder: (context, userResults, _) {
return userResults.isLoading
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
),
content: SizedBox(
width: _deviceBlockSize,
height: 320,
child: Column(
children: [
Text(
'By approving, your item will be transferred the specified user. It can be undone unless the user reject the transfer.',
style: TextStyle(
fontSize: 3 * _deviceBlockSize,
),
),
SizedBox(
height: 10.0,
),
ItemCard(
_deviceBlockSize, itemData!),
SizedBox(
height: 5.0,
),
Row(
children: [
Spacer(),
Text('To'),
SizedBox(
width: 5.0,
),
TransferDataBox(
deviceBlockSize:
_deviceBlockSize,
user: Provider.of<
UsersProvider>(
context)
.selectedUserForItems,
)
],
),
SizedBox(
height: 20.0,
),
Consumer<MyItemProvider>(
builder:
(context, myItemProvider, _) {
return TransferDestroyButton(
deviceBlockSize:
_deviceBlockSize,
firstColor: kDarkBlue,
secondColor: kDarkBlueSub,
onTap: () async {
myItemProvider
.setLoadingButton();
await Provider.of<
MyItemProvider>(
context,
listen: false,
).transferItems(
itemData!.id,
await Provider.of<
UsersProvider>(
)
: userResults.usersBox?.length != null
? ListView.builder(
controller: sc,
itemBuilder: (context, index) {
return TransferDataBox(
deviceBlockSize:
_deviceBlockSize,
user: userResults
.usersBox?[index],
clickColor: kDarkBlue,
isClicked: userResults
.selectedUserIndex ==
index,
onTap: (userId) {
Provider.of<UsersProvider>(
context,
listen: false,
).selectUser(index);
print(userId);
Provider.of<UsersProvider>(
context,
listen: false)
.saveUserId = userId;
Provider.of<UsersProvider>(
context,
listen: false)
.saveUserId!,
);
Navigator.of(context).pop();
Navigator.of(context).pop();
Navigator.of(context).pop();
myItemProvider
.resetLoadingButton();
Fluttertoast.showToast(
msg:
"The item is transferred.",
toastLength:
Toast.LENGTH_SHORT,
gravity:
ToastGravity.BOTTOM,
);
},
text: 'Transfer',
isLoadingButton:
myItemProvider
.isloadingButton,
);
},
.selectedUserForItems =
userResults
.usersBox?[index];
},
);
},
itemCount:
userResults.usersBox?.length,
shrinkWrap: true,
)
: Container(
child: Center(
child: Text(
"There is no user to show."),
),
SizedBox(
height: 5.0,
),
CancelTransferButton(
deviceBlockSize: _deviceBlockSize,
color: kPink,
onTap: () {
Navigator.pop(context);
},
),
],
),
),
);
},
);
);
},
text: 'Transfer',
),
],
),
)
: ConnectionErrorBox();
},
),
),
TransferDestroyButton(
deviceBlockSize: _deviceBlockSize,
firstColor: kDarkBlue,
secondColor: kDarkBlueSub,
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
'Are you sure to transfer this Item?',
style: TextStyle(
fontSize: 4 * _deviceBlockSize,
),
),
content: SizedBox(
width: _deviceBlockSize,
height: 320,
child: Column(
children: [
Text(
'By approving, your item will be transferred the specified user. It can be undone unless the user reject the transfer.',
style: TextStyle(
fontSize: 3 * _deviceBlockSize,
),
),
SizedBox(
height: 10.0,
),
ItemCard(_deviceBlockSize, itemData!),
SizedBox(
height: 5.0,
),
Row(
children: [
Spacer(),
Text('To'),
SizedBox(
width: 5.0,
),
TransferDataBox(
deviceBlockSize:
_deviceBlockSize,
user:
Provider.of<UsersProvider>(
context)
.selectedUserForItems,
)
],
),
SizedBox(
height: 20.0,
),
Consumer<MyItemProvider>(
builder:
(context, myItemProvider, _) {
return TransferDestroyButton(
deviceBlockSize:
_deviceBlockSize,
firstColor: kDarkBlue,
secondColor: kDarkBlueSub,
onTap: () async {
myItemProvider
.setLoadingButton();
await Provider.of<
MyItemProvider>(
context,
listen: false,
).transferItems(
itemData!.id,
await Provider.of<
UsersProvider>(
context,
listen: false)
.saveUserId!,
);
Navigator.of(context).pop();
Navigator.of(context).pop();
Navigator.of(context).pop();
myItemProvider
.resetLoadingButton();
Fluttertoast.showToast(
msg:
"The item is transferred.",
toastLength:
Toast.LENGTH_SHORT,
gravity:
ToastGravity.BOTTOM,
);
},
text: 'Transfer',
isLoadingButton: myItemProvider
.isloadingButton,
);
},
),
SizedBox(
height: 5.0,
),
CancelTransferButton(
deviceBlockSize: _deviceBlockSize,
color: kPink,
onTap: () {
Navigator.pop(context);
},
),
],
),
),
);
},
);
},
text: 'Transfer',
),
],
),
)
: ConnectionErrorBox();
},
),
),
),
@@ -52,58 +52,51 @@ class _MyPackagesDetailScreenState extends State<MyPackagesDetailScreen> {
final _media = MediaQuery.of(context);
final double _deviceWidth = _media.size.width;
final double _deviceBlockSize = _deviceWidth / 100;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
},
child: SafeArea(
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'My Packages',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
return SafeArea(
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'My Packages',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: isEmpty
? Center(
child: Text('This Package does\'nt exists!'),
)
: MyPackageDetailsDataBox(
datas: datas!,
deviceBlockSize: _deviceBlockSize,
push: () {
Navigator.pushNamed(
context, Routes.packagesTransferScreen,
arguments: datas);
},
)
: ConnectionErrorBox();
},
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: isEmpty
? Center(
child: Text('This Package does\'nt exists!'),
)
: MyPackageDetailsDataBox(
datas: datas!,
deviceBlockSize: _deviceBlockSize,
push: () {
Navigator.pushNamed(
context, Routes.packagesTransferScreen,
arguments: datas);
},
)
: ConnectionErrorBox();
},
),
),
);
}
@@ -51,260 +51,248 @@ class _MyPackageFilterScreenState extends State<MyPackageFilterScreen> {
final _media = MediaQuery.of(context);
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
// Navigator.pushReplacementNamed(
// context,
// Routes.myPackagesResultScreen,
// );
// return true;
},
child: SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'My Packages',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context)
.pushReplacementNamed(Routes.myPackagesResultScreen),
return SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'My Packages',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: Padding(
padding: EdgeInsets.all(20),
child: ListView(
// crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Filter My Packages',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
),
SizedBox(
height: 20,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Package ID',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_nameFocusNode);
},
),
),
// Spacer(),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
idCTRL.text = result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
)
],
),
SizedBox(
height: 30,
),
TextFormField(
controller: nameCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Package Name',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _nameFocusNode,
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_udiFocusNode);
},
),
// SizedBox(
// height: 30,
// ),
// Row(
// children: [
// Flexible(
// flex: 8,
// child: TextFormField(
// controller: udiCTRL,
// decoration: InputDecoration(
// icon: Icon(
// FontAwesomeIcons.alignLeft,
// size: 6 * _deviceBlockSize,
// ),
// labelStyle: TextStyle(
// fontWeight: FontWeight.w100,
// fontSize: 4 * _deviceBlockSize,
// ),
// labelText: 'UDI',
// isDense: true,
// contentPadding: EdgeInsets.symmetric(
// vertical: 2,
// horizontal: 3,
// ),
// ),
// style: TextStyle(
// fontWeight: FontWeight.w700,
// fontSize: 5 * _deviceBlockSize,
// ),
// focusNode: _udiFocusNode,
// keyboardType: TextInputType.text,
// textInputAction: TextInputAction.next,
// ),
// ),
// Flexible(
// flex: 1,
// child: InkWell(
// onTap: () {
// scan().then(
// (String result) {
// if (result == 'cancel') {
// print('cancel');
// } else if (result == 'error') {
// print('error');
// } else if (result == 'access') {
// print('access');
// } else {
// print(result);
// idCTRL.text = result;
// }
// },
// );
// },
// child: Container(
// padding: EdgeInsets.all(8),
// decoration: BoxDecoration(
// shape: BoxShape.circle,
// color: Colors.black,
// ),
// child: Icon(
// Icons.qr_code_scanner,
// size: 5 * _deviceBlockSize,
// color: Colors.white,
// ),
// ),
// ),
// )
// ],
// ),
SizedBox(
height: 90,
),
MyPackagesFilterSaveButton(
idCTRL: idCTRL,
nameCTRL: nameCTRL,
// udiCTRL: udiCTRL,
deviceBlockSize: _deviceBlockSize,
firstColor: kDarkPurple,
secondColor: kDarkPurpleSub,
push: Routes.myPackagesResultScreen,
),
SizedBox(
height: 100,
),
],
),
)
: ConnectionErrorBox();
},
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context)
.pushReplacementNamed(Routes.myPackagesResultScreen),
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: Padding(
padding: EdgeInsets.all(20),
child: ListView(
// crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Filter My Packages',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
),
SizedBox(
height: 20,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Package ID',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_nameFocusNode);
},
),
),
// Spacer(),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
idCTRL.text = result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
)
],
),
SizedBox(
height: 30,
),
TextFormField(
controller: nameCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Package Name',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _nameFocusNode,
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_udiFocusNode);
},
),
// SizedBox(
// height: 30,
// ),
// Row(
// children: [
// Flexible(
// flex: 8,
// child: TextFormField(
// controller: udiCTRL,
// decoration: InputDecoration(
// icon: Icon(
// FontAwesomeIcons.alignLeft,
// size: 6 * _deviceBlockSize,
// ),
// labelStyle: TextStyle(
// fontWeight: FontWeight.w100,
// fontSize: 4 * _deviceBlockSize,
// ),
// labelText: 'UDI',
// isDense: true,
// contentPadding: EdgeInsets.symmetric(
// vertical: 2,
// horizontal: 3,
// ),
// ),
// style: TextStyle(
// fontWeight: FontWeight.w700,
// fontSize: 5 * _deviceBlockSize,
// ),
// focusNode: _udiFocusNode,
// keyboardType: TextInputType.text,
// textInputAction: TextInputAction.next,
// ),
// ),
// Flexible(
// flex: 1,
// child: InkWell(
// onTap: () {
// scan().then(
// (String result) {
// if (result == 'cancel') {
// print('cancel');
// } else if (result == 'error') {
// print('error');
// } else if (result == 'access') {
// print('access');
// } else {
// print(result);
// idCTRL.text = result;
// }
// },
// );
// },
// child: Container(
// padding: EdgeInsets.all(8),
// decoration: BoxDecoration(
// shape: BoxShape.circle,
// color: Colors.black,
// ),
// child: Icon(
// Icons.qr_code_scanner,
// size: 5 * _deviceBlockSize,
// color: Colors.white,
// ),
// ),
// ),
// )
// ],
// ),
SizedBox(
height: 90,
),
MyPackagesFilterSaveButton(
idCTRL: idCTRL,
nameCTRL: nameCTRL,
// udiCTRL: udiCTRL,
deviceBlockSize: _deviceBlockSize,
firstColor: kDarkPurple,
secondColor: kDarkPurpleSub,
push: Routes.myPackagesResultScreen,
),
SizedBox(
height: 100,
),
],
),
)
: ConnectionErrorBox();
},
),
),
),
);
@@ -26,181 +26,174 @@ class _MyPackagesScanScreenState extends State<MyPackagesScanScreen> {
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
final double _deviceWidth = _media.size.width;
final double _deviceBlockSize = _deviceWidth / 100;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
},
child: SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'My Packages',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
return SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'My Packages',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? ListView(
padding: EdgeInsets.symmetric(horizontal: 20),
children: <Widget>[
Container(
padding: EdgeInsets.only(top: 30),
child: Text(
'Looking for a Package?',
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black,
fontSize: 5.5 * _deviceBlockSize,
fontWeight: FontWeight.w700,
letterSpacing: 3,
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? ListView(
padding: EdgeInsets.symmetric(horizontal: 20),
children: <Widget>[
Container(
padding: EdgeInsets.only(top: 30),
child: Text(
'Looking for a Package?',
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black,
fontSize: 5.5 * _deviceBlockSize,
fontWeight: FontWeight.w700,
letterSpacing: 3,
),
),
GestureDetector(
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
height: 200,
decoration: BoxDecoration(border: Border.all()),
child: Center(
child: Text(
'Please Scan The Package Barcode',
style: TextStyle(
color: Colors.black,
fontSize: 5 * _deviceBlockSize,
fontWeight: FontWeight.w100,
letterSpacing: 3,
),
textAlign: TextAlign.center,
),
),
),
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
launch(
'https://cssd-doc.com/Show/Package/$result',
);
// Navigator.of(context).pushNamed(
// Routes.cycleDetailScreen,
// arguments: result,
// );
}
},
);
},
),
SizedBox(
height: 10.0,
),
Form(
key: _form,
child: TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Id required!!';
}
return null;
},
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
),
GestureDetector(
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
height: 200,
decoration: BoxDecoration(border: Border.all()),
child: Center(
child: Text(
'Please Scan The Package Barcode',
style: TextStyle(
color: Colors.black,
fontSize: 5 * _deviceBlockSize,
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Or enter a Package ID',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
focusedBorder: UnderlineInputBorder(
// borderRadius: BorderRadius.only(Radius.circular(4)),
borderSide: BorderSide(
color: Colors.grey,
),
letterSpacing: 3,
),
textAlign: TextAlign.center,
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
),
),
SizedBox(
height: 70,
),
InkWell(
onTap: () {
if (!_form.currentState!.validate()) {
return;
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
launch(
'https://cssd-doc.com/Show/Package/$result',
);
// Navigator.of(context).pushNamed(
// Routes.cycleDetailScreen,
// arguments: result,
// );
}
},
);
},
),
SizedBox(
height: 10.0,
),
Form(
key: _form,
child: TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Id required!!';
}
launch(
'https://cssd-doc.com/Show/Package/${idCTRL.text}',
);
// Navigator.of(context).pushNamed(
// Routes.cycleDetailScreen,
// arguments: idCTRL.text,
// );
return null;
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5 * _deviceBlockSize,
vertical: 10,
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [kDarkPurple, kDarkPurpleSub],
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Or enter a Package ID',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
focusedBorder: UnderlineInputBorder(
// borderRadius: BorderRadius.only(Radius.circular(4)),
borderSide: BorderSide(
color: Colors.grey,
),
borderRadius: BorderRadius.circular(7),
),
child: Align(
alignment: Alignment.center,
child: Text(
'Search',
style: TextStyle(
color: Colors.white,
fontSize: 5 * _deviceBlockSize,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
),
),
SizedBox(
height: 70,
),
InkWell(
onTap: () {
if (!_form.currentState!.validate()) {
return;
}
launch(
'https://cssd-doc.com/Show/Package/${idCTRL.text}',
);
// Navigator.of(context).pushNamed(
// Routes.cycleDetailScreen,
// arguments: idCTRL.text,
// );
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5 * _deviceBlockSize,
vertical: 10,
),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [kDarkPurple, kDarkPurpleSub],
),
borderRadius: BorderRadius.circular(7),
),
child: Align(
alignment: Alignment.center,
child: Text(
'Search',
style: TextStyle(
color: Colors.white,
fontSize: 5 * _deviceBlockSize,
),
),
),
),
],
)
: ConnectionErrorBox();
},
),
),
],
)
: ConnectionErrorBox();
},
),
),
),
@@ -74,220 +74,208 @@ class _PackageTransferScreenState extends State<PackageTransferScreen> {
final _media = MediaQuery.of(context);
final double _deviceWidth = _media.size.width;
final double _deviceBlockSize = _deviceWidth / 100;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
},
child: SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Package Details',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
return SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Package Details',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? Padding(
padding: EdgeInsets.only(
top: 20,
right: 20,
bottom: 40,
left: 20,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
ResultBanner(
deviceBlockSize: _deviceBlockSize,
text: 'Transfer to',
hasFilterObject: false,
push: Routes.myItemsFilterScreen,
),
SizedBox(
height: 20.0,
),
ResultSearchBox(
searchCTRL: searchCTRL,
text: 'user',
text2: 'name or ID',
deviceBlockSize: _deviceBlockSize,
textInputType: TextInputType.visiblePassword,
onChanged: (value) {
Provider.of<UsersProvider>(context,
listen: false)
.searchUsers(value);
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? Padding(
padding: EdgeInsets.only(
top: 20,
right: 20,
bottom: 40,
left: 20,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
ResultBanner(
deviceBlockSize: _deviceBlockSize,
text: 'Transfer to',
hasFilterObject: false,
push: Routes.myItemsFilterScreen,
),
SizedBox(
height: 20.0,
),
ResultSearchBox(
searchCTRL: searchCTRL,
text: 'user',
text2: 'name or ID',
deviceBlockSize: _deviceBlockSize,
textInputType: TextInputType.visiblePassword,
onChanged: (value) {
Provider.of<UsersProvider>(context, listen: false)
.searchUsers(value);
},
),
SizedBox(
height: 20,
),
Expanded(
child: Consumer<UsersProvider>(
builder: (context, userResults, _) {
return userResults.isLoading
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: ListView.builder(
controller: sc,
itemBuilder: (context, index) {
return TransferDataBox(
deviceBlockSize: _deviceBlockSize,
user: userResults.usersBox?[index],
clickColor: kDarkPurple,
isClicked:
userResults.selectedUserIndex ==
index,
onTap: (userId) {
Provider.of<UsersProvider>(
context,
listen: false,
).selectUser(index);
print(userId);
Provider.of<UsersProvider>(
context,
listen: false)
.saveUserId = userId;
Provider.of<UsersProvider>(
context,
listen: false)
.selectedUserForPackages =
userResults.usersBox?[index];
},
);
},
itemCount: userResults.usersBox?.length,
shrinkWrap: true,
);
},
),
SizedBox(
height: 20,
),
Expanded(
child: Consumer<UsersProvider>(
builder: (context, userResults, _) {
return userResults.isLoading
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
TransferDestroyButton(
deviceBlockSize: _deviceBlockSize,
firstColor: kDarkPurple,
secondColor: kDarkPurpleSub,
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
'Are you sure to transfer this Package?',
style: TextStyle(
fontSize: 4 * _deviceBlockSize,
),
),
content: SizedBox(
width: _deviceBlockSize,
height: 300,
child: Column(
children: [
Text(
'By approving, all items in your package will be transferred the specified user. it can be undone unless the user reject the transfer.',
style: TextStyle(
fontSize: 3 * _deviceBlockSize,
),
),
)
: ListView.builder(
controller: sc,
itemBuilder: (context, index) {
return TransferDataBox(
deviceBlockSize: _deviceBlockSize,
user:
userResults.usersBox?[index],
clickColor: kDarkPurple,
isClicked: userResults
.selectedUserIndex ==
index,
onTap: (userId) {
Provider.of<UsersProvider>(
context,
listen: false,
).selectUser(index);
print(userId);
SizedBox(
height: 10.0,
),
PackageCard(
_deviceBlockSize, packageData!),
SizedBox(
height: 5.0,
),
Row(
children: [
Spacer(),
Text('To'),
SizedBox(
width: 5.0,
),
TransferDataBox(
deviceBlockSize:
_deviceBlockSize,
user: Provider.of<
UsersProvider>(context)
.selectedUserForPackages,
)
],
),
SizedBox(
height: 20.0,
),
TransferDestroyButton(
deviceBlockSize: _deviceBlockSize,
firstColor: kDarkPurple,
secondColor: kDarkPurpleSub,
onTap: () {
Provider.of<MyPackageProvider>(
context,
listen: false,
).transferPackage(
packageData!.id,
Provider.of<UsersProvider>(
context,
listen: false)
.saveUserId = userId;
Provider.of<UsersProvider>(
context,
listen: false)
.selectedUserForPackages =
userResults
.usersBox?[index];
},
);
},
itemCount:
userResults.usersBox?.length,
shrinkWrap: true,
);
.saveUserId!,
);
Navigator.of(context).pop();
Navigator.of(context)
.popAndPushNamed(Routes
.myPackagesResultScreen);
},
text: 'Transfer',
),
SizedBox(
height: 5.0,
),
CancelTransferButton(
deviceBlockSize: _deviceBlockSize,
color: kPink,
onTap: () {
Navigator.pop(context);
},
),
],
),
),
);
},
),
),
TransferDestroyButton(
deviceBlockSize: _deviceBlockSize,
firstColor: kDarkPurple,
secondColor: kDarkPurpleSub,
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
'Are you sure to transfer this Package?',
style: TextStyle(
fontSize: 4 * _deviceBlockSize,
),
),
content: SizedBox(
width: _deviceBlockSize,
height: 300,
child: Column(
children: [
Text(
'By approving, all items in your package will be transferred the specified user. it can be undone unless the user reject the transfer.',
style: TextStyle(
fontSize: 3 * _deviceBlockSize,
),
),
SizedBox(
height: 10.0,
),
PackageCard(
_deviceBlockSize, packageData!),
SizedBox(
height: 5.0,
),
Row(
children: [
Spacer(),
Text('To'),
SizedBox(
width: 5.0,
),
TransferDataBox(
deviceBlockSize:
_deviceBlockSize,
user: Provider.of<
UsersProvider>(
context)
.selectedUserForPackages,
)
],
),
SizedBox(
height: 20.0,
),
TransferDestroyButton(
deviceBlockSize: _deviceBlockSize,
firstColor: kDarkPurple,
secondColor: kDarkPurpleSub,
onTap: () {
Provider.of<MyPackageProvider>(
context,
listen: false,
).transferPackage(
packageData!.id,
Provider.of<UsersProvider>(
context,
listen: false)
.saveUserId!,
);
Navigator.of(context).pop();
Navigator.of(context)
.popAndPushNamed(Routes
.myPackagesResultScreen);
},
text: 'Transfer',
),
SizedBox(
height: 5.0,
),
CancelTransferButton(
deviceBlockSize: _deviceBlockSize,
color: kPink,
onTap: () {
Navigator.pop(context);
},
),
],
),
),
);
},
);
},
text: 'Transfer',
),
],
),
)
: ConnectionErrorBox();
},
),
);
},
text: 'Transfer',
),
],
),
)
: ConnectionErrorBox();
},
),
),
),
+213 -230
View File
@@ -66,241 +66,224 @@ class _PackageAddScreenState extends State<PackageAddScreen> {
final double _deviceBlockSize = _devicewidth / 100;
return Consumer<PackageProvider>(
builder: (context, packageProvider, _) {
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
// packageProvider.resetLoadingButton();
// Navigator.pushReplacementNamed(
// context,
// Routes.packageResultScreen,
// );
// return true;
},
child: SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Packages',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () {
packageProvider.resetLoadingButton();
Navigator.of(context)
.pushReplacementNamed(Routes.packageResultScreen);
},
return SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Packages',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: Form(
key: _form,
child: Padding(
padding: EdgeInsets.all(20),
child: ListView(
children: <Widget>[
Text(
'Add a Package',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 6 * _deviceBlockSize,
letterSpacing: 3,
),
),
SizedBox(
height: 20,
),
TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Name required!';
}
return null;
},
controller: nameCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 7 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Package Name',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context).requestFocus(
_packageUdiFocusNode);
},
),
SizedBox(
height: 30,
),
// TextFormField(
// validator: (val) {
// if (val!.isEmpty) {
// return 'UDI required!';
// }
// return null;
// },
// controller: udiCTRL,
// decoration: InputDecoration(
// icon: Icon(
// FontAwesomeIcons.alignLeft,
// size: 7 * _deviceBlockSize,
// ),
// labelStyle: TextStyle(
// fontWeight: FontWeight.w100,
// fontSize: 4 * _deviceBlockSize,
// ),
// isDense: true,
// labelText: 'UDI',
// contentPadding: EdgeInsets.symmetric(
// vertical: 2, horizontal: 3),
// ),
// style: TextStyle(
// fontWeight: FontWeight.w700,
// fontSize: 5 * _deviceBlockSize,
// ),
// focusNode: _packageUdiFocusNode,
// keyboardType: TextInputType.visiblePassword,
// textInputAction: TextInputAction.next,
// onFieldSubmitted: (_) {
// FocusScope.of(context)
// .requestFocus(_descriptionFocusNode);
// },
// ),
// SizedBox(
// height: 20,
// ),
Container(
margin:
EdgeInsets.symmetric(vertical: 5),
child: Text(
'Items included',
style: TextStyle(
color: kPurple,
letterSpacing: 2,
fontSize: 5 * _deviceBlockSize,
),
),
),
Consumer<PackageProvider>(
builder: (ctx, packageProvider, _) =>
ListView.builder(
physics:
NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (ctx, index) =>
AddItemBox(
text: 'Select Items Included',
iconColor: kPurpleSub,
deviceBlockSize: _deviceBlockSize,
values: packageProvider
.itemValues[index],
vals: packageProvider.itemVals,
initialItemValue: packageProvider
.initialItemValue,
index: index,
hasRemoveButton: packageProvider
.itemValues.length >
1
? true
: false,
),
itemCount:
packageProvider.itemValues.length,
),
),
SizedBox(
height: 30,
),
TextFormField(
controller: descriptionCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 7 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Description',
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.multiline,
focusNode: _descriptionFocusNode,
minLines: 1,
maxLines: 5,
),
SizedBox(
height: 70,
),
PackageAddSaveButton(
form: _form,
itemValues:
Provider.of<PackageProvider>(
context,
listen: false,
).itemValues,
nameCTRL: nameCTRL,
// udiCTRL: udiCTRL,
dateValue: dateCTRL.text,
descriptionCTRL: descriptionCTRL,
deviceBlockSize: _deviceBlockSize,
),
SizedBox(
height: 100,
),
],
),
),
)
: ConnectionErrorBox();
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () {
packageProvider.resetLoadingButton();
Navigator.of(context)
.pushReplacementNamed(Routes.packageResultScreen);
},
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: Form(
key: _form,
child: Padding(
padding: EdgeInsets.all(20),
child: ListView(
children: <Widget>[
Text(
'Add a Package',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 6 * _deviceBlockSize,
letterSpacing: 3,
),
),
SizedBox(
height: 20,
),
TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Name required!';
}
return null;
},
controller: nameCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 7 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Package Name',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_packageUdiFocusNode);
},
),
SizedBox(
height: 30,
),
// TextFormField(
// validator: (val) {
// if (val!.isEmpty) {
// return 'UDI required!';
// }
// return null;
// },
// controller: udiCTRL,
// decoration: InputDecoration(
// icon: Icon(
// FontAwesomeIcons.alignLeft,
// size: 7 * _deviceBlockSize,
// ),
// labelStyle: TextStyle(
// fontWeight: FontWeight.w100,
// fontSize: 4 * _deviceBlockSize,
// ),
// isDense: true,
// labelText: 'UDI',
// contentPadding: EdgeInsets.symmetric(
// vertical: 2, horizontal: 3),
// ),
// style: TextStyle(
// fontWeight: FontWeight.w700,
// fontSize: 5 * _deviceBlockSize,
// ),
// focusNode: _packageUdiFocusNode,
// keyboardType: TextInputType.visiblePassword,
// textInputAction: TextInputAction.next,
// onFieldSubmitted: (_) {
// FocusScope.of(context)
// .requestFocus(_descriptionFocusNode);
// },
// ),
// SizedBox(
// height: 20,
// ),
Container(
margin: EdgeInsets.symmetric(vertical: 5),
child: Text(
'Items included',
style: TextStyle(
color: kPurple,
letterSpacing: 2,
fontSize: 5 * _deviceBlockSize,
),
),
),
Consumer<PackageProvider>(
builder: (ctx, packageProvider, _) =>
ListView.builder(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (ctx, index) => AddItemBox(
text: 'Select Items Included',
iconColor: kPurpleSub,
deviceBlockSize: _deviceBlockSize,
values:
packageProvider.itemValues[index],
vals: packageProvider.itemVals,
initialItemValue:
packageProvider.initialItemValue,
index: index,
hasRemoveButton: packageProvider
.itemValues.length >
1
? true
: false,
),
itemCount:
packageProvider.itemValues.length,
),
),
SizedBox(
height: 30,
),
TextFormField(
controller: descriptionCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 7 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Description',
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.multiline,
focusNode: _descriptionFocusNode,
minLines: 1,
maxLines: 5,
),
SizedBox(
height: 70,
),
PackageAddSaveButton(
form: _form,
itemValues: Provider.of<PackageProvider>(
context,
listen: false,
).itemValues,
nameCTRL: nameCTRL,
// udiCTRL: udiCTRL,
dateValue: dateCTRL.text,
descriptionCTRL: descriptionCTRL,
deviceBlockSize: _deviceBlockSize,
),
SizedBox(
height: 100,
),
],
),
),
)
: ConnectionErrorBox();
},
),
),
),
);
@@ -47,63 +47,56 @@ class _PackageDetailScreenState extends State<PackageDetailScreen> {
final _media = MediaQuery.of(context);
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pop();
},
child: SafeArea(
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Packages',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
return SafeArea(
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Packages',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: isEmpty
? Center(
child: Text('This Package does\'nt exists!'),
)
: PackageDetailsDataBox(
datas: datas!,
deviceBlockSize: _deviceBlockSize,
goToAddLabelPage: () {
Navigator.pushNamed(
context,
Routes.labelAddScreen,
arguments: {
"id": datas!.id,
"name": datas!.name
},
);
},
)
: ConnectionErrorBox();
},
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: isEmpty
? Center(
child: Text('This Package does\'nt exists!'),
)
: PackageDetailsDataBox(
datas: datas!,
deviceBlockSize: _deviceBlockSize,
goToAddLabelPage: () {
Navigator.pushNamed(
context,
Routes.labelAddScreen,
arguments: {
"id": datas!.id,
"name": datas!.name
},
);
},
)
: ConnectionErrorBox();
},
),
),
);
}
+206 -218
View File
@@ -78,228 +78,216 @@ class _PackageFilterScreenState extends State<PackageFilterScreen> {
final _media = MediaQuery.of(context);
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
// Navigator.pushReplacementNamed(
// context,
// Routes.packageResultScreen,
// );
// return true;
},
child: SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Packages',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context)
.pushReplacementNamed(Routes.packageResultScreen),
return SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Packages',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: Padding(
padding: EdgeInsets.all(20),
child: ListView(
// crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Filter Packages',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
),
SizedBox(
height: 20,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Package ID',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_nameFocusNode);
},
),
),
// Spacer(),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
idCTRL.text = result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
)
],
),
SizedBox(
height: 30,
),
TextFormField(
controller: nameCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Package Name',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _nameFocusNode,
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_udiFocusNode);
},
),
SizedBox(
height: 30,
),
// TextFormField(
// controller: udiCTRL,
// decoration: InputDecoration(
// icon: Icon(
// FontAwesomeIcons.alignLeft,
// size: 6 * _deviceBlockSize,
// ),
// labelStyle: TextStyle(
// fontWeight: FontWeight.w100,
// fontSize: 4 * _deviceBlockSize,
// ),
// labelText: 'UDI',
// isDense: true,
// contentPadding: EdgeInsets.symmetric(
// vertical: 2,
// horizontal: 3,
// ),
// ),
// style: TextStyle(
// fontWeight: FontWeight.w700,
// fontSize: 5 * _deviceBlockSize,
// ),
// focusNode: _udiFocusNode,
// keyboardType: TextInputType.text,
// textInputAction: TextInputAction.next,
// ),
// SizedBox(
// height: 30.0,
// ),
FilterHospitalBox(
deviceBlockSize: _deviceBlockSize,
hospitalCTRL: hospitalCTRL,
hospitalVals: hospitalVals,
label: 'Hospital',
),
SizedBox(
height: 90,
),
PackageFilterSaveButton(
hospitalVals: hospitalVals,
hospitalCTRL: hospitalCTRL,
idCTRL: idCTRL,
nameCTRL: nameCTRL,
// udiCTRL: udiCTRL,
deviceBlockSize: _deviceBlockSize,
),
SizedBox(
height: 100,
),
],
),
)
: ConnectionErrorBox();
},
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context)
.pushReplacementNamed(Routes.packageResultScreen),
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: Padding(
padding: EdgeInsets.all(20),
child: ListView(
// crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Filter Packages',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
),
SizedBox(
height: 20,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Package ID',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_nameFocusNode);
},
),
),
// Spacer(),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
idCTRL.text = result;
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
),
)
],
),
SizedBox(
height: 30,
),
TextFormField(
controller: nameCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.alignLeft,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Package Name',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
focusNode: _nameFocusNode,
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_udiFocusNode);
},
),
SizedBox(
height: 30,
),
// TextFormField(
// controller: udiCTRL,
// decoration: InputDecoration(
// icon: Icon(
// FontAwesomeIcons.alignLeft,
// size: 6 * _deviceBlockSize,
// ),
// labelStyle: TextStyle(
// fontWeight: FontWeight.w100,
// fontSize: 4 * _deviceBlockSize,
// ),
// labelText: 'UDI',
// isDense: true,
// contentPadding: EdgeInsets.symmetric(
// vertical: 2,
// horizontal: 3,
// ),
// ),
// style: TextStyle(
// fontWeight: FontWeight.w700,
// fontSize: 5 * _deviceBlockSize,
// ),
// focusNode: _udiFocusNode,
// keyboardType: TextInputType.text,
// textInputAction: TextInputAction.next,
// ),
// SizedBox(
// height: 30.0,
// ),
FilterHospitalBox(
deviceBlockSize: _deviceBlockSize,
hospitalCTRL: hospitalCTRL,
hospitalVals: hospitalVals,
label: 'Hospital',
),
SizedBox(
height: 90,
),
PackageFilterSaveButton(
hospitalVals: hospitalVals,
hospitalCTRL: hospitalCTRL,
idCTRL: idCTRL,
nameCTRL: nameCTRL,
// udiCTRL: udiCTRL,
deviceBlockSize: _deviceBlockSize,
),
SizedBox(
height: 100,
),
],
),
)
: ConnectionErrorBox();
},
),
),
),
);
@@ -327,7 +327,7 @@ class PackageResultFloatingButton extends StatelessWidget {
InkWell(
customBorder: CircleBorder(),
onTap: () {
Navigator.of(context).pushReplacementNamed(Routes.packageAddScreen);
Navigator.of(context).pushNamed(Routes.packageAddScreen);
},
child: Container(
padding: EdgeInsets.all(_deviceBlockSize),
+150 -157
View File
@@ -26,181 +26,174 @@ class _PackageScanScreenState extends State<PackageScanScreen> {
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
},
child: SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Packages',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
return SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Packages',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? ListView(
padding: EdgeInsets.symmetric(horizontal: 20),
children: <Widget>[
Container(
padding: EdgeInsets.only(top: 30),
child: Text(
'Looking for a Package?',
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black,
fontSize: 5.5 * _deviceBlockSize,
fontWeight: FontWeight.w700,
letterSpacing: 3,
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? ListView(
padding: EdgeInsets.symmetric(horizontal: 20),
children: <Widget>[
Container(
padding: EdgeInsets.only(top: 30),
child: Text(
'Looking for a Package?',
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black,
fontSize: 5.5 * _deviceBlockSize,
fontWeight: FontWeight.w700,
letterSpacing: 3,
),
),
GestureDetector(
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
height: 200,
decoration: BoxDecoration(border: Border.all()),
child: Center(
child: Text(
'Please Scan The Package Barcode',
style: TextStyle(
color: Colors.black,
fontSize: 5 * _deviceBlockSize,
fontWeight: FontWeight.w100,
letterSpacing: 3,
),
textAlign: TextAlign.center,
),
),
),
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
launch(
'https://cssd-doc.com/Show/Package/$result',
);
// Navigator.of(context).pushNamed(
// Routes.cycleDetailScreen,
// arguments: result,
// );
}
},
);
},
),
SizedBox(
height: 10.0,
),
Form(
key: _form,
child: TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Id required!!';
}
return null;
},
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
),
GestureDetector(
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
height: 200,
decoration: BoxDecoration(border: Border.all()),
child: Center(
child: Text(
'Please Scan The Package Barcode',
style: TextStyle(
color: Colors.black,
fontSize: 5 * _deviceBlockSize,
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Or enter a Package ID',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
focusedBorder: UnderlineInputBorder(
// borderRadius: BorderRadius.only(Radius.circular(4)),
borderSide: BorderSide(
color: Colors.grey,
),
letterSpacing: 3,
),
textAlign: TextAlign.center,
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
),
),
SizedBox(
height: 70,
),
InkWell(
onTap: () {
if (!_form.currentState!.validate()) {
return;
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
launch(
'https://cssd-doc.com/Show/Package/$result',
);
// Navigator.of(context).pushNamed(
// Routes.cycleDetailScreen,
// arguments: result,
// );
}
},
);
},
),
SizedBox(
height: 10.0,
),
Form(
key: _form,
child: TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Id required!!';
}
launch(
'https://cssd-doc.com/Show/Package/${idCTRL.text}',
);
// Navigator.of(context).pushNamed(
// Routes.cycleDetailScreen,
// arguments: idCTRL.text,
// );
return null;
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5 * _deviceBlockSize,
vertical: 10,
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [kPurple, kPurpleSub],
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Or enter a Package ID',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
focusedBorder: UnderlineInputBorder(
// borderRadius: BorderRadius.only(Radius.circular(4)),
borderSide: BorderSide(
color: Colors.grey,
),
borderRadius: BorderRadius.circular(7),
),
child: Align(
alignment: Alignment.center,
child: Text(
'Search',
style: TextStyle(
color: Colors.white,
fontSize: 5 * _deviceBlockSize,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
),
),
SizedBox(
height: 70,
),
InkWell(
onTap: () {
if (!_form.currentState!.validate()) {
return;
}
launch(
'https://cssd-doc.com/Show/Package/${idCTRL.text}',
);
// Navigator.of(context).pushNamed(
// Routes.cycleDetailScreen,
// arguments: idCTRL.text,
// );
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5 * _deviceBlockSize,
vertical: 10,
),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [kPurple, kPurpleSub],
),
borderRadius: BorderRadius.circular(7),
),
child: Align(
alignment: Alignment.center,
child: Text(
'Search',
style: TextStyle(
color: Colors.white,
fontSize: 5 * _deviceBlockSize,
),
),
),
),
],
)
: ConnectionErrorBox();
},
),
),
],
)
: ConnectionErrorBox();
},
),
),
),
+204 -219
View File
@@ -49,244 +49,229 @@ class _TestResultAddScreenState extends State<TestResultAddScreen> {
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
// Navigator.pushReplacementNamed(
// context,
// Routes.testResultScreen,
// );
// return true;
},
child: SafeArea(
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Test Results',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
// padding: EdgeInsets.all(0),
onPressed: () => Navigator.of(context)
.popAndPushNamed(Routes.testResultScreen),
return SafeArea(
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Test Results',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: ListView(
padding: EdgeInsets.symmetric(
horizontal: 20, vertical: 20),
children: <Widget>[
Container(
padding: EdgeInsets.only(
top: 10,
),
child: Text(
'Add a Test Result',
style: TextStyle(
color: Colors.black,
fontSize: 5 * _deviceBlockSize,
letterSpacing: 3,
fontWeight: FontWeight.w700,
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
// padding: EdgeInsets.all(0),
onPressed: () =>
Navigator.of(context).popAndPushNamed(Routes.testResultScreen),
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: ListView(
padding:
EdgeInsets.symmetric(horizontal: 20, vertical: 20),
children: <Widget>[
Container(
padding: EdgeInsets.only(
top: 10,
),
child: Text(
'Add a Test Result',
style: TextStyle(
color: Colors.black,
fontSize: 5 * _deviceBlockSize,
letterSpacing: 3,
fontWeight: FontWeight.w700,
),
),
GestureDetector(
child: Container(
margin: EdgeInsets.only(top: 5, bottom: 30),
padding: EdgeInsets.all(10),
height: 200,
decoration: BoxDecoration(border: Border.all()),
child: Center(
child: Text(
'PLease Scan The Test Barcode',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.grey,
fontSize: 5 * _deviceBlockSize,
fontWeight: FontWeight.w100,
letterSpacing: 3,
),
),
GestureDetector(
child: Container(
margin: EdgeInsets.only(top: 5, bottom: 30),
padding: EdgeInsets.all(10),
height: 200,
decoration: BoxDecoration(border: Border.all()),
child: Center(
child: Text(
'PLease Scan The Test Barcode',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.grey,
fontSize: 5 * _deviceBlockSize,
fontWeight: FontWeight.w100,
letterSpacing: 3,
),
),
),
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
Provider.of<TestResultsProvider>(
context,
listen: false,
).testCode = result;
Navigator.pushNamed(
context,
Routes.formTestResultScreen,
arguments: result,
);
}
},
);
},
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
width: 70 * _deviceBlockSize,
child: TestResultAddSelectorBox(
deviceBlockSize: _deviceBlockSize,
dataCTRL: testTypeCTRL,
dataVals: testTypeVals,
label: 'Choose a Test Type',
),
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
Provider.of<TestResultsProvider>(
context,
listen: false,
).testCode = result;
Navigator.pushNamed(
context,
Routes.formTestResultScreen,
arguments: result,
);
}
},
);
},
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
width: 70 * _deviceBlockSize,
child: TestResultAddSelectorBox(
deviceBlockSize: _deviceBlockSize,
dataCTRL: testTypeCTRL,
dataVals: testTypeVals,
label: 'Choose a Test Type',
),
Row(
crossAxisAlignment:
CrossAxisAlignment.end,
children: <Widget>[
Text(
'OR',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 7 * _deviceBlockSize,
),
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Text(
'OR',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 7 * _deviceBlockSize,
),
SizedBox(
width: 8 * _deviceBlockSize,
),
Container(
width: 50 * _deviceBlockSize,
child: TextFormField(
onChanged: (val) {
if (val != '') {
setState(
() {
testTypeCTRL.text = '';
},
);
} else {
setState(
() {
testTypeCTRL.text =
testTypeVals[0];
},
);
}
},
controller: testCodeCTRL,
decoration: InputDecoration(
isDense: true,
icon: Icon(
FontAwesomeIcons
.sortNumericDown,
),
labelText: 'Enter a Test Code',
labelStyle: TextStyle(
fontSize: 3 * _deviceBlockSize,
),
contentPadding: EdgeInsets.only(
bottom: 5,
top: 5,
),
),
keyboardType:
TextInputType.visiblePassword,
),
),
],
),
SizedBox(
height: 40.0,
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 5 * _deviceBlockSize,
vertical: 10,
),
width: 50 * _deviceBlockSize,
decoration: BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.circular(7),
SizedBox(
width: 8 * _deviceBlockSize,
),
child: Align(
alignment: Alignment.center,
child: TextButton(
child: Text(
'Select',
style: TextStyle(
color: Colors.white,
fontSize: 5 * _deviceBlockSize,
),
),
onPressed: () {
if (testCodeCTRL.text != '') {
Provider.of<TestResultsProvider>(
context,
listen: false,
).testCode = testCodeCTRL.text;
Navigator.pushNamed(
context,
Routes.formTestResultScreen,
arguments: testCodeCTRL.text,
Container(
width: 50 * _deviceBlockSize,
child: TextFormField(
onChanged: (val) {
if (val != '') {
setState(
() {
testTypeCTRL.text = '';
},
);
} else if (testTypeCTRL.text !=
'') {
Provider.of<TestResultsProvider>(
context,
listen: false,
).testType = testTypeCTRL.text;
Navigator.pushReplacementNamed(
context,
Routes.formTestResultScreen,
arguments: testTypeCTRL.text,
} else {
setState(
() {
testTypeCTRL.text =
testTypeVals[0];
},
);
}
// print(testCode);
},
controller: testCodeCTRL,
decoration: InputDecoration(
isDense: true,
icon: Icon(
FontAwesomeIcons.sortNumericDown,
),
labelText: 'Enter a Test Code',
labelStyle: TextStyle(
fontSize: 3 * _deviceBlockSize,
),
contentPadding: EdgeInsets.only(
bottom: 5,
top: 5,
),
),
keyboardType:
TextInputType.visiblePassword,
),
),
],
),
SizedBox(
height: 40.0,
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 5 * _deviceBlockSize,
vertical: 10,
),
],
),
SizedBox(
width: 5 * _deviceBlockSize,
),
],
),
],
)
: ConnectionErrorBox();
},
),
width: 50 * _deviceBlockSize,
decoration: BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.circular(7),
),
child: Align(
alignment: Alignment.center,
child: TextButton(
child: Text(
'Select',
style: TextStyle(
color: Colors.white,
fontSize: 5 * _deviceBlockSize,
),
),
onPressed: () {
if (testCodeCTRL.text != '') {
Provider.of<TestResultsProvider>(
context,
listen: false,
).testCode = testCodeCTRL.text;
Navigator.pushNamed(
context,
Routes.formTestResultScreen,
arguments: testCodeCTRL.text,
);
} else if (testTypeCTRL.text != '') {
Provider.of<TestResultsProvider>(
context,
listen: false,
).testType = testTypeCTRL.text;
Navigator.pushReplacementNamed(
context,
Routes.formTestResultScreen,
arguments: testTypeCTRL.text,
);
}
// print(testCode);
},
),
),
),
],
),
SizedBox(
width: 5 * _deviceBlockSize,
),
],
),
],
)
: ConnectionErrorBox();
},
),
),
);
+32 -39
View File
@@ -44,49 +44,42 @@ class _TestDetailsScreenState extends State<TestDetailsScreen> {
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
// print(datas);
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
},
child: SafeArea(
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Test Results',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
return SafeArea(
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Test Results',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: DatasBox(
datas: datas!,
deviceBlockSize: _deviceBlockSize,
)
: ConnectionErrorBox();
},
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: DatasBox(
datas: datas!,
deviceBlockSize: _deviceBlockSize,
)
: ConnectionErrorBox();
},
),
),
);
}
+266 -278
View File
@@ -128,299 +128,287 @@ class _TestFilterScreenState extends State<TestFilterScreen> {
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
// Navigator.pushReplacementNamed(
// context,
// Routes.testResultScreen,
// );
// return true;
},
child: SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Test Results',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).popAndPushNamed(
Routes.testResultScreen,
),
return SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Test Results',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: Padding(
padding: EdgeInsets.all(20),
child: ListView(
children: <Widget>[
Text(
'Filter Test Results',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).popAndPushNamed(
Routes.testResultScreen,
),
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? isInit
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: Padding(
padding: EdgeInsets.all(20),
child: ListView(
children: <Widget>[
Text(
'Filter Test Results',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
SizedBox(
height: 20,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'ID',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
SizedBox(
height: 20,
),
Row(
children: [
Flexible(
flex: 8,
child: TextFormField(
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
// onFieldSubmitted: (_) {
// FocusScope.of(context)
// .requestFocus(_cycleNumberFocusNode);
// },
labelText: 'ID',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.text,
textInputAction: TextInputAction.next,
// onFieldSubmitted: (_) {
// FocusScope.of(context)
// .requestFocus(_cycleNumberFocusNode);
// },
),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
idCTRL.text = result;
// Navigator.of(context).pushNamed(
// CycleDetailScreen.route,
// arguments: result,
// );
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
),
),
Flexible(
flex: 1,
child: InkWell(
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
print(result);
idCTRL.text = result;
// Navigator.of(context).pushNamed(
// CycleDetailScreen.route,
// arguments: result,
// );
}
},
);
},
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
),
),
],
),
SizedBox(
height: 25,
),
TestResultFilterSelectorBox(
deviceBlockSize: _deviceBlockSize,
dataCTRL: labelIdCTRL,
dataVals: labelIDVals,
label: 'Label ID',
),
SizedBox(
height: 25,
),
TextFormField(
controller: usernameCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Username',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.visiblePassword,
textInputAction: TextInputAction.next,
// onFieldSubmitted: (_) {
// FocusScope.of(context)
// .requestFocus(_cycleNumberFocusNode);
// },
),
SizedBox(
height: 25,
),
TestResultFilterSelectorBox(
deviceBlockSize: _deviceBlockSize,
dataCTRL: testTypeCTRL,
dataVals: testTypeVals,
label: 'Test Type',
),
SizedBox(
height: 25,
),
userData['roles']?.contains('User') ?? false
? Container()
: Column(
children: [
TestResultFilterSelectorBox(
deviceBlockSize: _deviceBlockSize,
dataCTRL: hospitalCTRL,
dataVals: hospitalVals,
label: 'Hospital',
),
SizedBox(
height: 25,
),
],
),
TestResultFilterDatePicker(
dateCTRL: fDateCTRL,
deviceBlockSize: _deviceBlockSize,
label: 'Date From',
),
SizedBox(
height: 25,
),
TestResultFilterDatePicker(
dateCTRL: uDateCTRL,
deviceBlockSize: _deviceBlockSize,
label: 'Date Until',
),
SizedBox(
height: 70,
),
InkWell(
onTap: () {
Provider.of<TestResultsProvider>(context,
listen: false)
.setFilters(
idCTRL.text,
labelIdCTRL.text != ''
? labelIdCTRL.text
: '',
usernameCTRL.text,
testTypeCTRL.text != ''
? testTypes![testTypeCTRL.text]
: '',
hospitalCTRL.text != ''
? hospitals[hospitalCTRL.text]
: '',
fDateCTRL.text,
uDateCTRL.text,
);
// showDialog(
// context: context,
// builder: (ctx) => AlertDialog(
// content: Text('Filters changed.'),
// actions: <Widget>[
// TextButton(
// onPressed: () {
// Navigator.of(ctx).pop();
// // Navigator.of(context).pop();
// },
// child: Text('Ok'),
// )
// ],
// ),
// ).then(
// (_) =>
// Navigator.of(context).popAndPushNamed(
// Routes.testResultScreen,
// ),
// );
Navigator.of(context).popAndPushNamed(
Routes.testResultScreen,
);
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5 * _deviceBlockSize,
vertical: 10,
),
// margin:
// EdgeInsets.symmetric(horizontal: 35, vertical: 15),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.black, Colors.black87],
),
borderRadius: BorderRadius.circular(7),
),
child: Align(
alignment: Alignment.center,
child: Text(
'Filter',
style: TextStyle(
child: Icon(
Icons.qr_code_scanner,
size: 5 * _deviceBlockSize,
color: Colors.white,
fontSize: 5 * _deviceBlockSize,
),
),
),
),
],
),
SizedBox(
height: 25,
),
TestResultFilterSelectorBox(
deviceBlockSize: _deviceBlockSize,
dataCTRL: labelIdCTRL,
dataVals: labelIDVals,
label: 'Label ID',
),
SizedBox(
height: 25,
),
TextFormField(
controller: usernameCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
labelText: 'Username',
isDense: true,
contentPadding: EdgeInsets.symmetric(
vertical: 2, horizontal: 3),
),
SizedBox(
height: 70,
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
// DropDownBox(values: ['Washer ID']),
],
),
)
: ConnectionErrorBox();
},
),
keyboardType: TextInputType.visiblePassword,
textInputAction: TextInputAction.next,
// onFieldSubmitted: (_) {
// FocusScope.of(context)
// .requestFocus(_cycleNumberFocusNode);
// },
),
SizedBox(
height: 25,
),
TestResultFilterSelectorBox(
deviceBlockSize: _deviceBlockSize,
dataCTRL: testTypeCTRL,
dataVals: testTypeVals,
label: 'Test Type',
),
SizedBox(
height: 25,
),
userData['roles']?.contains('User') ?? false
? Container()
: Column(
children: [
TestResultFilterSelectorBox(
deviceBlockSize: _deviceBlockSize,
dataCTRL: hospitalCTRL,
dataVals: hospitalVals,
label: 'Hospital',
),
SizedBox(
height: 25,
),
],
),
TestResultFilterDatePicker(
dateCTRL: fDateCTRL,
deviceBlockSize: _deviceBlockSize,
label: 'Date From',
),
SizedBox(
height: 25,
),
TestResultFilterDatePicker(
dateCTRL: uDateCTRL,
deviceBlockSize: _deviceBlockSize,
label: 'Date Until',
),
SizedBox(
height: 70,
),
InkWell(
onTap: () {
Provider.of<TestResultsProvider>(context,
listen: false)
.setFilters(
idCTRL.text,
labelIdCTRL.text != ''
? labelIdCTRL.text
: '',
usernameCTRL.text,
testTypeCTRL.text != ''
? testTypes![testTypeCTRL.text]
: '',
hospitalCTRL.text != ''
? hospitals[hospitalCTRL.text]
: '',
fDateCTRL.text,
uDateCTRL.text,
);
// showDialog(
// context: context,
// builder: (ctx) => AlertDialog(
// content: Text('Filters changed.'),
// actions: <Widget>[
// TextButton(
// onPressed: () {
// Navigator.of(ctx).pop();
// // Navigator.of(context).pop();
// },
// child: Text('Ok'),
// )
// ],
// ),
// ).then(
// (_) =>
// Navigator.of(context).popAndPushNamed(
// Routes.testResultScreen,
// ),
// );
Navigator.of(context).popAndPushNamed(
Routes.testResultScreen,
);
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5 * _deviceBlockSize,
vertical: 10,
),
// margin:
// EdgeInsets.symmetric(horizontal: 35, vertical: 15),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.black, Colors.black87],
),
borderRadius: BorderRadius.circular(7),
),
child: Align(
alignment: Alignment.center,
child: Text(
'Filter',
style: TextStyle(
color: Colors.white,
fontSize: 5 * _deviceBlockSize,
),
),
),
),
),
SizedBox(
height: 70,
),
// DropDownBox(values: ['Washer ID']),
],
),
)
: ConnectionErrorBox();
},
),
),
),
+84 -96
View File
@@ -96,105 +96,93 @@ class _FormPageState extends State<FormPage> {
@override
Widget build(BuildContext context) {
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
// Navigator.pushReplacementNamed(
// context,
// Routes.testResultAddScreen,
// );
// return true;
},
child: SafeArea(
child: Scaffold(
appBar: AppBar(
centerTitle: true,
title: Text(
'Add Test Result',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
actions: <Widget>[
_isLoadingButton
? Center(
child: CircularProgressIndicator(
color: Colors.white,
),
)
: IconButton(
icon: Icon(
Icons.save,
color: Colors.white,
),
onPressed: () {
_saveForm();
},
)
],
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () {
Navigator.of(context).popAndPushNamed(Routes.testResultScreen);
},
return SafeArea(
child: Scaffold(
appBar: AppBar(
centerTitle: true,
title: Text(
'Add Test Result',
style: TextStyle(
color: Colors.white,
),
),
body: SingleChildScrollView(
child: Column(
children: <Widget>[
_isLoading
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: Form(
key: _form,
child: Consumer<Inputs>(
builder: (context, inputs, _) {
formInputs = inputs.inputItems;
print(formInputs);
return formInputs.length != 0
? FormCreator(
form: formInputs,
onChanged: (value) {
formInputs = value;
},
)
: Center(
child: Text('Something went wrong!!!'),
);
},
),
),
// https://www.cssd-doc.com/api/GetInfo
// InkWell(
// onTap: () {
// _saveForm();
// },
// child: Container(
// padding: EdgeInsets.symmetric(horizontal: 60, vertical: 15),
// margin: EdgeInsets.symmetric(vertical: 20, horizontal: 50),
// decoration: BoxDecoration(
// gradient: LinearGradient(colors: [Colors.blue, Colors.green]),
// borderRadius: BorderRadius.circular(10),
// ),
// child: Text(
// 'Save',
// style: TextStyle(color: Colors.white, fontSize: 17),
// textAlign: TextAlign.center,
// ),
// ),
// ),
],
backgroundColor: Colors.black,
actions: <Widget>[
_isLoadingButton
? Center(
child: CircularProgressIndicator(
color: Colors.white,
),
)
: IconButton(
icon: Icon(
Icons.save,
color: Colors.white,
),
onPressed: () {
_saveForm();
},
)
],
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () {
Navigator.of(context).popAndPushNamed(Routes.testResultScreen);
},
),
),
body: SingleChildScrollView(
child: Column(
children: <Widget>[
_isLoading
? Center(
child: CircularProgressIndicator(
color: Colors.black,
),
)
: Form(
key: _form,
child: Consumer<Inputs>(
builder: (context, inputs, _) {
formInputs = inputs.inputItems;
print(formInputs);
return formInputs.length != 0
? FormCreator(
form: formInputs,
onChanged: (value) {
formInputs = value;
},
)
: Center(
child: Text('Something went wrong!!!'),
);
},
),
),
// https://www.cssd-doc.com/api/GetInfo
// InkWell(
// onTap: () {
// _saveForm();
// },
// child: Container(
// padding: EdgeInsets.symmetric(horizontal: 60, vertical: 15),
// margin: EdgeInsets.symmetric(vertical: 20, horizontal: 50),
// decoration: BoxDecoration(
// gradient: LinearGradient(colors: [Colors.blue, Colors.green]),
// borderRadius: BorderRadius.circular(10),
// ),
// child: Text(
// 'Save',
// style: TextStyle(color: Colors.white, fontSize: 17),
// textAlign: TextAlign.center,
// ),
// ),
// ),
],
),
),
),
+1 -1
View File
@@ -128,7 +128,7 @@ class _TestResultScreenState extends State<TestResultScreen> {
InkWell(
onTap: () {
Navigator.of(context)
.popAndPushNamed(Routes.testFilterScreen);
.pushNamed(Routes.testFilterScreen);
},
child: Container(
padding: EdgeInsets.all(7),
+142 -149
View File
@@ -27,173 +27,166 @@ class _TestScanScreenState extends State<TestScanScreen> {
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (didPop) return;
Navigator.of(context).pushNamed(Routes.homePage);
},
child: SafeArea(
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Test Results',
style: TextStyle(
color: Colors.white,
),
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
return SafeArea(
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text(
'Test Results',
style: TextStyle(
color: Colors.white,
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? ListView(
padding: EdgeInsets.symmetric(horizontal: 20),
children: <Widget>[
Container(
padding: EdgeInsets.only(top: 30),
child: Text(
'Looking for a Test Result?',
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black,
fontSize: 5.5 * _deviceBlockSize,
fontWeight: FontWeight.w700,
letterSpacing: 3,
),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
color: Colors.white,
size: 35,
),
onPressed: () => Navigator.of(context).pop(),
),
),
body: Consumer<ConnectivityProvider>(
builder: (ct, connection, _) {
return connection.conStatus != 'offline'
? ListView(
padding: EdgeInsets.symmetric(horizontal: 20),
children: <Widget>[
Container(
padding: EdgeInsets.only(top: 30),
child: Text(
'Looking for a Test Result?',
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.black,
fontSize: 5.5 * _deviceBlockSize,
fontWeight: FontWeight.w700,
letterSpacing: 3,
),
),
GestureDetector(
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
height: 200,
decoration: BoxDecoration(border: Border.all()),
child: Center(
child: Text(
'Please Scan The Test Result Barcode',
style: TextStyle(
color: Colors.black,
fontSize: 5 * _deviceBlockSize,
fontWeight: FontWeight.w100,
letterSpacing: 3,
),
textAlign: TextAlign.center,
),
),
),
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
launch(
'https://cssd-doc.com/Show/TestResult/$result',
);
// Navigator.of(context).pushNamed(
// Routes.cycleDetailScreen,
// arguments: result,
// );
}
},
);
},
),
SizedBox(
height: 10.0,
),
Form(
key: _form,
child: TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Id required!!';
}
return null;
},
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
labelStyle: TextStyle(
),
GestureDetector(
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
height: 200,
decoration: BoxDecoration(border: Border.all()),
child: Center(
child: Text(
'Please Scan The Test Result Barcode',
style: TextStyle(
color: Colors.black,
fontSize: 5 * _deviceBlockSize,
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Or enter a Test Result ID',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
focusedBorder: UnderlineInputBorder(
// borderRadius: BorderRadius.only(Radius.circular(4)),
borderSide: BorderSide(
color: Colors.grey,
),
letterSpacing: 3,
),
textAlign: TextAlign.center,
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
),
),
SizedBox(
height: 70,
),
InkWell(
onTap: () {
if (!_form.currentState!.validate()) {
return;
onTap: () {
scan().then(
(String result) {
if (result == 'cancel') {
print('cancel');
} else if (result == 'error') {
print('error');
} else if (result == 'access') {
print('access');
} else {
launch(
'https://cssd-doc.com/Show/TestResult/$result',
);
// Navigator.of(context).pushNamed(
// Routes.cycleDetailScreen,
// arguments: result,
// );
}
},
);
},
),
SizedBox(
height: 10.0,
),
Form(
key: _form,
child: TextFormField(
validator: (val) {
if (val!.isEmpty) {
return 'Id required!!';
}
launch(
'https://cssd-doc.com/Show/TestResult/${idCTRL.text}',
);
return null;
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5 * _deviceBlockSize,
vertical: 10,
controller: idCTRL,
decoration: InputDecoration(
icon: Icon(
FontAwesomeIcons.sortNumericDown,
size: 6 * _deviceBlockSize,
),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.black, Colors.black87],
labelStyle: TextStyle(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Or enter a Test Result ID',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
focusedBorder: UnderlineInputBorder(
// borderRadius: BorderRadius.only(Radius.circular(4)),
borderSide: BorderSide(
color: Colors.grey,
),
borderRadius: BorderRadius.circular(7),
),
child: Align(
alignment: Alignment.center,
child: Text(
'Search',
style: TextStyle(
color: Colors.white,
fontSize: 5 * _deviceBlockSize,
),
),
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 5 * _deviceBlockSize,
),
keyboardType: TextInputType.number,
),
),
SizedBox(
height: 70,
),
InkWell(
onTap: () {
if (!_form.currentState!.validate()) {
return;
}
launch(
'https://cssd-doc.com/Show/TestResult/${idCTRL.text}',
);
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5 * _deviceBlockSize,
vertical: 10,
),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.black, Colors.black87],
),
borderRadius: BorderRadius.circular(7),
),
child: Align(
alignment: Alignment.center,
child: Text(
'Search',
style: TextStyle(
color: Colors.white,
fontSize: 5 * _deviceBlockSize,
),
),
),
),
],
)
: ConnectionErrorBox();
},
),
),
],
)
: ConnectionErrorBox();
},
),
),
);
+1 -1
View File
@@ -34,7 +34,7 @@ class ResultBanner extends StatelessWidget {
InkWell(
customBorder: CircleBorder(),
onTap: () {
Navigator.of(context).popAndPushNamed(push);
Navigator.of(context).pushNamed(push);
},
child: Container(
padding: EdgeInsets.all(5),
@@ -41,7 +41,7 @@ class LabelFloatingButtons extends StatelessWidget {
InkWell(
customBorder: CircleBorder(),
onTap: () {
Navigator.of(context).pushReplacementNamed(Routes.labelAddScreen);
Navigator.of(context).pushNamed(Routes.labelAddScreen);
},
child: Container(
padding: EdgeInsets.all(5),
@@ -41,8 +41,7 @@ class TestResultFloatingButton extends StatelessWidget {
InkWell(
customBorder: CircleBorder(),
onTap: () {
Navigator.of(context)
.pushReplacementNamed(Routes.testResultAddScreen);
Navigator.of(context).pushNamed(Routes.testResultAddScreen);
},
child: Container(
padding: EdgeInsets.all(_deviceBlockSize),