diff --git a/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/ComplaintSelection.dart b/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/ComplaintSelection.dart index f209ed4b..6c0a8690 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/ComplaintSelection.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/ComplaintSelection.dart @@ -259,28 +259,51 @@ class _ComplaintSelectionState extends State { textAlign: TextAlign.start, ), ), - SizedBox(height: 8,), - Row(children: [ - Expanded(child: Padding( - padding: EdgeInsets.only(left: 10,right: 10), - child: - - TextFormField( - autofocus: true, - controller: searchController, - decoration: InputDecoration( - hintText: '', - border: InputBorder.none, - isCollapsed: true, - suffixIcon: model.state == ViewState.BusyLocal ?Transform.scale( - scale: 0.5, - child: CircularProgressIndicator(strokeWidth: 2,) ,): SizedBox() - ), - onChanged: _onTextChanged,) - - ),) - - ],), + SizedBox( + height: 8, + ), + Row( + children: [ + Expanded( + child: Padding( + padding: EdgeInsets.only(left: 10, right: 10), + child: TextFormField( + autofocus: true, + controller: searchController, + textInputAction: TextInputAction.done, + decoration: InputDecoration( + hintText: '', + border: InputBorder.none, + isCollapsed: true, + suffixIcon: model.state == ViewState.BusyLocal + ? Transform.scale( + scale: 0.5, + child: CircularProgressIndicator( + strokeWidth: 2, + ), + ) + :(searchController.text.isNotEmpty) ?IconButton( + icon: Icon( + Icons.save_as_outlined, + color: Colors.red, + size: 25, + ), + onPressed: () { + if(searchController.text.isNotEmpty) { + widget.onSave?.call(searchController.text); + } + }): SizedBox.shrink(), + ), + onChanged: _onTextChanged, + onEditingComplete: (){ + if(searchController.text.isNotEmpty) { + widget.onSave?.call(searchController.text); + } + }, + )), + ) + ], + ), Padding( padding: const EdgeInsets.all(8.0), child: Material(