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

merge-requests/438/head
haroon amjad 5 years ago
commit 6902e6529c

@ -34,8 +34,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.only(top: 10.0, bottom: 15.0), margin: EdgeInsets.only(top: 10.0, bottom: 15.0),
child: Text(TranslationBase.of(context).searchByDocText, child: Text(TranslationBase.of(context).searchByDocText, style: TextStyle(fontSize: 16.0, letterSpacing: 0.9)),
style: TextStyle(fontSize: 16.0, letterSpacing: 0.9)),
), ),
Container( Container(
decoration: BoxDecoration(color: Colors.white), decoration: BoxDecoration(color: Colors.white),
@ -44,11 +43,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
onChanged: (content) { onChanged: (content) {
_onDocTextChanged(content); _onDocTextChanged(content);
}, },
decoration: InputDecoration( decoration: InputDecoration(labelText: TranslationBase.of(context).enterDocName, fillColor: Colors.white, prefixIcon: Icon(Icons.search), border: OutlineInputBorder())),
labelText: TranslationBase.of(context).enterDocName,
fillColor: Colors.white,
prefixIcon: Icon(Icons.search),
border: OutlineInputBorder())),
), ),
Expanded( Expanded(
child: Align( child: Align(
@ -78,8 +73,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
_searchDoctor(context); _searchDoctor(context);
} }
}, },
child: Text(TranslationBase.of(context).search, child: Text(TranslationBase.of(context).search, style: TextStyle(fontSize: 18.0)),
style: TextStyle(fontSize: 18.0)),
), ),
); );
} }
@ -89,13 +83,10 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
List();
service service.getDoctorsListByName(doctorNameController.text, context).then((res) {
.getDoctorsListByName(doctorNameController.text, context) // GifLoaderDialogUtils.hideDialog(context);
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
if (res['DoctorList'].length != 0) { if (res['DoctorList'].length != 0) {
@ -104,27 +95,13 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
}); });
doctorsList.forEach((element) { doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital = List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.projectName).toList();
_patientDoctorAppointmentListHospital
.where(
(elementClinic) =>
elementClinic.filterName == element.projectName,
)
.toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[ _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
_patientDoctorAppointmentListHospital
.indexOf(doctorByHospital[0])]
.patientDoctorAppointmentList
.add(element);
} else { } else {
_patientDoctorAppointmentListHospital.add( _patientDoctorAppointmentListHospital
PatientDoctorAppointmentList( .add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));
filterName: element.projectName,
distanceInKMs:
element.projectDistanceInKiloMeters.toString(),
patientDoctorAppointment: element));
} }
}); });
} else { } else {
@ -133,8 +110,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
} }
}); });
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
navigateToSearchResults( navigateToSearchResults(context, doctorsList, _patientDoctorAppointmentListHospital);
context, doctorsList, _patientDoctorAppointmentListHospital);
} else { } else {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
@ -164,18 +140,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
getDoctorsList(context); getDoctorsList(context);
} }
navigateToSearchResults( navigateToSearchResults(context, List<DoctorList> docList, List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital) {
context, Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital)));
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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/config/config.dart';
class MyFamily extends StatefulWidget { class MyFamily extends StatefulWidget {
final bool isAppbarVisible; final bool isAppbarVisible;
Function onBackClick; Function onBackClick;
MyFamily({this.isAppbarVisible = true,this.onBackClick}); MyFamily({this.isAppbarVisible = true, this.onBackClick});
@override @override
_MyFamily createState() => _MyFamily(); _MyFamily createState() => _MyFamily();
@ -526,7 +527,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
loginAfter(result, context) async { loginAfter(result, context) async {
var currentLang = await sharedPref.getString(APP_LANGUAGE); 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); result = list.CheckActivationCode.fromJson(result);
var familyFile = await sharedPref.getObject(FAMILY_FILE); var familyFile = await sharedPref.getObject(FAMILY_FILE);
@ -547,8 +548,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
this.sharedPref.setString(TOKEN, result.authenticationTokenID); this.sharedPref.setString(TOKEN, result.authenticationTokenID);
await authenticatedUserObject.getUser(getUser: true); await authenticatedUserObject.getUser(getUser: true);
Provider.of<ProjectViewModel>(context, listen: false).user = authenticatedUserObject.user; Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).user = authenticatedUserObject.user;
Provider.of<ProjectViewModel>(context, listen: false).setUser(authenticatedUserObject.user); Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).setUser(authenticatedUserObject.user);
appointmentRateViewModel appointmentRateViewModel
.getIsLastAppointmentRatedList() .getIsLastAppointmentRatedList()
@ -565,14 +566,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
(r) => false) (r) => false)
} }
else else
{ {Navigator.pushAndRemoveUntil(AppGlobal.context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false)}
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: LandingPage(),
),
(r) => false)
}
}) })
.catchError((err) { .catchError((err) {
print(err); print(err);

Loading…
Cancel
Save