Merge branch 'diplomatic-quarter-live' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into diplomatic-quarter-haroon

merge-update-with-lab-changes
haroon amjad 5 years ago
commit ebb8a8fa2c

@ -7,8 +7,8 @@ import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
const MAX_SMALL_SCREEN = 660; const MAX_SMALL_SCREEN = 660;
const BASE_URL = 'https://uat.hmgwebservices.com/'; //const BASE_URL = 'https://uat.hmgwebservices.com/';
//const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/';
const GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; const GET_PROJECT = 'Services/Lists.svc/REST/GetProject';
///Doctor ///Doctor

@ -999,4 +999,28 @@ const Map localizedValues = {
"searchItemError": {"en": "Item name should be more than 3 character ", "ar": "يجب أن يكون اسم العنصر أكثر من 3 أحرف"}, "searchItemError": {"en": "Item name should be more than 3 character ", "ar": "يجب أن يكون اسم العنصر أكثر من 3 أحرف"},
"YouCanFind": {"en": "YouCanFind", "ar": "باستطاعتك العثور على "}, "YouCanFind": {"en": "YouCanFind", "ar": "باستطاعتك العثور على "},
"ItemInSearch": {"en": " Item In Search", "ar": " عنصر في البحث "}, "ItemInSearch": {"en": " Item In Search", "ar": " عنصر في البحث "},
"InvoiceNo": {"en": " Invoice No", "ar": "رقم الفاتورة"},
"SpecialResult": {"en": " Special Result", "ar": "نتيجة خاصة"},
"GeneralResult": {"en": "General Result", "ar": "نتيجة عامة"},
"show-more-btn": {
"en": "Flow Chart",
"ar": "النتائج التراكمية"
},
"value": {
"en": "Value",
"ar": "القيمة"
},
"range": {
"en": "Range",
"ar": "المدى"
},
"out-patient": {
"en": "Out Patient",
"ar": "عيادات خارجية"
},
"in-patient": {
"en": "In Patient",
"ar": "تنويم"
}
}; };

@ -147,7 +147,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
_firebaseMessaging.getToken().then((String token) { _firebaseMessaging.getToken().then((String token) {
sharedPref.setString(PUSH_TOKEN, token); sharedPref.setString(PUSH_TOKEN, token);
if (token != null && DEVICE_TOKEN == "") { if (token != null) {
DEVICE_TOKEN = token; DEVICE_TOKEN = token;
checkUserStatus(token); checkUserStatus(token);
} }
@ -410,9 +410,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
SETTINGS, SETTINGS,
); );
else else
Navigator.of(context).pushNamed( login();
WELCOME_LOGIN,
);
}, //do something, }, //do something,
) )
], ],
@ -553,4 +551,15 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
_changeCurrentTab(2); _changeCurrentTab(2);
} }
} }
login() async {
var data = await sharedPref.getObject(IMEI_USER_DATA);
sharedPref.remove(REGISTER_DATA_FOR_LOGIIN);
if (data != null) {
Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else {
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
}
}
} }

