favourite procedure templates

merge-requests/674/head
hussam al-habibeh 5 years ago
parent 6b6243232c
commit 3b800bcd19

@ -5,7 +5,7 @@ const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]"; const ONLY_DATE = "[0-9/]";
const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/'; //const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = const PATIENT_PROGRESS_NOTE_URL =

@ -145,14 +145,20 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
builder: (BuildContext context, ProcedureViewModel model, Widget child) => builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold( AppScaffold(
isShowAppBar: false, isShowAppBar: false,
body: NetworkBaseView( body: Column(
children: [
Container(
height: MediaQuery.of(context).size.height * 0.070,
),
Expanded(
child: NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: DraggableScrollableSheet( child: DraggableScrollableSheet(
minChildSize: 0.90, minChildSize: 0.90,
initialChildSize: 0.95, initialChildSize: 0.95,
maxChildSize: 1.0, maxChildSize: 1.0,
builder: builder: (BuildContext context,
(BuildContext context, ScrollController scrollController) { ScrollController scrollController) {
return SingleChildScrollView( return SingleChildScrollView(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 1.20, height: MediaQuery.of(context).size.height * 1.20,
@ -162,7 +168,8 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context)
@ -170,23 +177,16 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 20, fontSize: 20,
), ),
InkWell(
child: Icon(
Icons.close,
size: 24.0,
),
onTap: () {
Navigator.pop(context);
},
)
]), ]),
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * 0.04, height:
MediaQuery.of(context).size.height * 0.04,
), ),
Row( Row(
children: [ children: [
Container( Container(
width: MediaQuery.of(context).size.width * 0.85, width: MediaQuery.of(context).size.width *
0.81,
child: AppTextFieldCustom( child: AppTextFieldCustom(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context)
.searchProcedureHere, .searchProcedureHere,
@ -204,7 +204,8 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
if (procedureName.text.isNotEmpty && if (procedureName.text.isNotEmpty &&
procedureName.text.length >= 3) procedureName.text.length >= 3)
model.getProcedureCategory( model.getProcedureCategory(
categoryName: procedureName.text); categoryName:
procedureName.text);
else else
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
TranslationBase.of(context) TranslationBase.of(context)
@ -214,7 +215,8 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
), ),
), ),
SizedBox( SizedBox(
width: MediaQuery.of(context).size.width * 0.02, width: MediaQuery.of(context).size.width *
0.02,
), ),
InkWell( InkWell(
onTap: () { onTap: () {
@ -320,8 +322,8 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
// ? // ?
EntityListCheckboxSearchWidget( EntityListCheckboxSearchWidget(
model: widget.model, model: widget.model,
masterList: masterList: widget
widget.model.categoriesList[0].entityList, .model.categoriesList[0].entityList,
removeHistory: (item) { removeHistory: (item) {
setState(() { setState(() {
entityList.remove(item); entityList.remove(item);
@ -366,7 +368,8 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
height: 15.0, height: 15.0,
), ),
Column( Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
// Container( // Container(
// child: Row( // child: Row(
@ -415,7 +418,8 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
); );
}), }),
), ),
bottomSheet: Container( ),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap( child: Wrap(
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
@ -447,6 +451,8 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
], ],
), ),
), ),
],
),
), ),
); );
} }

