merge-requests/195/head
hussam al-habibeh 5 years ago
parent 7de6a8e99f
commit cbb8937b1d

@ -242,7 +242,6 @@ const Map<String, Map<String, String>> localizedValues = {
'ar': 'لا يوجد اي نتائج' 'ar': 'لا يوجد اي نتائج'
}, },
'typeMedicineName': {'en': 'Type Medicine Name', 'ar': 'اكتب اسم الدواء'}, 'typeMedicineName': {'en': 'Type Medicine Name', 'ar': 'اكتب اسم الدواء'},
'moreThan3Letter': { 'moreThan3Letter': {
'en': 'Medicine Name Should Be More Than 3 letter', 'en': 'Medicine Name Should Be More Than 3 letter',
'ar': 'يجب أن يكون اسم الدواء أكثر من 3 أحرف' 'ar': 'يجب أن يكون اسم الدواء أكثر من 3 أحرف'
@ -250,8 +249,5 @@ const Map<String, Map<String, String>> localizedValues = {
'gender2': {'en': 'Gender: ', 'ar': 'الجنس: '}, 'gender2': {'en': 'Gender: ', 'ar': 'الجنس: '},
'age2': {'en': 'Age: ', 'ar': 'العمر: '}, 'age2': {'en': 'Age: ', 'ar': 'العمر: '},
'referralPatient': {'en': 'Referral Patient', 'ar': 'المريض المحال '}, 'referralPatient': {'en': 'Referral Patient', 'ar': 'المريض المحال '},
'replySuccessfully': { 'replySuccessfully': {'en': 'Reply Successfully', 'ar': 'تم الرد بنجاح'},
'en': 'Reply Successfully',
'ar': 'تم الرد بنجاح'
},
}; };

@ -40,9 +40,7 @@ class _LandingPageState extends State<LandingPage> {
appBar: AppBar( appBar: AppBar(
elevation: 0, elevation: 0,
backgroundColor: HexColor('#515B5D'), backgroundColor: HexColor('#515B5D'),
textTheme: TextTheme( textTheme: TextTheme(headline6: TextStyle(color: Colors.white)),
headline6:
TextStyle(color: Colors.white)),
title: Text(getText(currentTab).toUpperCase()), title: Text(getText(currentTab).toUpperCase()),
leading: Builder( leading: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {

@ -76,324 +76,294 @@ class _ReferPatientState extends State<ReferPatientScreen> {
RoundedContainer( RoundedContainer(
margin: 10, margin: 10,
showBorder: true, showBorder: true,
raduis: 10, raduis: 10,
borderColor: Color(0xff707070), borderColor: Color(0xff707070),
width: double.infinity, width: double.infinity,
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9, top: SizeConfig.widthMultiplier * 0.9,
bottom: SizeConfig.widthMultiplier * 0.9, bottom: SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3, right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3), left: SizeConfig.widthMultiplier * 3),
child: Row( child: Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: DropdownButton( child: DropdownButton(
isExpanded: true, isExpanded: true,
value: _selectedClinic, value: _selectedClinic,
iconSize: 40, iconSize: 40,
elevation: 16, elevation: 16,
selectedItemBuilder: selectedItemBuilder: (BuildContext context) {
(BuildContext context) { return model.getClinicNameList().map((item) {
return model return Row(
.getClinicNameList() mainAxisSize: MainAxisSize.max,
.map((item) { children: <Widget>[
return Row( AppText(
mainAxisSize: MainAxisSize.max, item,
children: <Widget>[ fontSize:
AppText( SizeConfig.textMultiplier * 2.1,
item, ),
fontSize: ],
SizeConfig.textMultiplier * );
2.1, }).toList();
), },
], onChanged: (newValue) => {
); setState(() {
}).toList(); _selectedDoctor = null;
}, _selectedClinic = newValue;
onChanged: (newValue) => { var clinicInfo = model.clinicsList
setState(() { .where((i) => i['ClinicDescription']
_selectedDoctor = null; .toString()
_selectedClinic = newValue; .contains(_selectedClinic))
var clinicInfo = model .toList();
.clinicsList
.where((i) =>
i['ClinicDescription']
.toString()
.contains(
_selectedClinic))
.toList();
clinicId = clinicInfo[0]['ClinicID'] clinicId =
.toString(); clinicInfo[0]['ClinicID'].toString();
model.getDoctorsList(clinicId); model.getDoctorsList(clinicId);
}) })
}, },
items: model items: model.getClinicNameList().map((item) {
.getClinicNameList() return DropdownMenuItem(
.map((item) { value: item.toString(),
return DropdownMenuItem( child: Text(
value: item.toString(), item,
child: Text( textAlign: TextAlign.end,
item,
textAlign: TextAlign.end,
),
);
}).toList(),
), ),
), );
], }).toList(),
), ),
), ),
), ],
//--------------------------------------------------------------------// ),
AppText( ),
TranslationBase.of(context).doctor, ),
fontSize: 18, //--------------------------------------------------------------------//
fontWeight: FontWeight.bold, AppText(
marginLeft: 15, TranslationBase.of(context).doctor,
marginTop: 15, fontSize: 18,
), fontWeight: FontWeight.bold,
marginLeft: 15,
marginTop: 15,
),
RoundedContainer( RoundedContainer(
margin: 10, margin: 10,
showBorder: true, showBorder: true,
raduis: 10, raduis: 10,
borderColor: Color(0xff707070), borderColor: Color(0xff707070),
width: double.infinity, width: double.infinity,
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9, top: SizeConfig.widthMultiplier * 0.9,
bottom: SizeConfig.widthMultiplier * 0.9, bottom: SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3, right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3), left: SizeConfig.widthMultiplier * 3),
child: Row( child: Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: DropdownButton( child: DropdownButton(
isExpanded: true, isExpanded: true,
value: _selectedDoctor, value: _selectedDoctor,
iconSize: 40, iconSize: 40,
elevation: 16, elevation: 16,
selectedItemBuilder: selectedItemBuilder: (BuildContext context) {
(BuildContext context) { return model.getDoctorNameList().map((item) {
return model return Row(
.getDoctorNameList() mainAxisSize: MainAxisSize.max,
.map((item) { children: <Widget>[
return Row( AppText(
mainAxisSize: MainAxisSize.max, item,
children: <Widget>[ fontSize:
AppText( SizeConfig.textMultiplier * 2.1,
item, ),
fontSize: ],
SizeConfig.textMultiplier * );
2.1, }).toList();
), },
], onChanged: (newValue) => {
); setState(() {
}).toList(); _selectedDoctor = newValue;
}, doctorsList = model.doctorsList;
onChanged: (newValue) => {
setState(() {
_selectedDoctor = newValue;
doctorsList =
model.doctorsList;
var doctorInfo = doctorsList var doctorInfo = doctorsList
.where((i) => i['DoctorName'] .where((i) => i['DoctorName']
.toString() .toString()
.contains(_selectedDoctor)) .contains(_selectedDoctor))
.toList(); .toList();
doctorId = doctorInfo[0]['DoctorID'] doctorId =
.toString(); doctorInfo[0]['DoctorID'].toString();
}) })
}, },
items: model items: model.getDoctorNameList().map((item) {
.getDoctorNameList() return DropdownMenuItem(
.map((item) { value: item.toString(),
return DropdownMenuItem( child: Text(
value: item.toString(), item,
child: Text( textAlign: TextAlign.end,
item,
textAlign: TextAlign.end,
),
);
}).toList(),
), ),
), );
], }).toList(),
), ),
), ),
), //-----------------------------/// ],
AppText( ),
TranslationBase.of(context).ext, ),
fontSize: 18, ), //-----------------------------///
fontWeight: FontWeight.bold, AppText(
marginLeft: 15, TranslationBase.of(context).ext,
marginTop: 15, fontSize: 18,
), fontWeight: FontWeight.bold,
Padding( marginLeft: 15,
padding: const EdgeInsets.all(10.0), marginTop: 15,
child: AppTextFormField( ),
hintText: TranslationBase.of(context).ext, Padding(
controller: _extController, padding: const EdgeInsets.all(10.0),
inputFormatter: ONLY_NUMBERS, child: AppTextFormField(
textInputType: TextInputType.number, hintText: TranslationBase.of(context).ext,
onChanged: (value) => {}, controller: _extController,
), inputFormatter: ONLY_NUMBERS,
), textInputType: TextInputType.number,
AppText( onChanged: (value) => {},
TranslationBase.of(context).priority, ),
fontSize: 18, ),
fontWeight: FontWeight.bold, AppText(
marginLeft: 15, TranslationBase.of(context).priority,
marginTop: 15, fontSize: 18,
), fontWeight: FontWeight.bold,
marginLeft: 15,
marginTop: 15,
),
priorityBar(context), priorityBar(context),
AppText( AppText(
TranslationBase.of(context).referralFrequency + TranslationBase.of(context).referralFrequency +
getPriority(), getPriority(),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
marginLeft: 15, marginLeft: 15,
marginTop: 15, marginTop: 15,
), ),
AppText( AppText(
TranslationBase.of(context).referralFrequency, TranslationBase.of(context).referralFrequency,
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
marginLeft: 15, marginLeft: 15,
marginTop: 15, marginTop: 15,
), ),
RoundedContainer( RoundedContainer(
margin: 10, margin: 10,
showBorder: true, showBorder: true,
raduis: 10, raduis: 10,
borderColor: Color(0xff707070), borderColor: Color(0xff707070),
width: double.infinity, width: double.infinity,
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9, top: SizeConfig.widthMultiplier * 0.9,
bottom: SizeConfig.widthMultiplier * 0.9, bottom: SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3, right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3), left: SizeConfig.widthMultiplier * 3),
child: Row( child: Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: DropdownButton( child: DropdownButton(
isExpanded: true, isExpanded: true,
value: _selectedReferralFrequancy, value: _selectedReferralFrequancy,
iconSize: 40, iconSize: 40,
elevation: 16, elevation: 16,
selectedItemBuilder: selectedItemBuilder: (BuildContext context) {
(BuildContext context) { return model
return model .getReferralNamesList()
.getReferralNamesList() .map((item) {
.map((item) { return Row(
return Row( mainAxisSize: MainAxisSize.max,
mainAxisSize: MainAxisSize.max, children: <Widget>[
children: <Widget>[ AppText(
AppText( item,
item, fontSize:
fontSize: SizeConfig.textMultiplier * 2.1,
SizeConfig.textMultiplier * ),
2.1, ],
), );
], }).toList();
); },
}).toList(); onChanged: (newValue) => {
}, setState(() {
onChanged: (newValue) => { _selectedReferralFrequancy = newValue;
setState(() { var freqInfo = model.referalFrequancyList
_selectedReferralFrequancy = newValue; .singleWhere((i) => i['Description']
var freqInfo = model .toString()
.referalFrequancyList .contains(
.singleWhere((i) => i[ _selectedReferralFrequancy));
'Description'] freqId =
.toString() freqInfo['ParameterCode'].toString();
.contains( myFocusNode.requestFocus();
_selectedReferralFrequancy)); })
freqId = freqInfo['ParameterCode'] },
.toString(); items: model.getReferralNamesList().map((item) {
myFocusNode.requestFocus(); return DropdownMenuItem(
}) value: item.toString(),
}, child: Text(
items: model item,
.getReferralNamesList() textAlign: TextAlign.end,
.map((item) {
return DropdownMenuItem(
value: item.toString(),
child: Text(
item,
textAlign: TextAlign.end,
),
);
}).toList(),
), ),
), );
], }).toList(),
), ),
), ),
), ],
AppText( ),
TranslationBase.of(context).clinicDetailsandRemarks, ),
fontSize: 18, ),
fontWeight: FontWeight.bold, AppText(
marginLeft: 15, TranslationBase.of(context).clinicDetailsandRemarks,
marginTop: 15, fontSize: 18,
), fontWeight: FontWeight.bold,
Padding( marginLeft: 15,
padding: const EdgeInsets.all(10.0), marginTop: 15,
child: AppTextFormField( ),
hintText: TranslationBase.of(context).remarks, Padding(
focusNode: myFocusNode, padding: const EdgeInsets.all(10.0),
controller: _remarksController, child: AppTextFormField(
inputFormatter: ONLY_LETTERS, hintText: TranslationBase.of(context).remarks,
textInputType: TextInputType.text, focusNode: myFocusNode,
onChanged: (value) => {}, controller: _remarksController,
inputFormatter: ONLY_LETTERS,
textInputType: TextInputType.text,
onChanged: (value) => {},
),
),
Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
children: <Widget>[
AppText(
TranslationBase.of(context).pleaseFill,
color: Colors.red,
fontWeight: FontWeight.bold,
margin: 10,
visibility: isValid == null ? false : !isValid,
), ),
), // TODO replace AppButton with secondary button and add loading
Padding( AppButton(
padding: const EdgeInsets.all(20.0), title: TranslationBase.of(context).send,
child: Column( color: Color(PRIMARY_COLOR),
children: <Widget>[ onPressed: () => {referToDoctor(context, model)},
AppText( )
TranslationBase.of(context).pleaseFill, ],
color: Colors.red, ))
fontWeight: FontWeight.bold, ],
margin: 10, ),
visibility:
isValid == null ? false : !isValid,
),
// TODO replace AppButton with secondary button and add loading
AppButton(
title: TranslationBase
.of(context)
.send,
color: Color(PRIMARY_COLOR),
onPressed: () =>
{
referToDoctor(context, model)
},
title: TranslationBase.of(context).send,
color: (Hexcolor("#B8382B")),
onPressed: () => {referToDoctor(context)},
)
],
))
],
), ),
), ),
),); );
} }
Widget priorityBar(BuildContext _context) { Widget priorityBar(BuildContext _context) {
@ -436,30 +406,29 @@ class _ReferPatientState extends State<ReferPatientScreen> {
// ? Hexcolor("#B8382B") // ? Hexcolor("#B8382B")
// : Colors.white,//sideColor, // : Colors.white,//sideColor,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
),
), ),
)), ),
), )),
onTap: () { ),
print(_priorities.indexOf(item)); onTap: () {
setState(() { print(_priorities.indexOf(item));
_activePriority = _priorities.indexOf(item); setState(() {
}); _activePriority = _priorities.indexOf(item);
}), });
_isActive }),
? Container( _isActive
decoration: BoxDecoration( ? Container(
borderRadius: BorderRadius.circular(10), decoration: BoxDecoration(
color: Colors.white), borderRadius: BorderRadius.circular(10),
alignment: Alignment.center, color: Colors.white),
height: 3, alignment: Alignment.center,
width: 90, height: 3,
) width: 90,
: Container() )
]); : Container()
}).toList(), ]);
), }).toList(),
), ),
); );
} }
@ -488,10 +457,7 @@ class _ReferPatientState extends State<ReferPatientScreen> {
return; return;
} }
final routeArgs = ModalRoute final routeArgs = ModalRoute.of(context).settings.arguments as Map;
.of(context)
.settings
.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
try { try {
@ -508,8 +474,7 @@ class _ReferPatientState extends State<ReferPatientScreen> {
selectedDoctorID: doctorId.toString(), selectedDoctorID: doctorId.toString(),
projectID: patient.projectId); projectID: patient.projectId);
// TODO: Add Translation // TODO: Add Translation
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast('Reply Successfully');
'Reply Successfully');
Navigator.pop(context); Navigator.pop(context);
} catch (e) { } catch (e) {
DrAppToastMsg.showErrorToast(e); DrAppToastMsg.showErrorToast(e);

@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared name: _fe_analyzer_shared
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "12.0.0" version: "14.0.0"
analyzer: analyzer:
dependency: transitive dependency: transitive
description: description:
name: analyzer name: analyzer
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.40.6" version: "0.41.1"
archive: archive:
dependency: transitive dependency: transitive
description: description:
@ -70,7 +70,7 @@ packages:
name: build_config name: build_config
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.4.4" version: "0.4.5"
build_daemon: build_daemon:
dependency: transitive dependency: transitive
description: description:
@ -84,7 +84,7 @@ packages:
name: build_modules name: build_modules
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.1" version: "3.0.2"
build_resolvers: build_resolvers:
dependency: transitive dependency: transitive
description: description:
@ -98,21 +98,21 @@ packages:
name: build_runner name: build_runner
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.7" version: "1.10.9"
build_runner_core: build_runner_core:
dependency: transitive dependency: transitive
description: description:
name: build_runner_core name: build_runner_core
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.1.2" version: "6.1.4"
build_web_compilers: build_web_compilers:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: build_web_compilers name: build_web_compilers
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.12.2" version: "2.15.3"
built_collection: built_collection:
dependency: transitive dependency: transitive
description: description:
@ -161,7 +161,7 @@ packages:
name: checked_yaml name: checked_yaml
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.2" version: "1.0.4"
cli_util: cli_util:
dependency: transitive dependency: transitive
description: description:
@ -426,7 +426,7 @@ packages:
name: js name: js
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.6.2" version: "0.6.3-nullsafety.1"
json_annotation: json_annotation:
dependency: transitive dependency: transitive
description: description:
@ -468,7 +468,7 @@ packages:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0-nullsafety.4"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -622,7 +622,7 @@ packages:
name: pubspec_parse name: pubspec_parse
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.5" version: "0.1.7"
quiver: quiver:
dependency: transitive dependency: transitive
description: description:
@ -725,7 +725,7 @@ packages:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0-nullsafety.2"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
@ -767,7 +767,7 @@ packages:
name: timing name: timing
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.1+2" version: "0.1.1+3"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
@ -860,5 +860,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.10.0 <2.11.0" dart: ">=2.11.0-162.0 <=2.11.0-213.1.beta"
flutter: ">=1.22.0 <2.0.0" flutter: ">=1.22.0 <2.0.0"

Loading…
Cancel
Save