@ -370,7 +370,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
if (authenticated == true) { if (authenticated == true) {
if(user.logInType==2 || user.logInType ==3){ if(user !=null && (user.logInType==2 || user.logInType ==3)){
this.checkActivationCode(); this.checkActivationCode();
}else{ }else{
var request = this.getCommonRequest(type: type); var request = this.getCommonRequest(type: type);

@ -40,7 +40,7 @@ class LabsHomePage extends StatelessWidget {
leading: Radio( leading: Radio(
value: FilterType.Clinic, value: FilterType.Clinic,
groupValue: model.filterType, groupValue: model.filterType,
activeColor: Colors.red[800], activeColor: Theme.of(context).primaryColor,
onChanged: (FilterType value) { onChanged: (FilterType value) {
model.setFilterType(value); model.setFilterType(value);
}, },
@ -57,7 +57,7 @@ class LabsHomePage extends StatelessWidget {
leading: Radio( leading: Radio(
value: FilterType.Hospital, value: FilterType.Hospital,
groupValue: model.filterType, groupValue: model.filterType,
activeColor: Colors.red[800], activeColor: Theme.of(context).primaryColor,
onChanged: (FilterType value) => onChanged: (FilterType value) =>
model.setFilterType(value), model.setFilterType(value),
), ),

@ -85,6 +85,7 @@ class RadiologyHomePage extends StatelessWidget {
), ),
), ),
child: DoctorCard( child: DoctorCard(
isInOutPatient: radiology.isInOutPatient,
name: radiology.doctorName, name: radiology.doctorName,
profileUrl: radiology.doctorImageURL, profileUrl: radiology.doctorImageURL,
subName: '${radiology.projectName} \n${TranslationBase.of(context).billNo} ${radiology.invoiceNo}', subName: '${radiology.projectName} \n${TranslationBase.of(context).billNo} ${radiology.invoiceNo}',

@ -855,6 +855,14 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
String get searchItemError => localizedValues['searchItemError'][locale.languageCode]; String get searchItemError => localizedValues['searchItemError'][locale.languageCode];
String get youCanFind => localizedValues['YouCanFind'][locale.languageCode]; String get youCanFind => localizedValues['YouCanFind'][locale.languageCode];
String get itemInSearch => localizedValues['ItemInSearch'][locale.languageCode]; String get itemInSearch => localizedValues['ItemInSearch'][locale.languageCode];
String get invoiceNo => localizedValues['InvoiceNo'][locale.languageCode];
String get specialResult => localizedValues['SpecialResult'][locale.languageCode];
String get generalResult => localizedValues['GeneralResult'][locale.languageCode];
String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode];
String get value => localizedValues['value'][locale.languageCode];
String get range => localizedValues['range'][locale.languageCode];
String get outpatient => localizedValues['out-patient'][locale.languageCode];
String get inPatient => localizedValues['in-patient'][locale.languageCode];
} }

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -32,7 +33,7 @@ class LabResultWidget extends StatelessWidget {
//TODO model.getPatientLabResult(patientLabOrder: widget.patientLabOrder); //TODO model.getPatientLabResult(patientLabOrder: widget.patientLabOrder);
}, },
child: Texts( child: Texts(
'Flow Chart', TranslationBase.of(context).showMoreBtn,
decoration: TextDecoration.underline, decoration: TextDecoration.underline,
color: Colors.blue, color: Colors.blue,
), ),
@ -44,13 +45,13 @@ class LabResultWidget extends StatelessWidget {
inside: BorderSide( inside: BorderSide(
width: 2.0, color: Colors.grey[300]), width: 2.0, color: Colors.grey[300]),
), ),
children: fullData(patientLabResultList), children: fullData(patientLabResultList,context),
), ),
], ],
), ),
); );
} }
List<TableRow> fullData(List<LabResult> labResultList) { List<TableRow> fullData(List<LabResult> labResultList,context) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
@ -58,7 +59,7 @@ class LabResultWidget extends StatelessWidget {
Container( Container(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xff515B5D), color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic
? Radius.circular(0.0) ? Radius.circular(0.0)
@ -70,7 +71,7 @@ class LabResultWidget extends StatelessWidget {
), ),
child: Center( child: Center(
child: Texts( child: Texts(
'Description', TranslationBase.of(context).description,
color: Colors.white, color: Colors.white,
), ),
), ),
@ -80,17 +81,17 @@ class LabResultWidget extends StatelessWidget {
Container( Container(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xff515B5D), color: Theme.of(context).primaryColor,
), ),
child: Center( child: Center(
child: Texts('Value', color: Colors.white), child: Texts(TranslationBase.of(context).value, color: Colors.white),
), ),
height: 60), height: 60),
), ),
Container( Container(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xff515B5D), color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic
? Radius.circular(10.0) ? Radius.circular(10.0)
@ -101,7 +102,7 @@ class LabResultWidget extends StatelessWidget {
), ),
), ),
child: Center( child: Center(
child: Texts('Range', color: Colors.white), child: Texts(TranslationBase.of(context).range, color: Colors.white),
), ),
height: 60), height: 60),
), ),

