From 8b79b0041cc7216ba903638b7875c6c3cbbbb9cd Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 27 Apr 2022 13:43:38 +0300 Subject: [PATCH] design issue --- .../procedures/add_procedure_page.dart | 219 +++++++++--------- 1 file changed, 112 insertions(+), 107 deletions(-) diff --git a/lib/screens/procedures/add_procedure_page.dart b/lib/screens/procedures/add_procedure_page.dart index 81640802..bedfea99 100644 --- a/lib/screens/procedures/add_procedure_page.dart +++ b/lib/screens/procedures/add_procedure_page.dart @@ -65,124 +65,129 @@ class _AddProcedurePageState extends State { AppScaffold( isShowAppBar: false, body: SingleChildScrollView( - child: Column( - children: [ - Container( - height: MediaQuery.of(context).size.height * 0.070, - ), - NetworkBaseView( - baseViewModel: model, - child: Container( - child: Padding( - padding: EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (procedureType == ProcedureType.PROCEDURE) - Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - AppText( - TranslationBase.of(context) - .pleaseEnterProcedure, - fontWeight: FontWeight.w700, - fontSize: 20, - ), - ], - ), - SizedBox( - height: - MediaQuery.of(context).size.height * 0.02, - ), - Row( + child: FractionallySizedBox( + widthFactor: .97, + child: Center( + child: Column( + children: [ + Container( + height: MediaQuery.of(context).size.height * 0.070, + ), + NetworkBaseView( + baseViewModel: model, + child: Container( + child: Padding( + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (procedureType == ProcedureType.PROCEDURE) + Column( children: [ - Container( - width: MediaQuery.of(context).size.width * - 0.79, - child: AppTextFieldCustom( - hintText: TranslationBase.of(context) - .searchProcedureHere, - isTextFieldHasSuffix: false, - maxLines: 1, - minLines: 1, - hasBorder: true, - controller: procedureName, - ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + AppText( + TranslationBase.of(context) + .pleaseEnterProcedure, + fontWeight: FontWeight.w700, + fontSize: 20, + ), + ], ), SizedBox( - width: MediaQuery.of(context).size.width * - 0.02, + height: + MediaQuery.of(context).size.height * 0.02, ), - Expanded( - child: InkWell( - onTap: () async { - if (procedureName.text.isNotEmpty && - procedureName.text.length >= 3) { - GifLoaderDialogUtils.showMyDialog( - context); - await model.getProcedureCategory( - patientId: patient.patientId, - categoryName: procedureName.text, - isLocalBusy: true); - if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); - } - GifLoaderDialogUtils.hideDialog( - context); - } else { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .atLeastThreeCharacters, - ); - } - }, - child: Icon( - Icons.search, - size: 25.0, + Row( + children: [ + Container( + width: MediaQuery.of(context).size.width * + 0.79, + child: AppTextFieldCustom( + hintText: TranslationBase.of(context) + .searchProcedureHere, + isTextFieldHasSuffix: false, + maxLines: 1, + minLines: 1, + hasBorder: true, + controller: procedureName, + ), + ), + SizedBox( + width: MediaQuery.of(context).size.width * + 0.02, + ), + Expanded( + child: InkWell( + onTap: () async { + if (procedureName.text.isNotEmpty && + procedureName.text.length >= 3) { + GifLoaderDialogUtils.showMyDialog( + context); + await model.getProcedureCategory( + patientId: patient.patientId, + categoryName: procedureName.text, + isLocalBusy: true); + if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } + GifLoaderDialogUtils.hideDialog( + context); + } else { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context) + .atLeastThreeCharacters, + ); + } + }, + child: Icon( + Icons.search, + size: 25.0, + ), + ), ), - ), + ], ), ], ), - ], - ), - if ((procedureType == ProcedureType.PROCEDURE - ? procedureName.text.isNotEmpty - : true) && - model.categoriesList.length != 0) - NetworkBaseView( - baseViewModel: model, - child: EntityListCheckboxSearchWidget( - model: widget.model, - masterList: model.categoriesList[0].entityList, - removeProcedure: (item) { - setState(() { - entityList.remove(item); - }); - }, - addProcedure: (history) { - setState(() { - entityList.add(history); - }); - }, - addSelectedHistories: () {}, - isEntityListSelected: (master) => widget.model - .isEntityListSelected(master, entityList), - )), - SizedBox( - height: 10, - ) - ], + if ((procedureType == ProcedureType.PROCEDURE + ? procedureName.text.isNotEmpty + : true) && + model.categoriesList.length != 0) + NetworkBaseView( + baseViewModel: model, + child: EntityListCheckboxSearchWidget( + model: widget.model, + masterList: model.categoriesList[0].entityList, + removeProcedure: (item) { + setState(() { + entityList.remove(item); + }); + }, + addProcedure: (history) { + setState(() { + entityList.add(history); + }); + }, + addSelectedHistories: () {}, + isEntityListSelected: (master) => widget.model + .isEntityListSelected(master, entityList), + )), + SizedBox( + height: 10, + ) + ], + ), + ), ), ), - ), + ], ), - ], + ), ), ), bottomSheet: model.state == ViewState.BusyLocal || entityList.isEmpty