This commit is contained in:
HooDie
2023-11-11 19:57:09 +03:30
parent b567d4dac9
commit f43f5cc54f
41 changed files with 1181 additions and 399 deletions
+1
View File
@@ -49,6 +49,7 @@ class _ItemAddScreenState extends State<ItemAddScreen> {
void didChangeDependencies() async {
if (isInit) {
var itemProviderObject = Provider.of<ItemProvider>(context);
itemProviderObject.catchImages.clear();
itemProviderObject.getItemResults().then(
(result) {
setState(
+1 -1
View File
@@ -286,7 +286,7 @@ class _ItemFilterScreenState extends State<ItemFilterScreen> {
print('access');
} else {
print(result);
idCTRL.text = result;
udiCTRL.text = result;
}
},
);
+2 -2
View File
@@ -61,8 +61,8 @@ class _ItemResultScreenState extends State<ItemResultScreen> {
@override
Widget build(BuildContext context) {
final _media = MediaQuery.of(context);
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
final double _deviceWidth = _media.size.width;
final double _deviceBlockSize = _deviceWidth / 100;
return SafeArea(
child: GestureDetector(
onTap: () {
+26 -5
View File
@@ -34,6 +34,8 @@ class _LabelAddScreenState extends State<LabelAddScreen> {
List<Map<String, String>> packageVals = [];
List<String> packageValue = [];
bool isInit = true;
// String? packageId;
// String? previousRoute;
List<TextEditingController> labelsCTRL = [TextEditingController()];
int curLabelVal = 1;
@@ -47,7 +49,15 @@ class _LabelAddScreenState extends State<LabelAddScreen> {
@override
void didChangeDependencies() async {
if (isInit) {
// final pastRoute = ModalRoute.of(context)!.settings.name;
// previousRoute = pastRoute;
// print(previousRoute);
var labelProviderObject = Provider.of<LabelsProvider>(context);
// var arguments = ModalRoute.of(context)!.settings.arguments;
// if (arguments != null && arguments is Map<dynamic, dynamic>) {
// packageId = arguments['id'];
// }
// print(packageId);
labelProviderObject.resetPackageVals();
labelProviderObject.getPackageFilters().then(
(result) {
@@ -67,6 +77,7 @@ class _LabelAddScreenState extends State<LabelAddScreen> {
final _media = MediaQuery.of(context);
final double _devicewidth = _media.size.width;
final double _deviceBlockSize = _devicewidth / 100;
// String initialLabelValue;
return WillPopScope(
onWillPop: () async {
Navigator.pushReplacementNamed(
@@ -286,8 +297,15 @@ class _LabelAddScreenState extends State<LabelAddScreen> {
),
),
Consumer<LabelsProvider>(
builder: (ctx, labelProvider, _) =>
ListView.builder(
builder: (ctx, labelProvider, _) {
// if (previousRoute ==
// '/PackageDetailScreen') {
// initialLabelValue = packageId!;
// } else {
// initialLabelValue =
// labelProvider.initialPackageValue;
// }
return ListView.builder(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (ctx, index) =>
@@ -304,8 +322,8 @@ class _LabelAddScreenState extends State<LabelAddScreen> {
),
itemCount:
labelProvider.packageValues.length,
),
),
);
}),
SizedBox(
height: 10,
),
@@ -330,7 +348,10 @@ class _LabelAddScreenState extends State<LabelAddScreen> {
lotNumberCTRL: lotNumberCTRL,
cycleNumberCTRL: cycleNumberCTRL,
sDateCTRL: sDateCTRL,
packageValue: packageValue,
packageValue: Provider.of<LabelsProvider>(
context,
listen: false,
).packageValues,
eDateCTRL: eDateCTRL,
striizerIdCTRL: striizerIdCTRL,
deviceBlockSize: _deviceBlockSize,
@@ -67,8 +67,9 @@ class _LabelResultScreenState extends State<LabelResultScreen> {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
floatingActionButton:
LabelFloatingButtons(deviceBlockSize: _deviceBlockSize),
floatingActionButton: LabelFloatingButtons(
deviceBlockSize: _deviceBlockSize,
),
appBar: AppBar(
titleSpacing: -10,
title: Text('Home'),
+16 -17
View File
@@ -1,4 +1,3 @@
import 'package:cssd/widgets/LabelScreens/Add/selector_box.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:intl/intl.dart' as DateEditor;
@@ -27,7 +26,7 @@ class _LabelUpdateScreenState extends State<LabelUpdateScreen> {
TextEditingController striizerIdCTRL = new TextEditingController();
TextEditingController sDateCTRL = new TextEditingController();
TextEditingController eDateCTRL = new TextEditingController();
TextEditingController packageCTRL = new TextEditingController();
// TextEditingController packageCTRL = new TextEditingController();
DateTime? dateTimeS;
// String sDateValue;
@@ -35,8 +34,8 @@ class _LabelUpdateScreenState extends State<LabelUpdateScreen> {
final _form = GlobalKey<FormState>();
List<Map<String, String>> packageVals = [];
List<String> packageValue = [];
// List<Map<String, String>> packageVals = [];
// List<String> packageValue = [];
bool isEmpty = false;
bool isInit = true;
LabelDetailsObject? datas;
@@ -67,9 +66,9 @@ class _LabelUpdateScreenState extends State<LabelUpdateScreen> {
striizerIdCTRL.text = datas!.sterileId;
sDateCTRL.text = datas!.sterileDate;
eDateCTRL.text = datas!.expireDate;
packageValue.add(datas!.packageId);
packageValue.add(datas!.package);
packageCTRL.text = datas!.package;
// packageValue.add(datas!.packageId);
// packageValue.add(datas!.package);
// packageCTRL.text = datas!.package;
},
);
},
@@ -256,15 +255,15 @@ class _LabelUpdateScreenState extends State<LabelUpdateScreen> {
SizedBox(
height: 20,
),
LabelAddSelectorBox(
deviceBlockSize: _deviceBlockSize,
packageCTRL: packageCTRL,
packageVals: packageVals,
packageValue: packageValue,
),
SizedBox(
height: 20,
),
// LabelAddSelectorBox(
// deviceBlockSize: _deviceBlockSize,
// packageCTRL: packageCTRL,
// packageVals: packageVals,
// packageValue: packageValue,
// ),
// SizedBox(
// height: 20,
// ),
LabelAddDatePicker(
dateCTRL: sDateCTRL,
deviceBlockSize: _deviceBlockSize,
@@ -287,7 +286,7 @@ class _LabelUpdateScreenState extends State<LabelUpdateScreen> {
lotNumberCTRL: lotNumberCTRL,
cycleNumberCTRL: cycleNumberCTRL,
sDateCTRL: sDateCTRL,
packageValue: packageValue,
// packageValue: packageValue,
eDateCTRL: eDateCTRL,
striizerIdCTRL: striizerIdCTRL,
deviceBlockSize: _deviceBlockSize,
@@ -1,4 +1,5 @@
import 'package:cssd/config/colors.dart';
import 'package:cssd/config/routes.dart';
import 'package:cssd/pages/MyItemsPages/Result/my_items_mine_screen.dart';
import 'package:cssd/pages/MyItemsPages/Result/my_items_requests_screen.dart';
import 'package:flutter/material.dart';
@@ -28,6 +29,9 @@ class _MyItemsResultScreenState extends State<MyItemsResultScreen>
@override
Widget build(BuildContext context) {
final _media = MediaQuery.of(context);
final double _deviceWidth = _media.size.width;
final double _deviceBlockSize = _deviceWidth / 100;
return SafeArea(
child: GestureDetector(
onTap: () {
@@ -60,6 +64,9 @@ class _MyItemsResultScreenState extends State<MyItemsResultScreen>
],
),
),
floatingActionButton: MyItemResultFloatingButton(
deviceBlockSize: _deviceBlockSize,
),
body: TabBarView(
controller: _tabController,
children: [
@@ -73,3 +80,35 @@ class _MyItemsResultScreenState extends State<MyItemsResultScreen>
);
}
}
class MyItemResultFloatingButton extends StatelessWidget {
const MyItemResultFloatingButton({
Key? key,
required double deviceBlockSize,
}) : _deviceBlockSize = deviceBlockSize,
super(key: key);
final double _deviceBlockSize;
@override
Widget build(BuildContext context) {
return InkWell(
customBorder: CircleBorder(),
onTap: () {
Navigator.of(context).pushNamed(Routes.myItemsScanScreen);
},
child: Container(
padding: EdgeInsets.all(2.5 * _deviceBlockSize),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 7.1 * _deviceBlockSize,
color: Colors.white,
),
),
);
}
}
@@ -0,0 +1,195 @@
import 'package:cssd/config/colors.dart';
import 'package:cssd/utils/scan.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../providers/connectivity.dart';
import '../../widgets/Global/internet_error.dart';
class MyItemsScanScreen extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _MyItemsScanScreenState();
}
}
class _MyItemsScanScreenState extends State<MyItemsScanScreen> {
TextEditingController idCTRL = new TextEditingController();
final _form = GlobalKey<FormState>();
@override
Widget build(BuildContext context) {
final _media = MediaQuery.of(context);
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
final double _deviceWidth = _media.size.width;
final double _deviceBlockSize = _deviceWidth / 100;
return SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text('My Items'),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
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 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(
fontWeight: FontWeight.w100,
fontSize: 4 * _deviceBlockSize,
),
isDense: true,
labelText: 'Or enter a Item ID',
contentPadding: EdgeInsets.symmetric(
vertical: 2,
horizontal: 3,
),
focusedBorder: UnderlineInputBorder(
// borderRadius: BorderRadius.only(Radius.circular(4)),
borderSide: BorderSide(
color: Colors.grey,
),
),
),
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();
},
),
),
),
);
}
}
@@ -118,7 +118,7 @@ class _MyPackagesMineScreenState extends State<MyPackagesMineScreen> {
label: 'ID',
id: '',
name: package.filters!.name,
udi: package.filters!.udi,
// udi: package.filters!.udi,
)
: Container(),
package.filters!.name != ''
@@ -127,18 +127,18 @@ class _MyPackagesMineScreenState extends State<MyPackagesMineScreen> {
label: 'Package Name',
id: package.filters!.id,
name: '',
udi: package.filters!.udi,
)
: Container(),
package.filters!.udi != ''
? MyPackageFilterChip(
deviceBlockSize: _deviceBlockSize,
label: 'UDI',
id: package.filters!.id,
name: package.filters!.name,
udi: '',
// udi: package.filters!.udi,
)
: Container(),
// package.filters!.udi != ''
// ? MyPackageFilterChip(
// deviceBlockSize: _deviceBlockSize,
// label: 'UDI',
// id: package.filters!.id,
// name: package.filters!.name,
// udi: '',
// )
// : Container(),
],
),
);
@@ -1,4 +1,5 @@
import 'package:cssd/config/colors.dart';
import 'package:cssd/config/routes.dart';
import 'package:cssd/pages/MyPackagesPages/Result/my_packages_mine_screen.dart';
import 'package:cssd/pages/MyPackagesPages/Result/my_packages_requests_screen.dart';
import 'package:flutter/material.dart';
@@ -28,6 +29,9 @@ class _MyPackagesResultScreenState extends State<MyPackagesResultScreen>
@override
Widget build(BuildContext context) {
final _media = MediaQuery.of(context);
final double _deviceWidth = _media.size.width;
final double _deviceBlockSize = _deviceWidth / 100;
return SafeArea(
child: GestureDetector(
onTap: () {
@@ -60,6 +64,9 @@ class _MyPackagesResultScreenState extends State<MyPackagesResultScreen>
],
),
),
floatingActionButton: MyPackageResultFloatingButton(
deviceBlockSize: _deviceBlockSize,
),
body: TabBarView(
controller: _tabController,
children: [
@@ -73,3 +80,35 @@ class _MyPackagesResultScreenState extends State<MyPackagesResultScreen>
);
}
}
class MyPackageResultFloatingButton extends StatelessWidget {
const MyPackageResultFloatingButton({
Key? key,
required double deviceBlockSize,
}) : _deviceBlockSize = deviceBlockSize,
super(key: key);
final double _deviceBlockSize;
@override
Widget build(BuildContext context) {
return InkWell(
customBorder: CircleBorder(),
onTap: () {
Navigator.of(context).pushNamed(Routes.myPackagesScanScreen);
},
child: Container(
padding: EdgeInsets.all(2.5 * _deviceBlockSize),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Icon(
Icons.qr_code_scanner,
size: 7.1 * _deviceBlockSize,
color: Colors.white,
),
),
);
}
}
@@ -22,7 +22,7 @@ class _MyPackageFilterScreenState extends State<MyPackageFilterScreen> {
TextEditingController idCTRL = new TextEditingController();
TextEditingController hospitalCTRL = new TextEditingController();
TextEditingController nameCTRL = new TextEditingController();
TextEditingController udiCTRL = new TextEditingController();
// TextEditingController udiCTRL = new TextEditingController();
bool isInit = true;
PackageFilterObject? filters;
@@ -32,7 +32,7 @@ class _MyPackageFilterScreenState extends State<MyPackageFilterScreen> {
idCTRL.text = filters!.id;
hospitalCTRL.text = filters!.hospital;
nameCTRL.text = filters!.name;
udiCTRL.text = filters!.udi;
// udiCTRL.text = filters!.udi;
super.initState();
}
@@ -203,82 +203,82 @@ class _MyPackageFilterScreenState extends State<MyPackageFilterScreen> {
.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: 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,
// udiCTRL: udiCTRL,
deviceBlockSize: _deviceBlockSize,
firstColor: kDarkPurple,
secondColor: kDarkPurpleSub,
@@ -0,0 +1,195 @@
import 'package:cssd/config/colors.dart';
import 'package:cssd/utils/scan.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../providers/connectivity.dart';
import '../../widgets/Global/internet_error.dart';
class MyPackagesScanScreen extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _MyPackagesScanScreenState();
}
}
class _MyPackagesScanScreenState extends State<MyPackagesScanScreen> {
TextEditingController idCTRL = new TextEditingController();
final _form = GlobalKey<FormState>();
@override
Widget build(BuildContext context) {
final _media = MediaQuery.of(context);
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
final double _deviceWidth = _media.size.width;
final double _deviceBlockSize = _deviceWidth / 100;
return SafeArea(
child: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: Scaffold(
appBar: AppBar(
titleSpacing: -10,
title: Text('My Packages'),
backgroundColor: Colors.black,
leading: IconButton(
icon: Icon(
Icons.keyboard_arrow_left,
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(
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,
),
),
),
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();
},
),
),
),
);
}
}
+43 -43
View File
@@ -1,6 +1,7 @@
import 'package:cssd/config/colors.dart';
import 'package:cssd/models/package_model.dart';
import 'package:cssd/providers/packages.dart';
import 'package:cssd/widgets/PackageScreens/Add/add_item_box.dart';
import 'package:cssd/widgets/PackageScreens/Add/package_save_button.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@@ -9,7 +10,6 @@ import 'package:provider/provider.dart';
import '../../config/routes.dart';
import '../../providers/connectivity.dart';
import '../../widgets/CycleScreens/Add/add_label_box.dart';
import '../../widgets/Global/internet_error.dart';
class PackageAddScreen extends StatefulWidget {
@@ -21,7 +21,7 @@ class _PackageAddScreenState extends State<PackageAddScreen> {
final _packageUdiFocusNode = FocusNode();
final _descriptionFocusNode = FocusNode();
TextEditingController descriptionCTRL = new TextEditingController();
TextEditingController udiCTRL = new TextEditingController();
// TextEditingController udiCTRL = new TextEditingController();
TextEditingController nameCTRL = new TextEditingController();
TextEditingController dateCTRL = new TextEditingController();
final _form = GlobalKey<FormState>();
@@ -32,7 +32,7 @@ class _PackageAddScreenState extends State<PackageAddScreen> {
@override
void initState() {
descriptionCTRL.text = '';
udiCTRL.text = '';
// udiCTRL.text = '';
nameCTRL.text = '';
dateCTRL.text = DateFormat('y-M-d').format(DateTime.now());
super.initState();
@@ -152,43 +152,43 @@ class _PackageAddScreenState extends State<PackageAddScreen> {
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,
),
// 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(
@@ -205,14 +205,14 @@ class _PackageAddScreenState extends State<PackageAddScreen> {
ListView.builder(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (ctx, index) => AddLabelBox(
itemBuilder: (ctx, index) => AddItemBox(
text: 'Select Items Included',
iconColor: kPurpleSub,
deviceBlockSize: _deviceBlockSize,
values:
packageProvider.itemValues[index],
vals: packageProvider.itemVals,
initialLabelValue:
initialItemValue:
packageProvider.initialItemValue,
index: index,
),
@@ -258,7 +258,7 @@ class _PackageAddScreenState extends State<PackageAddScreen> {
listen: false,
).itemValues,
nameCTRL: nameCTRL,
udiCTRL: udiCTRL,
// udiCTRL: udiCTRL,
dateValue: dateCTRL.text,
descriptionCTRL: descriptionCTRL,
deviceBlockSize: _deviceBlockSize,
@@ -22,7 +22,7 @@ class _PackageFilterScreenState extends State<PackageFilterScreen> {
TextEditingController idCTRL = new TextEditingController();
TextEditingController hospitalCTRL = new TextEditingController();
TextEditingController nameCTRL = new TextEditingController();
TextEditingController udiCTRL = new TextEditingController();
// TextEditingController udiCTRL = new TextEditingController();
List<Map<String, String>> hospitalVals = [];
bool isInit = true;
@@ -33,7 +33,7 @@ class _PackageFilterScreenState extends State<PackageFilterScreen> {
idCTRL.text = filters!.id;
hospitalCTRL.text = filters!.hospital;
nameCTRL.text = filters!.name;
udiCTRL.text = filters!.udi;
// udiCTRL.text = filters!.udi;
super.initState();
}
@@ -233,35 +233,35 @@ class _PackageFilterScreenState extends State<PackageFilterScreen> {
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,
),
// 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,
@@ -276,7 +276,7 @@ class _PackageFilterScreenState extends State<PackageFilterScreen> {
hospitalCTRL: hospitalCTRL,
idCTRL: idCTRL,
nameCTRL: nameCTRL,
udiCTRL: udiCTRL,
// udiCTRL: udiCTRL,
deviceBlockSize: _deviceBlockSize,
),
SizedBox(
@@ -116,7 +116,7 @@ class _PackageResultScreenState extends State<PackageResultScreen> {
id: '',
name: package.filters!.name,
hospital: package.filters!.hospital,
udi: package.filters!.udi,
// udi: package.filters!.udi,
)
: Container(),
package.filters!.name != ''
@@ -125,7 +125,7 @@ class _PackageResultScreenState extends State<PackageResultScreen> {
label: 'Package Name',
id: package.filters!.id,
name: '',
udi: package.filters!.udi,
// udi: package.filters!.udi,
hospital: package.filters!.hospital,
)
: Container(),
@@ -135,20 +135,20 @@ class _PackageResultScreenState extends State<PackageResultScreen> {
label: 'Hospital',
id: package.filters!.id,
name: package.filters!.name,
udi: package.filters!.udi,
// udi: package.filters!.udi,
hospital: '',
)
: Container(),
package.filters!.udi != ''
? PackageFilterChip(
deviceBlockSize: _deviceBlockSize,
label: 'UDI',
id: package.filters!.id,
name: package.filters!.name,
udi: '',
hospital: package.filters!.hospital,
)
: Container(),
// package.filters!.udi != ''
// ? PackageFilterChip(
// deviceBlockSize: _deviceBlockSize,
// label: 'UDI',
// id: package.filters!.id,
// name: package.filters!.name,
// udi: '',
// hospital: package.filters!.hospital,
// )
// : Container(),
],
),
);
@@ -17,7 +17,7 @@ class _PackageUpdateScreenState extends State<PackageUpdateScreen> {
final _udiFocusNode = FocusNode();
final _descriptionFocusNode = FocusNode();
TextEditingController nameCTRL = new TextEditingController();
TextEditingController udiCTRL = new TextEditingController();
// TextEditingController udiCTRL = new TextEditingController();
TextEditingController descriptionCTRL = new TextEditingController();
TextEditingController itemCTRL = new TextEditingController();
@@ -39,7 +39,7 @@ class _PackageUpdateScreenState extends State<PackageUpdateScreen> {
() {
datas = result;
nameCTRL.text = datas!.name;
udiCTRL.text = datas!.udi;
// udiCTRL.text = datas!.udi;
descriptionCTRL.text = datas!.description;
for (String item in datas!.items) {
itemCTRL.text = item;
@@ -149,43 +149,43 @@ class _PackageUpdateScreenState extends State<PackageUpdateScreen> {
SizedBox(
height: 20,
),
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: _udiFocusNode,
keyboardType: TextInputType.text,
textInputAction: TextInputAction.done,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(_descriptionFocusNode);
},
),
SizedBox(
height: 20,
),
// 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: _udiFocusNode,
// keyboardType: TextInputType.text,
// textInputAction: TextInputAction.done,
// onFieldSubmitted: (_) {
// FocusScope.of(context)
// .requestFocus(_descriptionFocusNode);
// },
// ),
// SizedBox(
// height: 20,
// ),
TextFormField(
controller: descriptionCTRL,
decoration: InputDecoration(
@@ -218,7 +218,7 @@ class _PackageUpdateScreenState extends State<PackageUpdateScreen> {
form: _form,
id: datas!.id,
nameCTRL: nameCTRL,
udiCTRL: udiCTRL,
// udiCTRL: udiCTRL,
itemCTRL: itemCTRL,
deviceBlockSize: _deviceBlockSize,
descriptionCTRL: descriptionCTRL,