family file

er_location
Sultan Khan 5 years ago
parent 826c50ebf1
commit f6a3f0e615

@ -388,16 +388,12 @@ const Map<String, Map<String, String>> localizedValues = {
"building": {"en": "Building:", "ar": "المبنى"},
"branch": {"en": "Branch:", "ar": "الفرع"},
"emergencyServices": {"en": "Emergency Services:", "ar": "خدمات الطوارئ"},
"locationDialogMessage": {"en": "Allow the HMG app to access your location will assist you in showing the hospitals according to the nearest to you.", "ar": "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك."},
"parking":{"en":"Parking","ar":"مواقف"},
"alhabiServices":{"en":"HMG Service","ar":"خدمات الحبيب"},
"parkingTitle":{"en":"Car service, car service, service to save parking information, return to it later, 1- By clicking on (Read the code), save the parking data. 2- By clicking on the button (view my car park), it shows you the cars location in Google Maps. 3- Read another position by pressing the Clear Position Data button.","ar":" خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف). "},
"readBarcode":{"en":"Read Barcode","ar":"قراءة الكود"},
"showMyPark":{"en":"Show My Park","ar":"عرض بارك"},
"clearMyData":{"en":"clear My Data","ar":"امسح البيانات"},
"floor":{"en":"Floor:","ar":"الطابق"},
"gate":{"en":"Gate:","ar":"بوابة"},
"building":{"en":"Building:","ar":"المبنى"},
"branch":{"en":"Branch:","ar":"الفرع"},
"emergencyServices":{"en":"Emergency Services:","ar":"خدمات الطوارئ"}
"user-view-requester": {
"en": "User Wants To View Your Medical File",
"ar": "أشخاص يرغبون الاطلاع على ملفك الطبي"
},
"user-view": {
"en": "User Can View Your Medical File",
"ar": "أشخاص يمكنهم الاطلاع على ملفك الطبي"
},
};

@ -256,10 +256,12 @@ class _SearchByClinicState extends State<SearchByClinic> {
filterClinic() {
setState(() {
clinicsList = clinicsList
.where((i) => widget.clnicIds.indexOf(i.clinicID) > -1)
.toList();
print(clinicsList);
if (widget.clnicIds.length > 0) {
clinicsList = clinicsList
.where((i) => widget.clnicIds.indexOf(i.clinicID) > -1)
.toList();
print(clinicsList);
}
});
}
}

