diff --git a/lib/widgets/patients/profile/soap_update/subjective/PriorityBar.dart b/lib/widgets/patients/profile/soap_update/subjective/PriorityBar.dart new file mode 100644 index 00000000..5858c08d --- /dev/null +++ b/lib/widgets/patients/profile/soap_update/subjective/PriorityBar.dart @@ -0,0 +1,93 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +class PriorityBar extends StatefulWidget { + final Function onTap; + + const PriorityBar({Key key, this.onTap}) : super(key: key); + + @override + _PriorityBarState createState() => _PriorityBarState(); +} + +class _PriorityBarState extends State { + int _activePriority = 0; + int index = -1; + List _priorities = [ + "Family", + "Surgical/Sports", + "Medical", + ]; + List _prioritiesAr = [ + "أسرة", + "جراحي / رياضي", + "طبي", + ]; + + BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor) { + return BoxDecoration(); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + ProjectViewModel projectViewModel = Provider.of(context); + + return Container( + height: screenSize.height * 0.080, + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _priorities.map(( + item, + ) { + bool _isActive = _priorities[_activePriority] == item ? true : false; + if (index < 2) { + index++; + } + return Expanded( + child: InkWell( + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + height: screenSize.height * 0.070, + decoration: containerBorderDecoration( + _isActive ? HexColor("#B8382B") : Colors.white, + _isActive ? HexColor("#B8382B") : Colors.white), + child: Center( + child: Text( + (projectViewModel.isArabic) + ? _prioritiesAr[index] + : item, + style: TextStyle( + fontSize: 15, + color: Colors.black, //Colors.black, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + if(_isActive) + Container(width: 120,height: 4,color: AppGlobal.appPrimaryColor,) + ], + ), + ), + onTap: () { + widget.onTap(_priorities.indexOf(item)); + + setState(() { + _activePriority = _priorities.indexOf(item); + }); + }), + ); + }).toList(), + ), + ); + } +} diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart index a8f92b72..92a41d8a 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; @@ -16,6 +17,8 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; +import 'PriorityBar.dart'; + class UpdateHistoryWidget extends StatefulWidget { final List myHistoryList; @@ -184,93 +187,7 @@ class _UpdateHistoryWidgetState extends State } } -class PriorityBar extends StatefulWidget { - final Function onTap; - - const PriorityBar({Key key, this.onTap}) : super(key: key); - - @override - _PriorityBarState createState() => _PriorityBarState(); -} - -class _PriorityBarState extends State { - int _activePriority = 0; - int index =-1; - List _priorities = [ - "Family", - "Surgical/Sports", - "Medical", - ]; - List _prioritiesAr = [ - "أسرة", - "جراحي / رياضي" , - "طبي", - ]; - - BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor) { - return BoxDecoration( - color: containerColor, - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(6)), - border: Border.fromBorderSide(BorderSide( - color: borderColor, - width: 2.0, - )), - ); - } - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - ProjectViewModel projectViewModel = Provider.of(context); - - return Container( - height: screenSize.height * 0.070, - decoration: - containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), - child: Row( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _priorities.map((item,) { - bool _isActive = _priorities[_activePriority] == item ? true : false; - if(index <2){ - index++; - } - return Expanded( - child: InkWell( - child: Center( - child: Container( - height: screenSize.height * 0.070, - decoration: containerBorderDecoration( - _isActive ? HexColor("#B8382B") : Colors.white, - _isActive ? HexColor("#B8382B") : Colors.white), - child: Center( - child: Text( - (projectViewModel.isArabic)?_prioritiesAr[index]: item, - style: TextStyle( - fontSize: 12, - color: _isActive - ? Colors.white - : Colors.black, //Colors.black, - fontWeight: FontWeight.bold, - ), - ), - )), - ), - onTap: () { - widget.onTap(_priorities.indexOf(item)); - - setState(() { - _activePriority = _priorities.indexOf(item); - }); - }), - ); - }).toList(), - ), - ); - } -} class AddHistoryDialog extends StatefulWidget { final Function changePageViewIndex; @@ -291,7 +208,7 @@ class _AddHistoryDialogState extends State { @override Widget build(BuildContext context) { return FractionallySizedBox( - heightFactor: 0.7, + heightFactor: 1, child: BaseView( onModelReady: (model) async { if (model.historyFamilyList.length == 0) { @@ -312,20 +229,66 @@ class _AddHistoryDialogState extends State { isShowAppBar: false, body: Center( child: Container( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - SizedBox( - height: 10, + child: Column( + children: [ + Container( + padding: EdgeInsets.only( + left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, ), - PriorityBar(onTap: (activePriority) async { - widget.changePageViewIndex(activePriority); - }), - SizedBox( - height: 20, - ), - Expanded( + height: 115, + child: Container( + padding: EdgeInsets.only( + left: 10, right: 10), + margin: EdgeInsets.only(top: 40), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize:20, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).addHistory, + style: TextStyle( + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 20)), + ], + ), + ), + InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Icon(FontAwesomeIcons.times, + size: 30, + color: Color(0xFF2B353E))) + ], + ), + ], + ), + ), + ), + SizedBox( + height: 10, + ), + PriorityBar(onTap: (activePriority) async { + widget.changePageViewIndex(activePriority); + }), + SizedBox( + height: 20, + ), + Expanded( + child: FractionallySizedBox( + widthFactor: 0.9, child: PageView( physics: NeverScrollableScrollPhysics(), controller: widget.controller, @@ -405,9 +368,9 @@ class _AddHistoryDialogState extends State { ], ), ), + ), ], - ), - )), + )), ), ), )); diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index dd9e2f3d..64853f0a 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -13,6 +13,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'app_texts_widget.dart'; + class MasterKeyCheckboxSearchWidget extends StatefulWidget { final SOAPViewModel model; final Function addSelectedHistories; @@ -49,15 +51,14 @@ class _MasterKeyCheckboxSearchWidgetState extends State