fix bugs in change the clinic, login page when get the projects and add the special Result

merge-requests/670/head
Mohammad Aljammal 5 years ago
parent 57fcd2cdeb
commit a97a331d87

@ -322,4 +322,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69
COCOAPODS: 1.10.0.rc.1
COCOAPODS: 1.10.1

@ -53,14 +53,7 @@ class DashboardViewModel extends BaseViewModel {
Future changeClinic(int clinicId, AuthenticationViewModel authProvider) async {
setState(ViewState.BusyLocal);
await getDoctorProfile();
ProfileReqModel docInfo = new ProfileReqModel(
doctorID: doctorProfile.doctorID,
clinicID: clinicId,
license: true,
projectID: doctorProfile.projectID,
tokenID: '',
languageID: 2);
ClinicModel clinicModel = ClinicModel(doctorID:doctorProfile.doctorID,clinicID: doctorProfile.clinicID, projectID: doctorProfile.projectID,);
ClinicModel clinicModel = ClinicModel(doctorID:doctorProfile.doctorID,clinicID: clinicId, projectID: doctorProfile.projectID,);
await authProvider.getDoctorProfileBasedOnClinic(clinicModel);
if(authProvider.state == ViewState.ErrorLocal) {
error = authProvider.error;

@ -166,14 +166,14 @@ class _LoginScreenState extends State<LoginScreen> {
value
.trim();
});
if(allowCallApi) {
// if(allowCallApi) {
this.getProjects(
authenticationViewModel.userInfo
.userID);
setState(() {
allowCallApi = false;
});
}
// setState(() {
// allowCallApi = false;
// });
// }
},
onClick: (){
@ -280,10 +280,11 @@ class _LoginScreenState extends State<LoginScreen> {
primaryFocus.unfocus();
}
String memberID ="";
getProjects(memberID)async {
if (memberID != null && memberID != '') {
if (projectsList.length == 0) {
if (this.memberID !=memberID) {
this.memberID = memberID;
await authenticationViewModel.getHospitalsList(memberID);
if(authenticationViewModel.state == ViewState.Idle) {
projectsList = authenticationViewModel.hospitals;

@ -52,7 +52,8 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
invoiceNO: widget.patientLabOrders.invoiceNo,
),
baseViewModel: model,
body: Scaffold(
body: AppScaffold(
isShowAppBar: false,
body: SingleChildScrollView(
child: Column(
children: [

@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:provider/provider.dart';
class LaboratoryResultWidget extends StatefulWidget {
@ -37,6 +38,7 @@ class LaboratoryResultWidget extends StatefulWidget {
class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
bool _isShowMoreGeneral = true;
bool _isShowMore = true;
ProjectViewModel projectViewModel;
@override
@ -141,9 +143,76 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
],
),
),
SizedBox(
height: 10,
SizedBox(height: 15,),
if(widget.details!=null && widget.details.isNotEmpty)
Column(
children: [
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: Container(
margin: EdgeInsets.only(
left: 10, right: 10),
child: AppText(
TranslationBase.of(context)
.specialResult,
bold: true,
))),
Container(
width: 25,
height: 25,
child: Icon(
_isShowMore
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down,
color: Colors.grey[800],
size: 22,
),
)
],
),
),
),
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 ?? TranslationBase.of(context).noDataAvailable,
)),
),
SizedBox(
height: 10,
),
],
),
],
),
],

@ -199,7 +199,7 @@ class _LabsHomePageState extends State<LabsHomePage> {
clinic: model
.patientLabOrdersList[index].clinicDescription,
appointmentDate:
model.patientLabOrdersList[index].orderDate,
model.patientLabOrdersList[index].orderDate.add(Duration(days: 1)),
orderNo: model.patientLabOrdersList[index].orderNo,
isShowTime: false,
),

@ -103,7 +103,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget
margin: EdgeInsets.symmetric(horizontal: 4),
child: InkWell(
onTap: () {
launch("tel://" + patient.mobileNumber);
launch("tel://" + patient?.mobileNumber??"");
},
child: Icon(
Icons.phone,
@ -235,7 +235,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget
style: TextStyle(
fontSize: 12, fontFamily: 'Poppins')),
new TextSpan(
text: patient.patientId.toString(),
text: patient?.patientId?.toString() ?? "",
style: TextStyle(
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
@ -256,7 +256,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
patient.nationalityFlagURL,
patient?.nationalityFlagURL??"",
height: 25,
width: 30,
errorBuilder: (BuildContext context,
@ -355,7 +355,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget
AppText('Invoice: ',
color: Colors.grey[800],
fontSize: 12),
AppText(invoiceNO, fontSize: 12)
AppText(invoiceNO??"", fontSize: 12)
],
),
if (branch != null)
@ -449,22 +449,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget
return newDate.toString();
}
isToday(date) {
DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date);
return DateFormat("yyyy-MM-dd").format(tempDate) ==
DateFormat("yyyy-MM-dd").format(DateTime.now());
}
myBoxDecoration() {
return BoxDecoration(
border: Border(
top: BorderSide(
color: Colors.green,
width: 5,
),
),
borderRadius: BorderRadius.circular(10));
}
@override
Size get preferredSize => Size(double.maxFinite, 310);

Loading…
Cancel
Save