Merge branch 'development_new_design_2.0' into haroon-new-design

merge-update-with-lab-changes
haroon amjad 4 years ago
commit 6902e6529c

@ -34,8 +34,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
children: <Widget>[
Container(
margin: EdgeInsets.only(top: 10.0, bottom: 15.0),
child: Text(TranslationBase.of(context).searchByDocText,
style: TextStyle(fontSize: 16.0, letterSpacing: 0.9)),
child: Text(TranslationBase.of(context).searchByDocText, style: TextStyle(fontSize: 16.0, letterSpacing: 0.9)),
),
Container(
decoration: BoxDecoration(color: Colors.white),
@ -44,11 +43,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
onChanged: (content) {
_onDocTextChanged(content);
},
decoration: InputDecoration(
labelText: TranslationBase.of(context).enterDocName,
fillColor: Colors.white,
prefixIcon: Icon(Icons.search),
border: OutlineInputBorder())),
decoration: InputDecoration(labelText: TranslationBase.of(context).enterDocName, fillColor: Colors.white, prefixIcon: Icon(Icons.search), border: OutlineInputBorder())),
),
Expanded(
child: Align(
@ -78,8 +73,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
_searchDoctor(context);
}
},
child: Text(TranslationBase.of(context).search,
style: TextStyle(fontSize: 18.0)),
child: Text(TranslationBase.of(context).search, style: TextStyle(fontSize: 18.0)),
),
);
}
@ -89,13 +83,10 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
List<DoctorList> doctorsList = [];
DoctorsListService service = new DoctorsListService();
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital =
List();
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
service
.getDoctorsListByName(doctorNameController.text, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
service.getDoctorsListByName(doctorNameController.text, context).then((res) {
// GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
if (res['DoctorList'].length != 0) {
@ -104,27 +95,13 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital =
_patientDoctorAppointmentListHospital
.where(
(elementClinic) =>
elementClinic.filterName == element.projectName,
)
.toList();
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.projectName).toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[
_patientDoctorAppointmentListHospital
.indexOf(doctorByHospital[0])]
.patientDoctorAppointmentList
.add(element);
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else {
_patientDoctorAppointmentListHospital.add(
PatientDoctorAppointmentList(
filterName: element.projectName,
distanceInKMs:
element.projectDistanceInKiloMeters.toString(),
patientDoctorAppointment: element));
_patientDoctorAppointmentListHospital
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));
}
});
} else {
@ -133,8 +110,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
}
});
GifLoaderDialogUtils.hideDialog(context);
navigateToSearchResults(
context, doctorsList, _patientDoctorAppointmentListHospital);
navigateToSearchResults(context, doctorsList, _patientDoctorAppointmentListHospital);
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
@ -164,18 +140,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
getDoctorsList(context);
}
navigateToSearchResults(
context,
List<DoctorList> docList,
List<PatientDoctorAppointmentList>
patientDoctorAppointmentListHospital) {
Navigator.push(
context,
FadePage(
page: SearchResults(
isLiveCareAppointment: false,
doctorsList: docList,
patientDoctorAppointmentListHospital:
patientDoctorAppointmentListHospital)));
navigateToSearchResults(context, List<DoctorList> docList, List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital) {
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital)));
}
}

@ -34,12 +34,13 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/config/config.dart';
class MyFamily extends StatefulWidget {
final bool isAppbarVisible;
Function onBackClick;
MyFamily({this.isAppbarVisible = true,this.onBackClick});
MyFamily({this.isAppbarVisible = true, this.onBackClick});
@override
_MyFamily createState() => _MyFamily();
@ -526,7 +527,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
loginAfter(result, context) async {
var currentLang = await sharedPref.getString(APP_LANGUAGE);
Provider.of<ProjectViewModel>(context, listen: false).setPrivilege(privilegeList: result, isLoginChild: true);
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).setPrivilege(privilegeList: result, isLoginChild: true);
result = list.CheckActivationCode.fromJson(result);
var familyFile = await sharedPref.getObject(FAMILY_FILE);
@ -547,8 +548,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
this.sharedPref.setString(TOKEN, result.authenticationTokenID);
await authenticatedUserObject.getUser(getUser: true);
Provider.of<ProjectViewModel>(context, listen: false).user = authenticatedUserObject.user;
Provider.of<ProjectViewModel>(context, listen: false).setUser(authenticatedUserObject.user);
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).user = authenticatedUserObject.user;
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).setUser(authenticatedUserObject.user);
appointmentRateViewModel
.getIsLastAppointmentRatedList()
@ -565,14 +566,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
(r) => false)
}
else
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: LandingPage(),
),
(r) => false)
}
{Navigator.pushAndRemoveUntil(AppGlobal.context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false)}
})
.catchError((err) {
print(err);

Loading…
Cancel
Save