@ -0,0 +1,215 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/procedures/add-procedure-form.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class AddProcedureHome extends StatefulWidget {
final ProcedureViewModel model;
final PatiantInformtion patient;
const AddProcedureHome({Key key, this.model, this.patient}) : super(key: key);
@override
_AddProcedureHomeState createState() =>
_AddProcedureHomeState(patient: patient, model: model);
}
class _AddProcedureHomeState extends State<AddProcedureHome>
with SingleTickerProviderStateMixin {
_AddProcedureHomeState({this.patient, this.model});
ProcedureViewModel model;
PatiantInformtion patient;
TabController _tabController;
int _activeTab = 0;
@override
void initState() {
super.initState();
_tabController = TabController(length: 2, vsync: this);
_tabController.addListener(_handleTabSelection);
}
@override
void dispose() {
super.dispose();
_tabController.dispose();
}
_handleTabSelection() {
setState(() {
_activeTab = _tabController.index;
});
}
@override
Widget build(BuildContext context) {
//final routeArgs = ModalRoute.of(context).settings.arguments as Map;
//PatiantInformtion patient = routeArgs['patient'];
final screenSize = MediaQuery.of(context).size;
return BaseView<ProcedureViewModel>(
//onModelReady: (model) => model.getCategory(),
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: false,
body: NetworkBaseView(
baseViewModel: model,
child: DraggableScrollableSheet(
minChildSize: 0.90,
initialChildSize: 0.95,
maxChildSize: 1.0,
builder:
(BuildContext context, ScrollController scrollController) {
return Container(
height: MediaQuery.of(context).size.height * 1.20,
child: Padding(
padding: EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
'Add Procedure',
fontWeight: FontWeight.w700,
fontSize: 20,
),
InkWell(
child: Icon(
Icons.close,
size: 24.0,
),
onTap: () {
Navigator.pop(context);
},
)
]),
SizedBox(
height: MediaQuery.of(context).size.height * 0.04,
),
Expanded(
child: Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(
preferredSize: Size.fromHeight(
MediaQuery.of(context).size.height * 0.070),
child: Container(
height:
MediaQuery.of(context).size.height * 0.070,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Theme.of(context).dividerColor,
width: 0.5), //width: 0.7
),
color: Colors.white),
child: Center(
child: TabBar(
isScrollable: false,
controller: _tabController,
indicatorColor: Colors.transparent,
indicatorWeight: 1.0,
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor,
labelPadding: EdgeInsets.only(
top: 0, left: 0, right: 0, bottom: 0),
unselectedLabelColor: Colors.grey[800],
tabs: [
tabWidget(
screenSize,
_activeTab == 0,
'All Procedures',
),
tabWidget(
screenSize,
_activeTab == 1,
"Favorite Templates",
),
],
),
),
),
),
body: Column(
children: [
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController,
children: [
AddSelectedProcedure(
model: model,
patient: patient,
),
AddSelectedProcedure(
model: model,
patient: patient,
)
],
),
),
],
),
),
),
],
),
),
);
}),
),
),
);
}
Widget tabWidget(Size screenSize, bool isActive, String title,
{int counter = -1}) {
return Center(
child: Container(
height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA),
isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4,
borderWidth: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
title,
fontSize: SizeConfig.textMultiplier * 1.5,
color: isActive ? Colors.white : Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
if (counter != -1)
Container(
margin: EdgeInsets.all(4),
width: 15,
height: 15,
decoration: BoxDecoration(
color: isActive ? Colors.white : Color(0xFFD02127),
shape: BoxShape.circle,
),
child: Center(
child: FittedBox(
child: AppText(
"$counter",
fontSize: SizeConfig.textMultiplier * 1.5,
color: !isActive ? Colors.white : Color(0xFFD02127),
fontWeight: FontWeight.w700,
),
),
),
),
],
),
),
);
}
}

@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/procedures/add-procedure-form.dart'; import 'package:doctor_app_flutter/screens/procedures/add-procedure-form.dart';
import 'package:doctor_app_flutter/screens/procedures/add_procedure_homeScreen.dart';
import 'package:doctor_app_flutter/screens/procedures/update-procedure.dart'; import 'package:doctor_app_flutter/screens/procedures/update-procedure.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -104,7 +105,7 @@ class ProcedureScreen extends StatelessWidget {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => AddSelectedProcedure( builder: (context) => AddProcedureHome(
patient: patient, patient: patient,
model: model, model: model,
)), )),

Loading…
Cancel
Save