@ -1,178 +1,351 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/routes.dart';
class MyFamily extends StatelessWidget {
//bool isLoading = true;
class MyFamily extends StatefulWidget {
@override
_MyFamily createState() => _MyFamily();
}
class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
final familyFileProvider = FamilyFilesProvider();
AppSharedPreferences sharedPref = new AppSharedPreferences();
var userID;
TabController _tabController;
@override
void initState() {
_tabController = new TabController(length: 2, vsync: this, initialIndex: 0);
super.initState();
}
bool expandFlag = false;
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).myFamilyFiles,
isShowAppBar: true,
body: DefaultTabController(
length: 2,
child: SingleChildScrollView(
padding: EdgeInsets.all(20),
child: Container(
height: SizeConfig.realScreenHeight,
width: SizeConfig.realScreenWidth,
child: Stack(
children: <Widget>[
TabBar(
indicatorColor: Colors.red,
tabs: [
Padding(
padding: EdgeInsets.all(6),
child:
Text(TranslationBase.of(context).family)),
Padding(
padding: EdgeInsets.all(6),
child:
Text(TranslationBase.of(context).request)),
],
),
TabBarView(
children: [
myFamilyDetails(context),
myFamilyRequest(context)
],
)
],
)))));
return Scaffold(
appBar: AppBar(
bottom: TabBar(
indicatorColor: Colors.red,
tabs: [
Padding(
padding: EdgeInsets.all(6),
child: AppText(
TranslationBase.of(context).family,
color: Colors.white,
)),
Padding(
padding: EdgeInsets.all(6),
child: AppText(
TranslationBase.of(context).request,
color: Colors.white,
)),
],
controller: _tabController,
),
title: AppText(TranslationBase.of(context).myFamilyFiles,
color: Colors.white)),
body: TabBarView(
// physics: NeverScrollableScrollPhysics(),
children: [myFamilyDetails(context), myFamilyRequest(context)],
controller: _tabController),
bottomNavigationBar: BottomBarSearch());
// AppScaffold(
// appBarTitle: TranslationBase.of(context).myFamilyFiles,
// isShowAppBar: true,
// body: SingleChildScrollView(
// child: Container(
// height: SizeConfig.screenHeight,
// width: SizeConfig.realScreenWidth,
// padding: EdgeInsets.all(20),
// child: Stack(
// children: <Widget>[
// TabBar(
// controller: _tabController,
// indicatorColor: Colors.red,
// tabs: [
// Padding(
// padding: EdgeInsets.all(6),
// child: Text(TranslationBase.of(context).family)),
// Padding(
// padding: EdgeInsets.all(6),
// child: Text(TranslationBase.of(context).request)),
// ],
// ),
// TabBarView(
// controller: _tabController,
// children: [
// myFamilyDetails(context),
// myFamilyRequest(context)
// ],
// )
// ],
// ))));
}
Widget myFamilyDetails(context) {
return // Padding(
//padding: EdgeInsets.only(top: 50),
//child:
Column(
// mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Expanded(
flex: 3,
child: FutureBuilder(
future: getFamilyFiles(), // async work
builder: (BuildContext context,
AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default:
if (snapshot.hasError)
return Padding(
padding: EdgeInsets.all(10),
child: Text(snapshot.error));
else
return Padding(
padding: EdgeInsets.only(top: 50),
child: Column(children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 3,
child: Text(
TranslationBase.of(context).request)),
Expanded(
flex: 2,
child: Text(
TranslationBase.of(context).switchUser,
)),
Expanded(
flex: 1,
child: Text(
TranslationBase.of(context).deleteView,
)),
],
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: snapshot
.data.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return result.status == 3
? Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child:
Text(result.patientName)),
Expanded(
flex: 2,
child: IconButton(
icon: Icon(Icons.group),
color: Colors.black,
onPressed: () {
switchUser(
result, context);
},
)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
),
onPressed: () {
deleteFamily(
result, context);
},
)),
],
))
: SizedBox();
}).toList())
]));
}
},
)),
Expanded(
flex: 1,
child: Column(
children: <Widget>[
Row(
return Container(
height: MediaQuery.of(context).size.height,
margin: EdgeInsets.fromLTRB(20.0, 0, 20.0, 0.0),
child: Column(
children: <Widget>[
Expanded(
flex: 1,
child: FutureBuilder(
future: getFamilyFiles(), // async work
builder: (BuildContext context,
AsyncSnapshot<GetAllSharedRecordsByStatusResponse>
snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default:
if (snapshot.hasError)
return Padding(
padding: EdgeInsets.all(10),
child: Text(snapshot.error));
else
return Padding(
padding: EdgeInsets.only(top: 50),
child: Column(children: <Widget>[
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 3,
child: Text(TranslationBase.of(context)
.request)),
Expanded(
flex: 2,
child: Text(
TranslationBase.of(context)
.switchUser,
)),
Expanded(
flex: 1,
child: Text(
TranslationBase.of(context)
.deleteView,
)),
],
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: snapshot
.data.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return result.status == 3
? Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child: Text(
result.patientName)),
Expanded(
flex: 2,
child: IconButton(
icon: Icon(Icons.group),
color: Colors.black,
onPressed: () {
switchUser(
result, context);
},
)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
),
onPressed: () {
deleteFamily(
result, context);
},
)),
],
))
: SizedBox();
}).toList())
]));
}
},
)),
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).addFamilyMember,
() => {
Navigator.of(context).pushNamed(ADD_FAMILY_MEMBER_TYPE)
},
color: Colors.grey[900],
textColor: Colors.white,
))
Row(
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).addFamilyMember,
() => {
Navigator.of(context)
.pushNamed(ADD_FAMILY_MEMBER_TYPE)
},
color: Colors.grey[900],
textColor: Colors.white,
))
],
),
],
),
],
))
],
);
))
],
));
}
addMember() {}
Widget myFamilyRequest(context) {
return Column(
children: <Widget>[],
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
children: <Widget>[
// SizedBox(height: 20.0),
RoundedContainer(
child: ExpansionTile(
title: Text(
TranslationBase.of(context).userViewRequest,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
),
children: <Widget>[
FutureBuilder(
future: getUserViewRequest(), // async work
builder: (BuildContext context,
AsyncSnapshot<dynamic> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default:
if (snapshot.hasError)
return Padding(
padding: EdgeInsets.all(10),
child: Text(snapshot.error));
else
return Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 3,
child: Text(TranslationBase.of(context)
.request)),
Expanded(
flex: 2,
child: Text(
TranslationBase.of(context)
.switchUser,
)),
Expanded(
flex: 1,
child: Text(
TranslationBase.of(context)
.deleteView,
)),
],
),
Column(
children: [],
)
],
);
}
})
],
),
),
RoundedContainer(
child: ExpansionTile(
title: Text(
TranslationBase.of(context).sentRequest,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
),
children: <Widget>[
FutureBuilder(
future: getSentRequest(), // async work
builder:
(BuildContext context, AsyncSnapshot<dynamic> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default:
if (snapshot.hasError)
return Padding(
padding: EdgeInsets.all(10),
child: Text(snapshot.error));
else
return Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 3,
child: Text(
TranslationBase.of(context).request)),
Expanded(
flex: 2,
child: Text(
TranslationBase.of(context).switchUser,
)),
Expanded(
flex: 1,
child: Text(
TranslationBase.of(context).deleteView,
)),
],
),
Column(
children: [],
)
],
);
}
})
],
)),
RoundedContainer(
child: ExpansionTile(
title: Text(
TranslationBase.of(context).userView,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
),
children: <Widget>[
ListTile(
title: Text('data'),
)
],
))
],
),
);
}
@ -186,6 +359,16 @@ class MyFamily extends StatelessWidget {
}
}
Future getUserViewRequest() async {
var user = await sharedPref.getObject(USER_PROFILE);
return familyFileProvider.getUserViewRequest(user['PatientID']);
}
Future getSentRequest() async {
// var user = await sharedPref.getObject(USER_PROFILE);
return familyFileProvider.getUserSentRequest();
}
deleteFamily(family, context) {
ConfirmDialog dialog = new ConfirmDialog(
context: context,

@ -24,7 +24,7 @@ class DoctorsListService extends BaseService {
double long;
Future<Map> getDoctorsList(int clinicID, int projectID, BuildContext context,
{doctorId}) async {
{doctorId, doctorName}) async {
//Utils.showProgressDialog(context);
Map<String, dynamic> request;
@ -54,7 +54,7 @@ class DoctorsListService extends BaseService {
"SessionID": "YckwoXhUmWBsnHKEKig",
"ClinicID": clinicID,
"ProjectID": projectID,
//"DoctorName": doctorId, //!= null ? doctorId : 0,
"DoctorName": doctorName, //!= null ? doctorId : 0,
"ContinueDentalPlan": false,
"IsSearchAppointmnetByClinicID": true,
"PatientID": authUser.patientID != null ? authUser.patientID : 0,
@ -94,7 +94,8 @@ class DoctorsListService extends BaseService {
authUser = data;
}
if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) {
if (await this.sharedPref.getDouble(USER_LAT) != null &&
await this.sharedPref.getDouble(USER_LONG) != null) {
lat = await this.sharedPref.getDouble(USER_LAT);
long = await this.sharedPref.getDouble(USER_LONG);
}

@ -33,6 +33,10 @@ const String REMOVE_FILE_STATUS =
const String ACTIVATION_CODE_URL =
"Services/Authentication.svc/REST/CheckActivationCode";
const String SENT_REQUEST_URL =
'Services/Authentication.svc/REST/GetAllSharedRecordsByStatus';
const String RECEVIED_REQUEST_URL =
'Services/Authentication.svc/REST/GetAllPendingRecordsByResponseId';
class FamilyFilesProvider with ChangeNotifier {
bool isLogin = false;
@ -60,6 +64,48 @@ class FamilyFilesProvider with ChangeNotifier {
}
}
Future getUserViewRequest(responseID) async {
try {
dynamic localRes;
Map<String, dynamic> request = {};
request['ResponseID'] = responseID;
await new BaseAppClient().post(RECEVIED_REQUEST_URL,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
AppToast.showErrorToast(message: error);
throw error;
}, body: request);
sharedPref.setObject(FAMILY_FILE, localRes);
return Future.value(
GetAllSharedRecordsByStatusResponse.fromJson(localRes));
} catch (error) {
print(error);
throw error;
}
}
Future getUserSentRequest() async {
try {
dynamic localRes;
Map<String, dynamic> request = {};
request['Status'] = 0;
await new BaseAppClient().post(SENT_REQUEST_URL,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
AppToast.showErrorToast(message: error);
throw error;
}, body: request);
sharedPref.setObject(FAMILY_FILE, localRes);
return Future.value(
GetAllSharedRecordsByStatusResponse.fromJson(localRes));
} catch (error) {
print(error);
throw error;
}
}
Future<dynamic> addFamilyFile(AddFamilyFileReq request) async {
try {
dynamic localRes;

@ -417,33 +417,46 @@ class TranslationBase {
String get removeFamilyMember =>
localizedValues['remove-family-member'][locale.languageCode];
String get myMedicalFile =>localizedValues['MyMedicalFile'][locale.languageCode];
String get myMedicalFileSubTitle =>localizedValues['myMedicalFileSubTitle'][locale.languageCode];
String get viewMore =>localizedValues['viewMore'][locale.languageCode];
String get homeHealthCareService =>localizedValues['homeHealthCareService'][locale.languageCode];
String get onlinePharmacy =>localizedValues['OnlinePharmacy'][locale.languageCode];
String get emergencyService =>localizedValues['EmergencyService'][locale.languageCode];
String get onlinePaymentService =>localizedValues['OnlinePaymentService'][locale.languageCode];
String get offersAndPackages =>localizedValues['OffersAndPackages'][locale.languageCode];
String get comprehensiveMedicalCheckup =>localizedValues['ComprehensiveMedicalCheckup'][locale.languageCode];
String get hMGService =>localizedValues['HMGService'][locale.languageCode];
String get viewAllHabibMedicalService =>localizedValues['ViewAllHabibMedicalService'][locale.languageCode];
String get viewAll =>localizedValues['viewAll'][locale.languageCode];
String get contactUs =>localizedValues['ContactUs'][locale.languageCode];
String get viewAllWaysReachUs =>localizedValues['ViewAllWaysReachUs'][locale.languageCode];
String get medicalProfile =>localizedValues['medicalProfile'][locale.languageCode];
String get parking =>localizedValues['parking'][locale.languageCode];
String get alhabiServices =>localizedValues['alhabiServices'][locale.languageCode];
String get parkingTitle =>localizedValues['parkingTitle'][locale.languageCode];
String get readBarcode =>localizedValues['readBarcode'][locale.languageCode];
String get showMyPark =>localizedValues['showMyPark'][locale.languageCode];
String get clearMyData =>localizedValues['clearMyData'][locale.languageCode];
String get floor =>localizedValues['floor'][locale.languageCode];
String get gate =>localizedValues['gate'][locale.languageCode];
String get building =>localizedValues['building'][locale.languageCode];
String get branch =>localizedValues['branch'][locale.languageCode];
String get emergencyServices =>localizedValues['emergencyServices'][locale.languageCode];
String get myMedicalFile =>
localizedValues['MyMedicalFile'][locale.languageCode];
String get myMedicalFileSubTitle =>
localizedValues['myMedicalFileSubTitle'][locale.languageCode];
String get viewMore => localizedValues['viewMore'][locale.languageCode];
String get homeHealthCareService =>
localizedValues['homeHealthCareService'][locale.languageCode];
String get onlinePharmacy =>
localizedValues['OnlinePharmacy'][locale.languageCode];
String get emergencyService =>
localizedValues['EmergencyService'][locale.languageCode];
String get onlinePaymentService =>
localizedValues['OnlinePaymentService'][locale.languageCode];
String get offersAndPackages =>
localizedValues['OffersAndPackages'][locale.languageCode];
String get comprehensiveMedicalCheckup =>
localizedValues['ComprehensiveMedicalCheckup'][locale.languageCode];
String get hMGService => localizedValues['HMGService'][locale.languageCode];
String get viewAllHabibMedicalService =>
localizedValues['ViewAllHabibMedicalService'][locale.languageCode];
String get viewAll => localizedValues['viewAll'][locale.languageCode];
String get contactUs => localizedValues['ContactUs'][locale.languageCode];
String get viewAllWaysReachUs =>
localizedValues['ViewAllWaysReachUs'][locale.languageCode];
String get medicalProfile =>
localizedValues['medicalProfile'][locale.languageCode];
String get parking => localizedValues['parking'][locale.languageCode];
String get alhabiServices =>
localizedValues['alhabiServices'][locale.languageCode];
String get parkingTitle =>
localizedValues['parkingTitle'][locale.languageCode];
String get readBarcode => localizedValues['readBarcode'][locale.languageCode];
String get showMyPark => localizedValues['showMyPark'][locale.languageCode];
String get clearMyData => localizedValues['clearMyData'][locale.languageCode];
String get floor => localizedValues['floor'][locale.languageCode];
String get gate => localizedValues['gate'][locale.languageCode];
String get building => localizedValues['building'][locale.languageCode];
String get branch => localizedValues['branch'][locale.languageCode];
String get emergencyServices =>
localizedValues['emergencyServices'][locale.languageCode];
String get consultation =>
localizedValues['consultation'][locale.languageCode];
@ -452,6 +465,11 @@ class TranslationBase {
localizedValues['textToSpeech'][locale.languageCode];
String get locationDialogMessage =>
localizedValues['locationDialogMessage'][locale.languageCode];
String get userViewRequest =>
localizedValues['user-view-requester'][locale.languageCode];
String get userView => localizedValues['user-view'][locale.languageCode];
String get sentRequest =>
localizedValues['sent-requests'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -138,7 +138,7 @@ class _SearchBot extends State<BottomBarSearch> {
}
Future _speak(reconizedWord) async {
await flutterTts.speak(reconizedWord);
//await flutterTts.speak(reconizedWord);
getPages(reconizedWord);
}
@ -199,94 +199,88 @@ class _SearchBot extends State<BottomBarSearch> {
getCommands(result) async {
print(result);
results = result;
List clnicID = unique(result['ClinicId']);
switch (result["CommandNumber"]) {
case 100:
if (result['ProjectId'] != 0 &&
clnicID.length > 0 &&
result['DoctorId'].length > 0) {
var name = result['DoctorName'].replaceAll('دكتور', '');
if (clnicID.length == 1) {
getDoctorsList(
result['ProjectId'],
clnicID[0],
context,
doctorId: result['DoctorId'],
doctorName: name.trim(),
);
} else {
goToClinic(clnicID);
}
} else if (result['ProjectId'] != 0 &&
clnicID.length > 0 &&
result['DoctorId'].length == 0) {
if (clnicID.length == 1) {
getDoctorsList(
result['ProjectId'],
clnicID[0],
context,
);
} else {
goToClinic(clnicID);
}
} else if (result['ProjectId'] == 0 &&
clnicID.length > 0 &&
result['DoctorId'].length == 0) {
if (clnicID.length == 1) {
getDoctorsList(
result['ProjectId'],
clnicID[0],
context,
);
} else {
goToClinic(clnicID);
}
} else if (result['ProjectId'] == 0 &&
clnicID.length > 0 &&
result['DoctorId'].length > 0) {
var name = result['DoctorName'].replaceAll('دكتور', '');
if (clnicID.length == 1) {
getDoctorsList(
result['ProjectId'],
clnicID[0],
context,
doctorId: result['DoctorId'],
doctorName: name.trim(),
);
case '100':
{
List clnicID = unique(result['ClinicId']);
if (result['ProjectId'] != 0 &&
clnicID.length > 0 &&
result['DoctorId'].length > 0) {
if (clnicID.length == 1) {
getDoctorsList(
result['ProjectId'],
clnicID[0],
context,
doctorId: result['DoctorId'],
doctorName: null,
);
} else {
goToClinic(clnicID);
}
} else if (result['ProjectId'] != 0 &&
clnicID.length > 0 &&
result['DoctorId'].length == 0) {
if (clnicID.length == 1) {
getDoctorsList(
result['ProjectId'],
clnicID[0],
context,
);
} else {
goToClinic(clnicID);
}
} else if (result['ProjectId'] == 0 &&
clnicID.length > 0 &&
result['DoctorId'].length == 0) {
if (clnicID.length == 1) {
getDoctorsList(
result['ProjectId'],
clnicID[0],
context,
);
} else {
goToClinic(clnicID);
}
} else if (result['ProjectId'] == 0 &&
clnicID.length > 0 &&
result['DoctorId'].length > 0) {
if (clnicID.length == 1) {
getDoctorsList(
result['ProjectId'],
clnicID[0],
context,
doctorId: result['DoctorId'],
doctorName: null,
);
} else {
goToClinic(clnicID);
}
} else {
goToClinic(clnicID);
}
} else {
goToClinic(clnicID);
speak();
}
break;
case '102':
{
// getDoctorsList(
// 0,
// 0,
// context,
// doctorId: null,
// doctorName: result['DoctorName'],
// );
getDoctorsList(
0,
0,
context,
doctorId: result['DoctorId'],
doctorName: null,
);
speak();
}
speak();
break;
// case '101':
// Navigator.push(
// AppGlobal.context,
// MaterialPageRoute(
// builder: (context) => Search(
// type: 0,
// )));
// break;
// case '102':
// Navigator.push(
// AppGlobal.context,
// MaterialPageRoute(
// builder: (context) => Search(
// type: 1,
// )));
// break;
// case '103':
// eventProvider.setValue({"clinic_id": understand});
// break;
// case '104':
// eventProvider.setValue({"project_id": understand});
// break;
// case '105':
// eventProvider.setValue({"doctor_id": understand});
// break;
default:
Navigator.of(context).pushNamed(HOME);
speak();
@ -325,11 +319,13 @@ class _SearchBot extends State<BottomBarSearch> {
List<String> arrDistance = [];
DoctorsListService service = new DoctorsListService();
service
.getDoctorsList(clinicId, projectId, context, doctorId: doctorId)
.getDoctorsList(clinicId, projectId, context,
doctorId: doctorId, doctorName: doctorName)
.then((res) {
if (res['MessageStatus'] == 1) {
setState(() {
if (res['SearchDoctorsByTime_IsVoiceCommandList'].length != 0) {
if (res['SearchDoctorsByTime_IsVoiceCommandList'] != null &&
res['SearchDoctorsByTime_IsVoiceCommandList'].length != 0) {
doctorsList.clear();
res['SearchDoctorsByTime_IsVoiceCommandList'].forEach((v1) {
v1['DoctorList'].forEach((v) {
@ -340,6 +336,25 @@ class _SearchBot extends State<BottomBarSearch> {
.toString());
});
});
if (doctorsList.length == 1) {
getDoctorProfile(
projectId, clinicId, doctorId[0], context, doctorsList);
//speak();
} else {
navigateToSearchResults(context, doctorsList, arr, arrDistance);
}
} else if (res['DoctorList'].length != 0) {
doctorsList.clear();
res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
arr.add(new DoctorList.fromJson(v).projectName);
arrDistance.add(new DoctorList.fromJson(v)
.projectDistanceInKiloMeters
.toString());
});
if (doctorsList.length == 1) {
getDoctorProfile(
projectId, clinicId, doctorId[0], context, doctorsList);

Loading…
Cancel
Save