diff --git a/lib/pages/ItemPages/item_filter_screen.dart b/lib/pages/ItemPages/item_filter_screen.dart index 2c007d7..ceb4c14 100755 --- a/lib/pages/ItemPages/item_filter_screen.dart +++ b/lib/pages/ItemPages/item_filter_screen.dart @@ -113,290 +113,290 @@ class _ItemFilterScreenState extends State { builder: (ct, connection, _) { return connection.conStatus != 'offline' ? isInit - ? Center( - child: CircularProgressIndicator( - color: Colors.black, - ), - ) - : Padding( - padding: EdgeInsets.all(20), - child: ListView( - children: [ - 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); - }, + ? Center( + child: CircularProgressIndicator( + color: Colors.black, ), - ), - // 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; - } + ) + : Padding( + padding: EdgeInsets.all(20), + child: ListView( + children: [ + 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, + // ), + 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: 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); }, - ); - }, - 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, ), - ), - ), - ), - ], - ), - 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; - } + 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); }, - ); - }, - 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: 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, + ), + ], ), - ), - ], - ), - 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(); }, ), diff --git a/lib/pages/MyItemsPages/my_items_filter_screen.dart b/lib/pages/MyItemsPages/my_items_filter_screen.dart index c41651d..8318447 100755 --- a/lib/pages/MyItemsPages/my_items_filter_screen.dart +++ b/lib/pages/MyItemsPages/my_items_filter_screen.dart @@ -101,110 +101,6 @@ class _MyItemsFilterScreenState extends State { 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( @@ -278,6 +174,110 @@ class _MyItemsFilterScreenState extends State { SizedBox( height: 30.0, ), + // 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, + ), TextFormField( controller: sizeCTRL, decoration: InputDecoration(