@ -1,3 +1,5 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
@ -5,6 +7,7 @@ import 'package:diplomaticquarterapp/widgets/others/rounded_container_widget.dar
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
class DoctorCard extends StatelessWidget { class DoctorCard extends StatelessWidget {
final String name; final String name;
@ -26,22 +29,22 @@ class DoctorCard extends StatelessWidget {
this.billNo, this.billNo,
this.onTap, this.onTap,
this.onEmailTap, this.onEmailTap,
this.isInOutPatient}); this.isInOutPatient});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container( return Container(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
width: 0.5, width: 0.5,
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
), ),
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(8.0), Radius.circular(8.0),
), ),
color: Colors.white color: Colors.white),
),
child: InkWell( child: InkWell(
onTap: onTap, onTap: onTap,
child: Column( child: Column(
@ -50,18 +53,34 @@ class DoctorCard extends StatelessWidget {
Row( Row(
children: <Widget>[ children: <Widget>[
Container( Container(
width: 20, width:projectViewModel.isArabic? 27:20,
height: date == null ? 100 : 130, height: date == null ? projectViewModel.isArabic? 170 :100 : 150,
decoration: BoxDecoration( decoration: BoxDecoration(
color: !isInOutPatient? Colors.red[900]: Theme.of(context).primaryColor, color: !isInOutPatient
borderRadius: BorderRadius.only( ? Colors.red[900]
topLeft: Radius.circular(8), : Theme.of(context).primaryColor,
bottomLeft: Radius.circular(8))), borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(0)
: Radius.circular(8),
bottomLeft: projectViewModel.isArabic
? Radius.circular(0)
: Radius.circular(8),
topRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0),
bottomRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0),
),
),
child: RotatedBox( child: RotatedBox(
quarterTurns: 3, quarterTurns: 3,
child: Center( child: Center(
child: Text( child: Text(
!isInOutPatient? 'In Patient'.toUpperCase():'OutPatient'.toUpperCase(), !isInOutPatient
? TranslationBase.of(context)
.inPatient
.toUpperCase()
: TranslationBase.of(context)
.outpatient
.toUpperCase(),
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
)), )),
@ -116,14 +135,14 @@ class DoctorCard extends StatelessWidget {
), ),
), ),
), ),
if(onEmailTap!=null) if (onEmailTap != null)
InkWell( InkWell(
onTap: onEmailTap, onTap: onEmailTap,
child: Icon( child: Icon(
Icons.email, Icons.email,
color: Colors.red, color: Colors.red,
), ),
) )
], ],
), ),
), ),

@ -3,6 +3,8 @@ import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -41,139 +43,139 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return Container( return BaseView<LabsViewModel>(
margin: EdgeInsets.all(15), onModelReady: (model) =>
child: Column( model.getPatientLabResult(patientLabOrder: widget.patientLabOrder),
children: <Widget>[ builder: (_, model, w) => NetworkBaseView(
Column( baseViewModel: model,
crossAxisAlignment: CrossAxisAlignment.start, child: Container(
margin: EdgeInsets.all(15),
child: Column(
children: <Widget>[ children: <Widget>[
Container( Column(
margin: EdgeInsets.all(15), crossAxisAlignment: CrossAxisAlignment.start,
child: Row( children: <Widget>[
mainAxisAlignment: MainAxisAlignment.spaceBetween, Container(
children: <Widget>[ margin: EdgeInsets.all(15),
Expanded( child: Row(
child: Container( mainAxisAlignment: MainAxisAlignment.spaceBetween,
decoration: BoxDecoration( children: <Widget>[
shape: BoxShape.rectangle, Expanded(
color: Colors.white, child: Container(
borderRadius: BorderRadius.all( decoration: BoxDecoration(
Radius.circular(5.0), shape: BoxShape.rectangle,
)),
padding: EdgeInsets.all(10.0),
margin: EdgeInsets.only(left: 5, right: 5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts('Invoice No'),
Texts(widget.billNo),
],
),
),
),
InkWell(
onTap: widget.onTap,
child: Container(
margin: EdgeInsets.only(left: 5, right: 5),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.red[800],
borderRadius: BorderRadius.all(
Radius.circular(5.0),
)),
child: Container(
padding: EdgeInsets.all(10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Icon(
Icons.email,
color: Colors.white,
),
Texts(
'Send a copy',
color: Colors.white, color: Colors.white,
) borderRadius: BorderRadius.all(
], Radius.circular(5.0),
)),
padding: EdgeInsets.all(10.0),
margin: EdgeInsets.only(left: 5, right: 5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(TranslationBase.of(context).invoiceNo),
Texts(widget.billNo),
],
),
), ),
), ),
InkWell(
onTap: widget.onTap,
child: Container(
margin: EdgeInsets.only(left: 5, right: 5),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.all(
Radius.circular(5.0),
)),
child: Container(
padding: EdgeInsets.all(10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Icon(
Icons.email,
color: Colors.white,
),
Texts(
TranslationBase.of(context).sendCopy,
color: Colors.white,
)
],
),
),
),
)
],
),
),
SizedBox(
height: 10,
),
InkWell(
onTap: () {
setState(() {
_isShowMore = !_isShowMore;
});
},
child: Container(
padding: EdgeInsets.all(10.0),
margin: EdgeInsets.only(left: 5, right: 5),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(5.0),
)),
child: Row(
children: <Widget>[
Expanded(child: Texts(TranslationBase.of(context).specialResult)),
Container(
width: 25,
height: 25,
decoration: BoxDecoration(
shape: BoxShape.circle, color: Theme.of(context).primaryColor),
child: Icon(
_isShowMore
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down,
color: Colors.white,
size: 22,
),
)
],
), ),
) ),
], ),
), if (_isShowMore)
), AnimatedContainer(
SizedBox( padding: EdgeInsets.all(10.0),
height: 10, margin: EdgeInsets.only(left: 5, right: 5),
), decoration: BoxDecoration(
InkWell( shape: BoxShape.rectangle,
onTap: () {
setState(() {
_isShowMore = !_isShowMore;
});
},
child: Container(
padding: EdgeInsets.all(10.0),
margin: EdgeInsets.only(left: 5, right: 5),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(5.0),
)),
child: Row(
children: <Widget>[
Expanded(child: Texts('Special Result')),
Container(
width: 25,
height: 25,
decoration: BoxDecoration(
shape: BoxShape.circle, color: Colors.red[900]),
child: Icon(
_isShowMore
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down,
color: Colors.white, color: Colors.white,
size: 22, borderRadius: BorderRadius.only(
), bottomLeft: Radius.circular(5.0),
) bottomRight: Radius.circular(5.0),
], )),
duration: Duration(milliseconds: 7000),
child: Container(
width: double.infinity,
child: Html(
data: widget.details ?? 'No Data',
)),
),
SizedBox(
height: 12,
), ),
), Container(
),
if (_isShowMore)
AnimatedContainer(
padding: EdgeInsets.all(10.0),
margin: EdgeInsets.only(left: 5, right: 5),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(5.0),
bottomRight: Radius.circular(5.0),
)),
duration: Duration(milliseconds: 7000),
child: Container(
width: double.infinity,
child: Html(
data: widget.details ?? 'No Data',
)),
),
SizedBox(
height: 12,
),
BaseView<LabsViewModel>(
onModelReady: (model) => model.getPatientLabResult(
patientLabOrder: widget.patientLabOrder),
builder: (_, model, w) => NetworkBaseView(
baseViewModel: model,
child: Container(
child: Column( child: Column(
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
setState( setState(
() { () {
_isShowMoreGeneral = !_isShowMoreGeneral; _isShowMoreGeneral = !_isShowMoreGeneral;
}, },
); );
@ -189,13 +191,13 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
)), )),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded(child: Texts('General Result')), Expanded(child: Texts(TranslationBase.of(context).generalResult)),
Container( Container(
width: 25, width: 25,
height: 25, height: 25,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: Colors.red[900]), color: Theme.of(context).primaryColor),
child: Icon( child: Icon(
_isShowMoreGeneral _isShowMoreGeneral
? Icons.keyboard_arrow_up ? Icons.keyboard_arrow_up
@ -224,11 +226,12 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
child: Container( child: Container(
width: double.infinity, width: double.infinity,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
...List.generate( ...List.generate(
model.labResultLists.length, model.labResultLists.length,
(index) => LabResultWidget( (index) => LabResultWidget(
filterName: model filterName: model
.labResultLists[index].filterName, .labResultLists[index].filterName,
patientLabResultList: model patientLabResultList: model
@ -242,15 +245,13 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
), ),
], ],
), ),
), )
), ],
) ),
], ],
), ),
], ),
), ),
); );
} }
} }

Loading…
Cancel
Save