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

@ -44,6 +44,8 @@ android {
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
buildTypes {
@ -62,4 +64,7 @@ flutter {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "com.google.firebase:firebase-messaging:20.1.0"
implementation 'pub.devrel:easypermissions:0.4.0'
}

@ -11,6 +11,7 @@
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

@ -6,7 +6,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:3.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.2'
}

@ -1,4 +1,5 @@
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
org.gradle.jvmargs=-Xmx4608m

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

@ -5,120 +5,139 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
const MAX_SMALL_SCREEN = 660;
const BASE_URL = 'https://hmgwebservices.com/Services';
const BASE_URL = 'https://hmgwebservices.com/';
const GET_PROJECT = '/Lists.svc/REST/GetProject';
///Doctor
const GET_MY_DOCTOR = '/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_DOCTOR_PROFILE = '/Doctors.svc/REST/GetDocProfiles';
const GET_DOCTOR_RATING = '/Doctors.svc/REST/dr_GetAvgDoctorRating';
const GET_MY_DOCTOR =
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles';
const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating';
///Prescriptions
const PRESCRIPTIONS = '/Patients.svc/REST/GetPrescriptionApptList';
const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_PRESCRIPTIONS_ALL_ORDERS =
'/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT = '/Patients.svc/REST/INP_GetPrescriptionReport';
const SEND_PRESCRIPTION_EMAIL = '/Notifications.svc/REST/SendPrescriptionEmail';
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT =
'Services/Patients.svc/REST/INP_GetPrescriptionReport';
const SEND_PRESCRIPTION_EMAIL =
'Services/Notifications.svc/REST/SendPrescriptionEmail';
const GET_PRESCRIPTION_REPORT_ENH =
'/Patients.svc/REST/GetPrescriptionReport_enh';
'Services/Patients.svc/REST/GetPrescriptionReport_enh';
///Lab Order
const GET_Patient_LAB_ORDERS = '/Patients.svc/REST/GetPatientLabOrders';
const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders';
const GET_Patient_LAB_SPECIAL_RESULT =
'/Patients.svc/REST/GetPatientLabSpecialResults';
'Services/Patients.svc/REST/GetPatientLabSpecialResults';
///
const GET_PATIENT_ORDERS = '/Patients.svc/REST/GetPatientRadOrders';
const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';
const GET_PATIENT_ORDERS_DETAILS =
'/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead';
const GET_RAD_IMAGE_URL = '/Patients.svc/Rest/GetRadImageURL';
const SEND_RAD_REPORT_EMAIL = '/Notifications.svc/REST/SendRadReportEmail';
'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead';
const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL';
const SEND_RAD_REPORT_EMAIL =
'Services/Notifications.svc/REST/SendRadReportEmail';
///Feedback
const SEND_FEEDBACK = '/COCWS.svc/REST/InsertCOCItemInSPList';
const GET_STATUS_FOR_COCO = '/COCWS.svc/REST/GetStatusforCOC';
const GET_PATIENT_AppointmentHistory = '/Doctors.svc/REST/PateintHasAppoimentHistory';
const SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList';
const GET_STATUS_FOR_COCO = 'Services/COCWS.svc/REST/GetStatusforCOC';
const GET_PATIENT_AppointmentHistory =
'Services/Doctors.svc/REST/PateintHasAppoimentHistory';
///VITAL SIGN
const GET_PATIENT_VITAL_SIGN = '/Doctors.svc/REST/Doctor_GetPatientVitalSign';
const GET_PATIENT_VITAL_SIGN =
'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign';
///Reports
const REPORTS = '/Doctors.svc/REST/GetPatientMedicalReportStatusInfo';
const INSERT_REQUEST_FOR_MEDICAL_REPORT = '/Doctors.svc/REST/InsertRequestForMedicalReport';
const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo';
const INSERT_REQUEST_FOR_MEDICAL_REPORT =
'Services/Doctors.svc/REST/InsertRequestForMedicalReport';
///Rate
const IS_LAST_APPOITMENT_RATED = '/Doctors.svc/REST/IsLastAppoitmentRated';
const GET_APPOINTMENT_DETAILS_BY_NO = '/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo';
const IS_LAST_APPOITMENT_RATED =
'Services/Doctors.svc/REST/IsLastAppoitmentRated';
const GET_APPOINTMENT_DETAILS_BY_NO =
'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo';
//const BASE_URL = 'https://hmgwebservices.com/'; // Production Environment
//const BASE_URL = 'https://hmgwebservices.com/Services'; // Production Environment
//const BASE_URL = 'https://uat.hmgwebservices.com/Services'; // UAT Environment
//URL to get clinic list
const GET_CLINICS_LIST_URL = "/lists.svc/REST/GetClinicCentralized";
const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized";
//URL to get doctors list
const GET_DOCTORS_LIST_URL = "/Doctors.svc/REST/SearchDoctorsByTime";
const GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime";
//URL to get doctor free slots
const GET_DOCTOR_FREE_SLOTS = "/Doctors.svc/REST/GetDoctorFreeSlots";
const GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots";
//URL to insert appointment
const INSERT_SPECIFIC_APPOINTMENT =
"/Doctors.svc/REST/InsertSpecificAppointment";
"Services/Doctors.svc/REST/InsertSpecificAppointment";
//URL to get patient share
const GET_PATIENT_SHARE =
"/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO";
"Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO";
//URL to get patient appointment history
const GET_PATIENT_APPOINTMENT_HISTORY =
"/Doctors.svc/REST/PateintHasAppoimentHistory";
"Services/Doctors.svc/REST/PateintHasAppoimentHistory";
//URL to get patient appointment curfew history
const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY =
"/Doctors.svc/REST/AppoimentHistoryForCurfew";
"Services/Doctors.svc/REST/AppoimentHistoryForCurfew";
//URL to confirm appointment
const CONFIRM_APPOINTMENT = "/MobileNotifications.svc/REST/ConfirmAppointment";
const CONFIRM_APPOINTMENT =
"Services/MobileNotifications.svc/REST/ConfirmAppointment";
//URL to cancel appointment
const CANCEL_APPOINTMENT = "/Doctors.svc/REST/CancelAppointment";
const CANCEL_APPOINTMENT = "Services/Doctors.svc/REST/CancelAppointment";
//URL get appointment QR
const GENERATE_QR_APPOINTMENT = "/Doctors.svc/REST/GenerateQRAppointmentNo";
const GENERATE_QR_APPOINTMENT =
"Services/Doctors.svc/REST/GenerateQRAppointmentNo";
//URL send email appointment QR
const EMAIL_QR_APPOINTMENT = "/Notifications.svc/REST/sendEmailForOnLineCheckin";
const EMAIL_QR_APPOINTMENT =
"Services/Notifications.svc/REST/sendEmailForOnLineCheckin";
//URL check payment status
const CHECK_PAYMENT_STATUS = "/PayFort_Serv.svc/REST/GetRequestStatusByRequestID";
const CHECK_PAYMENT_STATUS =
"Services/PayFort_Serv.svc/REST/GetRequestStatusByRequestID";
//URL create advance payment
const CREATE_ADVANCE_PAYMENT = "/Doctors.svc/REST/CreateAdvancePayment";
const ADD_ADVANCE_NUMBER_REQUEST = '/PayFort_Serv.svc/REST/AddAdvancedNumberRequest';
const CREATE_ADVANCE_PAYMENT = "Services/Doctors.svc/REST/CreateAdvancePayment";
const IS_ALLOW_ASK_DOCTOR = '/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_CALL_REQUEST_TYPE = '/Doctors.svc/REST/GetCallRequestType_LOV';
const SEND_CALL_REQUEST = '/Doctors.svc/REST/InsertCallInfo';
const ADD_ADVANCE_NUMBER_REQUEST =
'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest';
const GET_LIVECARE_CLINICS = '/ER_VirtualCall.svc/REST/PatientER_GetClinics';
const GET_LIVECARE_CLINIC_TIMING = '/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule';
const IS_ALLOW_ASK_DOCTOR =
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_CALL_REQUEST_TYPE =
'Services/Doctors.svc/REST/GetCallRequestType_LOV';
const SEND_CALL_REQUEST = 'Services/Doctors.svc/REST/InsertCallInfo';
const GET_ER_APPOINTMENT_FEES = '/DoctorApplication.svc/REST/GetERAppointmentFees';
const GET_ER_APPOINTMENT_TIME = '/ER_VirtualCall.svc/REST/GetRestTime';
const GET_LIVECARE_CLINICS =
'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics';
const GET_LIVECARE_CLINIC_TIMING =
'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule';
const ADD_NEW_CALL_FOR_PATIENT_ER = '/DoctorApplication.svc/REST/NewCallForPatientER';
const GET_ER_APPOINTMENT_FEES =
'Services/DoctorApplication.svc/REST/GetERAppointmentFees';
const GET_ER_APPOINTMENT_TIME = 'Services/ER_VirtualCall.svc/REST/GetRestTime';
const GET_LIVECARE_HISTORY = '/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory';
const CANCEL_LIVECARE_REQUEST = '/ER_VirtualCall.svc/REST/DeleteErRequest';
const SEND_LIVECARE_INVOICE_EMAIL = '/Notifications.svc/REST/SendInvoiceForLiveCare';
const ADD_NEW_CALL_FOR_PATIENT_ER =
'Services/DoctorApplication.svc/REST/NewCallForPatientER';
const GET_LIVECARE_HISTORY =
'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory';
const CANCEL_LIVECARE_REQUEST =
'Services/ER_VirtualCall.svc/REST/DeleteErRequest';
const SEND_LIVECARE_INVOICE_EMAIL =
'Services/Notifications.svc/REST/SendInvoiceForLiveCare';
//URL to get medicine and pharmacies list
const CHANNEL = 3;
@ -135,12 +154,15 @@ const PATIENT_TYPE_ID = 1;
var DeviceTypeID = Platform.isIOS ? 1 : 2;
const LANGUAGE_ID = 2;
const GET_PHARMCY_ITEMS = "/Lists.svc/REST/GetPharmcyItems_Region";
const GET_PHARMACY_LIST = "/Patients.svc/REST/GetPharmcyList";
const GET_PAtIENTS_INSURANCE = "/Patients.svc/REST/Get_PatientInsuranceDetails";
const GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region";
const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList";
const GET_PAtIENTS_INSURANCE =
"Services/Patients.svc/REST/Get_PatientInsuranceDetails";
const GET_PAtIENTS_INSURANCE_UPDATED =
"/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory";
const GET_PAtIENTS_INSURANCE_APPROVALS = "/Patients.svc/REST/GetApprovalStatus";
"Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory";
const GET_PAtIENTS_INSURANCE_APPROVALS =
"Services/Patients.svc/REST/GetApprovalStatus";
const SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse';
class AppGlobal {
static var context;
@ -149,7 +171,7 @@ class AppGlobal {
Request getPublicRequest() {
Request request = new Request();
request.VersionID = 5.5; //3.6;
request.VersionID = 5.6; //3.6;
request.Channel = 3;
request.IPAdress = "10.20.10.20";
request.generalid = 'Cs2020@2016\$2958';

@ -319,22 +319,48 @@ const Map<String, Map<String, String>> localizedValues = {
"seeDetails": {"en": "SEE DETAILS", "ar": "منافعك التامينية"},
"insuranceCards": {"en": "Insurance Cards", "ar": "بطاقات التأمين"},
"requestType": {"en": "Request Type", "ar": "نوع الاستفسار"},
"register-info-family": {
"en": "How would like to add the new member?",
"ar": "كيف ترغب باضافة العضو الجديد؟"
},
"remove-family-member": {
"en": "Remove this member?",
"ar": "إزالة ملف العضو؟"
},
"MyMedicalFile": {"en": "My Medical File", 'ar': 'ملف الطبي الالكتروني'},
"myMedicalFileSubTitle": {"en": "All your medical records", 'ar': 'جميع سجلاتك البية'},
"myMedicalFileSubTitle": {
"en": "All your medical records",
'ar': 'جميع سجلاتك البية'
},
"viewMore": {"en": "View More", 'ar': 'عرض المزيد'},
"homeHealthCareService": {"en": "Home Health Care Service", 'ar': 'الرعاية الصحية المنزلية'},
"homeHealthCareService": {
"en": "Home Health Care Service",
'ar': 'الرعاية الصحية المنزلية'
},
"OnlinePharmacy": {"en": "Online Pharmacy", 'ar': 'صيدلايات الحبيب'},
"EmergencyService": {"en": "Emergency Service", 'ar': 'الفحص الطبي الشامل'},
"OnlinePaymentService": {"en": "Online Payment Service", 'ar': 'خدمة الدفع عبر الإلكتدوني'},
"OnlinePaymentService": {
"en": "Online Payment Service",
'ar': 'خدمة الدفع عبر الإلكتدوني'
},
"OffersAndPackages": {"en": "Offers and Packages", 'ar': 'العروض والباقات'},
"ComprehensiveMedicalCheckup": {"en": "Comprehensive Medical Check up", 'ar': 'فحص طبي شامل'},
"ComprehensiveMedicalCheckup": {
"en": "Comprehensive Medical Check up",
'ar': 'فحص طبي شامل'
},
"HMGService": {"en": "HMG Service", 'ar': 'جميع خدمات الحبيب'},
"ViewAllHabibMedicalService": {"en": "View All Habib Medical Service", 'ar': 'عرض خدمات الحبيب الطبية'},
"ViewAllHabibMedicalService": {
"en": "View All Habib Medical Service",
'ar': 'عرض خدمات الحبيب الطبية'
},
"viewAll": {"en": "View All", 'ar': 'عرض الكل'},
"ContactUs": {"en": "Contact Us", 'ar': 'الوصول إلينا'},
"ViewAllWaysReachUs": {"en": "View All Ways Reach Us", 'ar': 'جميع طرق الاتصال بنا'},
"ViewAllWaysReachUs": {
"en": "View All Ways Reach Us",
'ar': 'جميع طرق الاتصال بنا'
},
"medicalProfile": {"en": "Medical Profile", 'ar': 'الملف الطبي'},
"consultation": {"en": "Consultation", "ar": "استشارة"},
"logs": {"en": "Logs", "ar": "السجلات"}
"logs": {"en": "Logs", "ar": "السجلات"},
"textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"}
};

@ -10,3 +10,4 @@ const ONLY_SMS = 'only-sms';
const AUTH_DATA = 'auth-data';
const IMEI_USER_DATA = 'imei-user-data';
const NHIC_DATA = 'nhic-data';
const FAMILY_FILE = 'family-file';

@ -0,0 +1,92 @@
class AddFamilyFileReq {
int searchType;
int sharedPatientID;
String sharedPatientIdentificationID;
String sharedPatientMobileNumber;
String zipCode;
bool isRegister;
int patientStatus;
double versionID;
int channel;
int languageID;
String iPAdress;
String generalid;
int patientOutSA;
String sessionID;
bool isDentalAllowedBackend;
int deviceTypeID;
int patientID;
String tokenID;
int patientTypeID;
int patientType;
AddFamilyFileReq(
{this.searchType,
this.sharedPatientID,
this.sharedPatientIdentificationID,
this.sharedPatientMobileNumber,
this.zipCode,
this.isRegister,
this.patientStatus,
this.versionID,
this.channel,
this.languageID,
this.iPAdress,
this.generalid,
this.patientOutSA,
this.sessionID,
this.isDentalAllowedBackend,
this.deviceTypeID,
this.patientID,
this.tokenID,
this.patientTypeID,
this.patientType});
AddFamilyFileReq.fromJson(Map<String, dynamic> json) {
searchType = json['SearchType'];
sharedPatientID = json['SharedPatientID'];
sharedPatientIdentificationID = json['SharedPatientIdentificationID'];
sharedPatientMobileNumber = json['SharedPatientMobileNumber'];
zipCode = json['ZipCode'];
isRegister = json['isRegister'];
patientStatus = json['PatientStatus'];
versionID = json['VersionID'];
channel = json['Channel'];
languageID = json['LanguageID'];
iPAdress = json['IPAdress'];
generalid = json['generalid'];
patientOutSA = json['PatientOutSA'];
sessionID = json['SessionID'];
isDentalAllowedBackend = json['isDentalAllowedBackend'];
deviceTypeID = json['DeviceTypeID'];
patientID = json['PatientID'];
tokenID = json['TokenID'];
patientTypeID = json['PatientTypeID'];
patientType = json['PatientType'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SearchType'] = this.searchType;
data['SharedPatientID'] = this.sharedPatientID;
data['SharedPatientIdentificationID'] = this.sharedPatientIdentificationID;
data['SharedPatientMobileNumber'] = this.sharedPatientMobileNumber;
data['ZipCode'] = this.zipCode;
data['isRegister'] = this.isRegister;
data['PatientStatus'] = this.patientStatus;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress;
data['generalid'] = this.generalid;
data['PatientOutSA'] = this.patientOutSA;
data['SessionID'] = this.sessionID;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['DeviceTypeID'] = this.deviceTypeID;
data['PatientID'] = this.patientID;
data['TokenID'] = this.tokenID;
data['PatientTypeID'] = this.patientTypeID;
data['PatientType'] = this.patientType;
return data;
}
}

@ -0,0 +1,80 @@
class InsertSharePatientFileReq {
int responseID;
String shareFamilyPatientName;
int status;
int regionID;
double versionID;
int channel;
int languageID;
String iPAdress;
String generalid;
int patientOutSA;
String sessionID;
bool isDentalAllowedBackend;
int deviceTypeID;
int patientID;
String tokenID;
int patientTypeID;
int patientType;
InsertSharePatientFileReq(
{this.responseID,
this.shareFamilyPatientName,
this.status,
this.regionID,
this.versionID,
this.channel,
this.languageID,
this.iPAdress,
this.generalid,
this.patientOutSA,
this.sessionID,
this.isDentalAllowedBackend,
this.deviceTypeID,
this.patientID,
this.tokenID,
this.patientTypeID,
this.patientType});
InsertSharePatientFileReq.fromJson(Map<String, dynamic> json) {
responseID = json['ResponseID'];
shareFamilyPatientName = json['ShareFamilyPatientName'];
status = json['Status'];
regionID = json['RegionID'];
versionID = json['VersionID'];
channel = json['Channel'];
languageID = json['LanguageID'];
iPAdress = json['IPAdress'];
generalid = json['generalid'];
patientOutSA = json['PatientOutSA'];
sessionID = json['SessionID'];
isDentalAllowedBackend = json['isDentalAllowedBackend'];
deviceTypeID = json['DeviceTypeID'];
patientID = json['PatientID'];
tokenID = json['TokenID'];
patientTypeID = json['PatientTypeID'];
patientType = json['PatientType'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ResponseID'] = this.responseID;
data['ShareFamilyPatientName'] = this.shareFamilyPatientName;
data['Status'] = this.status;
data['RegionID'] = this.regionID;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress;
data['generalid'] = this.generalid;
data['PatientOutSA'] = this.patientOutSA;
data['SessionID'] = this.sessionID;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['DeviceTypeID'] = this.deviceTypeID;
data['PatientID'] = this.patientID;
data['TokenID'] = this.tokenID;
data['PatientTypeID'] = this.patientTypeID;
data['PatientType'] = this.patientType;
return data;
}
}

@ -21,7 +21,6 @@ AppSharedPreferences sharedPref = new AppSharedPreferences();
/// body: null);
class BaseAppClient {
post(String endPoint,
{Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
@ -32,7 +31,7 @@ class BaseAppClient {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN);
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'en');
var user = await sharedPref.getObject(USER_PROFILE);
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] : SETUP_ID
@ -59,7 +58,8 @@ class BaseAppClient {
: PATIENT_TYPE_ID;
if (user != null) {
body['TokenID'] = token;
body['PatientID'] = user['PatientID'];
body['PatientID'] =
body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
body['PatientOutSA'] = user['OutSA'];
body['SessionID'] = getSessionId(token);
}
@ -85,11 +85,13 @@ class BaseAppClient {
} else {
if (isAllowAny) {
onSuccess(parsed, statusCode);
} else if (!parsed['IsAuthenticated']) {
} else if (parsed['IsAuthenticated'] == null) {
if (parsed['isSMSSent'] == true) {
onSuccess(parsed, statusCode);
} else if (parsed['MessageStatus'] == 1) {
onSuccess(parsed, statusCode);
} else if (parsed['Result'] == 'OK') {
onSuccess(parsed, statusCode);
} else {
onFailure(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
@ -122,7 +124,6 @@ class BaseAppClient {
logout() async {
await sharedPref.remove(LOGIN_TOKEN_ID);
Navigator.of(AppGlobal.context).pushReplacementNamed(LOGIN_TYPE);
}
String getSessionId(String id) {

@ -14,7 +14,8 @@ class ProjectViewModel with ChangeNotifier {
bool isLoading = false;
bool isError = false;
String error = '';
dynamic searchvalue;
dynamic get searchValue => searchvalue;
Locale get appLocal => _appLocale;
bool get isArabic => _isArabic;
@ -43,7 +44,7 @@ class ProjectViewModel with ChangeNotifier {
void loadSharedPrefLanguage() async {
currentLanguage = await sharedPref.getString(APP_LANGUAGE);
_appLocale = Locale(currentLanguage ?? 'ar');
_appLocale = Locale(currentLanguage ?? 'en');
_isArabic = currentLanguage != null
? currentLanguage == 'ar' ? true : false
: true;
@ -71,4 +72,9 @@ class ProjectViewModel with ChangeNotifier {
if (subscription != null) subscription.cancel();
super.dispose();
}
setSearchValue(data) {
searchvalue = data;
notifyListeners();
}
}

@ -4,10 +4,11 @@ import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'config/size_config.dart';
import 'core/viewModels/project_view_model.dart';
import 'locator.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
void main() async {
setupLocator();
@ -15,6 +16,7 @@ void main() async {
}
class MyApp extends StatelessWidget {
/// static final _myTabbedPageKey = new GlobalKey<_LandingPageState>();
@override
Widget build(BuildContext context) {
return LayoutBuilder(
@ -27,6 +29,15 @@ class MyApp extends StatelessWidget {
ChangeNotifierProvider<ProjectViewModel>(
create: (context) => ProjectViewModel(),
),
ChangeNotifierProvider<SearchProvider>(
create: (context) => SearchProvider()),
ChangeNotifierProvider.value(
value: SearchProvider(),
),
StreamProvider.value(
value: RobotProvider().intStream(),
initialData: RobotProvider().setValue({}),
)
],
child: Consumer<ProjectViewModel>(
builder: (context, projectProvider, child) => MaterialApp(

@ -1,14 +1,19 @@
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/CardCommon.dart';
import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../uitl/translations_delegate_base.dart';
class BookingOptions extends StatelessWidget {
final bool isAppbar;
BookingOptions({this.isAppbar = false});
@override
Widget build(BuildContext context) {
final searchValue = Provider.of<SearchProvider>(context);
return AppScaffold(
isShowAppBar: false,
isShowAppBar: isAppbar,
appBarTitle: TranslationBase.of(context).bookAppo,
body: Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
@ -29,17 +34,18 @@ class BookingOptions extends StatelessWidget {
children: <Widget>[
Expanded(
child: CardCommon(
image:
'assets/images/new-design/search_by_clinic.png',
text: TranslationBase.of(context).clinic,
subText: TranslationBase.of(context).name),
image: 'assets/images/new-design/search_by_clinic.png',
text: TranslationBase.of(context).clinic,
subText: TranslationBase.of(context).name,
type: 0,
),
),
Expanded(
child: CardCommon(
image:
'assets/images/new-design/search_by_doctor.png',
image: 'assets/images/new-design/search_by_doctor.png',
text: TranslationBase.of(context).doctor,
subText: TranslationBase.of(context).name),
subText: TranslationBase.of(context).name,
type: 1),
)
],
),

@ -10,7 +10,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'BookConfirm.dart';
import 'components/DocAvailableAppointments.dart';
import 'components/DocInfo.dart';
@ -18,22 +18,40 @@ import 'components/DocInfo.dart';
class DoctorProfile extends StatefulWidget {
DoctorList doctor;
DoctorProfileList docProfileList;
final bool isOpenAppt;
DoctorProfile(
{@required this.doctor,
@required this.docProfileList,
this.isOpenAppt = false});
AuthenticatedUser authUser;
DoctorProfile({@required this.doctor, @required this.docProfileList});
@override
_DoctorProfileState createState() => _DoctorProfileState();
}
class _DoctorProfileState extends State<DoctorProfile>
with SingleTickerProviderStateMixin {
with TickerProviderStateMixin {
TabController _tabController;
bool showFooterButton = false;
var event = RobotProvider();
@override
void initState() {
_tabController = new TabController(
length: 2,
vsync: this,
initialIndex: widget.isOpenAppt == true ? 1 : 0);
event.controller.stream.listen((p) {
if (p['clinic_id'] != null &&
p['doctor_id'] != null &&
p['project_id'] != null) {
setState(() {
// need to take the data from here
// dropdownValue = p['clinic_id'];
});
}
});
_tabController = new TabController(length: 2, vsync: this);
widget.authUser = new AuthenticatedUser();
getPatientData();

@ -1,19 +1,25 @@
import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart';
import 'package:diplomaticquarterapp/widgets/others/floating_button_search.dart';
import 'package:flutter/material.dart';
class Search extends StatefulWidget {
final int type;
Search({this.type = 0});
@override
_SearchState createState() => _SearchState();
}
class _SearchState extends State<Search> with SingleTickerProviderStateMixin {
class _SearchState extends State<Search> with TickerProviderStateMixin {
TabController _tabController;
@override
void initState() {
_tabController = new TabController(length: 2, vsync: this);
_tabController =
new TabController(length: 2, vsync: this, initialIndex: widget.type);
super.initState();
}
@ -36,6 +42,7 @@ class _SearchState extends State<Search> with SingleTickerProviderStateMixin {
body: TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [SearchByClinic(), SearchByDoctor()],
controller: _tabController));
controller: _tabController),
bottomNavigationBar: BottomBarSearch());
}
}

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
@ -15,9 +16,28 @@ class SearchResults extends StatefulWidget {
}
class _SearchResultsState extends State<SearchResults> {
var event = RobotProvider();
List<DoctorList> tempList = [];
@override
void initState() {
// TODO: implement initState
event.controller.stream.listen((p) {
// if (p['project_id'] != null) {
// tempList = [];
// widget.doctorsList.forEach((e) => {
// if (e.projectID == int.parse(p['project_id'])) {tempList.add(e)}
// });
// } else if (p['doctor_id'] != null) {
// tempList = [];
// widget.doctorsList.forEach((e) => {
// if (e.doctorID == int.parse(p['doctor_id'])) {tempList.add(e)}
// });
// DoctorView().getDoctorsProfile(context, tempList[0], isAppo: true);
// }
// setState(() {
// widget.doctorsList = tempList;
// });
});
super.initState();
}

@ -1,11 +1,16 @@
import 'dart:convert';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import '../SearchResults.dart';
@ -19,11 +24,20 @@ class SearchByClinic extends StatefulWidget {
class _SearchByClinicState extends State<SearchByClinic> {
bool nearestAppo = false;
String dropdownValue;
var event = RobotProvider();
List<ListClinicCentralized> clinicsList = [];
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) => getClinicsList());
// event.controller.stream.listen((p) {
// if (p['clinic_id'] != null) {
// // setState(() {
// dropdownValue = p['clinic_id'].toString();
// //});
// getDoctorsList(context);
// }
// });
super.initState();
}
@ -59,8 +73,8 @@ class _SearchByClinicState extends State<SearchByClinic> {
),
borderRadius: BorderRadius.circular(10),
),
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0),
padding: EdgeInsets.all(10.0),
// margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0),
padding: EdgeInsets.all(8.0),
width: MediaQuery.of(context).size.width,
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
@ -75,7 +89,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
onChanged: (newValue) {
setState(() {
dropdownValue = newValue;
print(dropdownValue);
getDoctorsList(context);
});
},

@ -70,7 +70,11 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: _isButtonDisabled ? null : _searchDoctor(context),
onPressed: () {
if (_isButtonDisabled == false) {
_searchDoctor(context);
}
},
child: Text(TranslationBase.of(context).search,
style: TextStyle(fontSize: 18.0)),
),
@ -80,14 +84,16 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
getDoctorsList(BuildContext context) {
List<DoctorList> doctorsList = [];
DoctorsListService service = new DoctorsListService();
service.getDoctorsListByName(doctorNameController.text, context).then((res) {
service
.getDoctorsListByName(doctorNameController.text, context)
.then((res) {
if (res['MessageStatus'] == 1) {
setState(() {
if(res['DoctorList'].length != 0) {
res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
});
} else {}
if (res['DoctorList'].length != 0) {
res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
});
} else {}
});
navigateToSearchResults(context, doctorsList);
} else {
@ -95,7 +101,8 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
}
}).catchError((err) {
print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
_onDocTextChanged(content) {

@ -5,23 +5,24 @@ class CardCommon extends StatelessWidget {
final image;
final text;
final subText;
final type;
const CardCommon(
{@required this.image, @required this.text, @required this.subText});
{@required this.image,
@required this.text,
@required this.subText,
@required this.type});
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
navigateToSearch(context);
navigateToSearch(context, this.type);
},
child: Container(
margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.0),
decoration: BoxDecoration(boxShadow: [
BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)
], borderRadius: BorderRadius.circular(10),
color: Colors.white),
], borderRadius: BorderRadius.circular(10), color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
@ -39,9 +40,7 @@ class CardCommon extends StatelessWidget {
child: Text(this.subText,
overflow: TextOverflow.clip,
style: TextStyle(
color: Colors.black,
letterSpacing: 1.0,
fontSize: 15.0)),
color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)),
),
Container(
alignment: Alignment.bottomRight,
@ -54,9 +53,12 @@ class CardCommon extends StatelessWidget {
);
}
Future navigateToSearch(context) async {
Future navigateToSearch(context, type) async {
Navigator.push(
context, MaterialPageRoute(builder: (context) => Search()));
context,
MaterialPageRoute(
builder: (context) => Search(
type: type,
)));
}
}

@ -113,12 +113,12 @@ class DoctorView extends StatelessWidget {
return docSpeciality;
}
getDoctorsProfile(context, DoctorList docObject) {
getDoctorsProfile(context, DoctorList docObject, {isAppo}) {
List<DoctorProfileList> docProfileList = [];
DoctorsListService service = new DoctorsListService();
service
.getDoctorsProfile(
docObject.doctorID, docObject.clinicID, docObject.projectID, context)
.getDoctorsProfile(docObject.doctorID, docObject.clinicID,
docObject.projectID, context)
.then((res) {
if (res['MessageStatus'] == 1) {
if (res['DoctorProfileList'].length != 0) {
@ -126,7 +126,8 @@ class DoctorView extends StatelessWidget {
docProfileList.add(new DoctorProfileList.fromJson(v));
});
} else {}
navigateToDoctorProfile(context, docObject, docProfileList[0]);
navigateToDoctorProfile(context, docObject, docProfileList[0],
isAppo: isAppo);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
@ -135,13 +136,15 @@ class DoctorView extends StatelessWidget {
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
Future navigateToDoctorProfile(context, docObject, docProfile) async {
Future navigateToDoctorProfile(context, docObject, docProfile,
{isAppo}) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
DoctorProfile(doctor: docObject, docProfileList: docProfile)
));
builder: (context) => DoctorProfile(
doctor: docObject,
docProfileList: docProfile,
isOpenAppt: isAppo,
)));
}
}

@ -27,7 +27,7 @@ class NoiseBox extends StatefulWidget {
_NoiseBoxState createState() => _NoiseBoxState();
}
class _NoiseBoxState extends State<NoiseBox> with SingleTickerProviderStateMixin {
class _NoiseBoxState extends State<NoiseBox> with TickerProviderStateMixin {
AnimationController _animationController;
int _density;
@ -107,7 +107,9 @@ class NoisePainter extends CustomPainter {
@required this.density,
}) : assert(width != null),
assert(height != null),
assert(density != null && density >= 3 && density < math.min(width, height));
assert(density != null &&
density >= 3 &&
density < math.min(width, height));
List<Color> colors = <Color>[
Colors.black,

@ -0,0 +1,245 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/model/family-file/add_family_file_request.dart';
import 'package:diplomaticquarterapp/core/model/family-file/insert_share_file_request.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/pages/family/add-family_type.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/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/otp/sms-popup.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/config/shared_pref_kay.dart';
class AddMember extends StatefulWidget {
@override
_AddMember createState() => _AddMember();
}
class _AddMember extends State<AddMember> {
final util = Utils();
final nationalIDorFile = TextEditingController();
final int loginType = AddFamilyMemberType.loginType;
String mobileNo;
String countryCode = '966';
bool isButtonDisabled = true;
var sharedPref = new AppSharedPreferences();
final authService = new AuthProvider();
bool isLoading = false;
var familyFileProvider = FamilyFilesProvider();
var patientShareRequestID;
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).myFamilyFiles,
isShowAppBar: true,
body: isLoading == true
? AppCircularProgressIndicator()
: SingleChildScrollView(
child: Container(
padding:
EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30),
height: SizeConfig.realScreenHeight * .9,
width: SizeConfig.realScreenWidth,
child: Column(children: <Widget>[
Expanded(
flex: 2,
child: AppText(
TranslationBase.of(context).enterNationalId,
fontSize: SizeConfig.textMultiplier * 3.5,
textAlign: TextAlign.left,
)),
Expanded(
flex: 3,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
MobileNo(
onNumberChange: (value) =>
{mobileNo = value, validateForm()},
onCountryChange: (value) => countryCode = value),
Container(
child: TextFields(
controller: nationalIDorFile,
onChanged: (value) => {validateForm()},
prefixIcon: Icon(
loginType == 1
? Icons.chrome_reader_mode
: Icons.receipt,
color: Colors.red),
padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10),
hintText: loginType == 1
? TranslationBase.of(context).nationalID
: TranslationBase.of(context).fileNo,
))
],
),
),
Expanded(
flex: 3,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Row(
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).add,
() => {this.addMember()},
color: isButtonDisabled == true
? Colors.grey
: Colors.grey[900],
textColor: Colors.white,
))
],
),
],
))
]),
)));
}
void validateForm() {
if (util.validateIDBox(nationalIDorFile.text, loginType) == true &&
mobileNo.length >= 9 &&
util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) {
setState(() {
isButtonDisabled = false;
});
} else {
setState(() {
isButtonDisabled = true;
});
}
}
addMember() {
var request = AddFamilyFileReq();
if (this.loginType == 1) {
request.sharedPatientID = 0;
request.sharedPatientIdentificationID = this.nationalIDorFile.text;
} else if (this.loginType == 2) {
request.sharedPatientID = int.parse(this.nationalIDorFile.text);
request.sharedPatientIdentificationID = '';
}
request.searchType = this.loginType;
request.sharedPatientMobileNumber = this.mobileNo;
request.zipCode = countryCode;
request.isRegister = false;
request.patientStatus = 2;
loading(true);
familyFileProvider
.addFamilyFile(request)
.then((value) => manageFamily(value))
.catchError(() {
loading(false);
});
}
manageFamily(addMemberResult) {
loading(false);
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: addMemberResult['ShareFamilyFileObj']['Message'],
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {
insertFamilyData(addMemberResult),
ConfirmDialog.closeAlertDialog(context)
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
insertFamilyData(addMemberResult) {
var request = InsertSharePatientFileReq();
request.responseID = addMemberResult['ShareFamilyFileObj']['ReponseID'];
request.shareFamilyPatientName =
addMemberResult['ShareFamilyFileObj']['SharedPatientName'];
request.status = 2;
if (request.patientOutSA == 1) {
request.regionID = 2;
} else {
request.regionID = 1;
}
loading(true);
this
.familyFileProvider
.insertNewMember(request)
.then((value) => sendActivationCode(value));
}
sendActivationCode(result) {
// var request = this.getCommonRequest();
loading(true);
patientShareRequestID = result['PatientShareRequestID'];
this
.familyFileProvider
.sendActivationCode(mobileNo, countryCode, nationalIDorFile.text)
.then((result) => {
if (result != null && result['isSMSSent'] == true)
{this.startSMSService(1, result)}
// {loading(false), this.startSMSService(type)}
// else
// {loading(false)}
});
}
startSMSService(type, result) {
loading(false);
new SMSOTP(
context,
type,
this.mobileNo,
(value) => {this.checkActivationCode(value, result)},
() => {
print('Faild..'),
},
).displayDialog(context);
}
checkActivationCode(value, result) {
this
.familyFileProvider
.checkActivationCode(
result['LogInTokenID'], value, nationalIDorFile.text, mobileNo)
.then((result) => {
SMSOTP.hideSMSBox(context),
handleFamilyRequests(this.patientShareRequestID, 3)
});
}
handleFamilyRequests(id, stauts) {
this
.familyFileProvider
.acceptAndRejectRecievedRequests(id, stauts)
.then((result) => {
sharedPref.remove(FAMILY_FILE),
Navigator.of(context).pushNamed(
MY_FAMILIY,
)
});
}
loading(flag) {
setState(() {
isLoading = flag;
});
}
}

@ -0,0 +1,154 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.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/routes.dart';
class AddFamilyMemberType extends StatelessWidget {
static int loginType = 0;
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).myFamilyFiles,
isShowAppBar: true,
body: Padding(
padding: EdgeInsets.all(20),
child: Column(
children: <Widget>[
Expanded(
flex: 6,
child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Image.asset(
'assets/images/habib-logo.png',
height: 80,
width: 80,
),
Padding(
padding: EdgeInsets.all(20),
child: AppText(
TranslationBase.of(context).registerInfoFamily,
fontSize: SizeConfig.textMultiplier * 3.5,
textAlign: TextAlign.left,
),
),
Padding(
padding: EdgeInsets.all(20),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: InkWell(
onTap: () => {
AddFamilyMemberType.loginType = 1,
Navigator.of(context)
.pushNamed(ADD_FAMILY_MEMBER)
},
child: RoundedContainer(
borderColor: Colors.grey,
showBorder: true,
child: Padding(
padding: EdgeInsets.fromLTRB(
20, 10, 20, 10),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Image.asset(
'assets/images/id_card_icon.png',
height: SizeConfig
.imageSizeMultiplier *
12,
width: SizeConfig
.imageSizeMultiplier *
15,
),
SizedBox(
height: 20,
),
AppText(
TranslationBase.of(context)
.nationalID,
fontSize: SizeConfig
.textMultiplier *
2,
)
],
),
)))),
Expanded(
child: InkWell(
onTap: () => {
AddFamilyMemberType.loginType = 2,
Navigator.of(context)
.pushNamed(ADD_FAMILY_MEMBER)
},
child: RoundedContainer(
borderColor: Colors.grey,
showBorder: true,
child: Padding(
padding: EdgeInsets.fromLTRB(
25, 10, 25, 10),
child: Column(
children: <Widget>[
Image.asset(
'assets/images/my_file_white_icon.png',
height: SizeConfig
.imageSizeMultiplier *
12,
width: SizeConfig
.imageSizeMultiplier *
15,
),
SizedBox(
height: 20,
),
AppText(
TranslationBase.of(context)
.fileNo,
fontSize: SizeConfig
.textMultiplier *
2,
)
],
),
))))
],
)),
Divider(
color: Colors.grey,
height: 2,
),
]),
),
// Expanded(
// flex: 2,
// child: Column(
// mainAxisAlignment: MainAxisAlignment.end,
// children: <Widget>[
// Row(
// children: <Widget>[
// Expanded(
// child: DefaultButton(
// TranslationBase.of(context).registerNow,
// () => {
// Navigator.of(context).pushNamed(
// REGISTER,
// )
// },
// ))
// ],
// ),
// ],
// ))
],
)));
}
}

@ -1,25 +1,24 @@
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/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/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.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 StatefulWidget {
@override
_MyFamily createState() => _MyFamily();
}
class _MyFamily extends State<MyFamily> {
bool isLoading = true;
var familyFileProvider = FamilyFilesProvider();
@override
void initState() {
isLoading = true;
// checkUser(context);
super.initState();
}
class MyFamily extends StatelessWidget {
//bool isLoading = true;
final familyFileProvider = FamilyFilesProvider();
AppSharedPreferences sharedPref = new AppSharedPreferences();
var userID;
Widget build(BuildContext context) {
return AppScaffold(
@ -30,7 +29,7 @@ class _MyFamily extends State<MyFamily> {
child: SingleChildScrollView(
padding: EdgeInsets.all(20),
child: Container(
height: SizeConfig.realScreenHeight * .9,
height: SizeConfig.realScreenHeight,
width: SizeConfig.realScreenWidth,
child: Stack(
children: <Widget>[
@ -48,42 +47,32 @@ class _MyFamily extends State<MyFamily> {
],
),
TabBarView(
children: [myFamilyDetails(), myFamilyRequest()],
children: [
myFamilyDetails(context),
myFamilyRequest(context)
],
)
],
)))));
}
Widget myFamilyDetails() {
return Padding(
padding: EdgeInsets.only(top: 40),
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,
)),
],
),
FutureBuilder(
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.all(10),
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default:
if (snapshot.hasError)
@ -91,35 +80,160 @@ class _MyFamily extends State<MyFamily> {
padding: EdgeInsets.all(10),
child: Text(snapshot.error));
else
return Column(
children: snapshot
.data.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
return Padding(
padding: EdgeInsets.only(top: 50),
child: Column(children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 3, child: Text(result.patientName)),
Expanded(flex: 2, child: Icon(Icons.group)),
Expanded(flex: 1, child: Icon(Icons.delete)),
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,
)),
],
));
}).toList());
),
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(
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).addFamilyMember,
() => {
Navigator.of(context).pushNamed(ADD_FAMILY_MEMBER_TYPE)
},
color: Colors.grey[900],
textColor: Colors.white,
))
],
),
],
))
],
);
}
Widget myFamilyRequest() {
addMember() {}
Widget myFamilyRequest(context) {
return Column(
children: <Widget>[],
);
}
Future<GetAllSharedRecordsByStatusResponse> getFamilyFiles() {
return familyFileProvider.getSharedRecordByStatus();
Future<GetAllSharedRecordsByStatusResponse> getFamilyFiles() async {
if (await sharedPref.getObject(FAMILY_FILE) != null) {
// print(await sharedPref.getObject(FAMILY_FILE));
return Future.value(GetAllSharedRecordsByStatusResponse.fromJson(
await sharedPref.getObject(FAMILY_FILE)));
} else {
return familyFileProvider.getSharedRecordByStatus();
}
}
deleteFamily(family, context) {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).removeFamilyMember,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {
removeFamily(family, context),
ConfirmDialog.closeAlertDialog(context)
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
removeFamily(GetAllSharedRecordsByStatusList family, context) {
this.userID = family.iD;
Map<String, dynamic> request = {};
request['ID'] = this.userID;
request['IsActive'] = false;
this
.familyFileProvider
.deativateActivateMemberFile(request)
.then((value) => refreshFamily(context));
}
refreshFamily(context) {
sharedPref.remove(FAMILY_FILE);
(context as Element).reassemble();
}
switchUser(user, context) {
Utils.showProgressDialog(context);
this
.familyFileProvider
.silentLoggin(user)
.then((value) => loginAfter(value, context));
}
loginAfter(result, context) {
Utils.hideProgressDialog();
result = CheckActivationCode.fromJson(result);
this.sharedPref.clear();
this.sharedPref.setObject(USER_PROFILE, result.list);
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);
this.sharedPref.setString(TOKEN, result.authenticationTokenID);
//this.checkIfUserAgreedBefore(result),
Navigator.of(context).pushNamed(
HOME,
);
}
}

@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart';
import 'package:diplomaticquarterapp/pages/medical/my_admissions_page.dart';
import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart';
@ -24,6 +25,7 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'home_page.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
class LandingPage extends StatefulWidget {
static bool isOpenCallPage = false;
@ -37,6 +39,7 @@ class LandingPage extends StatefulWidget {
class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
int currentTab = 0;
PageController pageController;
ProjectViewModel projectProvider;
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
final authService = new AuthProvider();
@ -142,8 +145,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
print(route.settings.name);
}
Map<String, dynamic> myMap =
new Map<String, dynamic>.from(message);
Map<String, dynamic> myMap = new Map<String, dynamic>.from(message);
print(myMap);
LandingPage.isOpenCallPage = true;
LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
@ -267,6 +269,10 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
@override
Widget build(BuildContext context) {
//final searchValue = Provider.of<SearchProvider>(context);
//print(searchValue);
// projectProvider = Provider.of(context);
// checkValue(projectProvider);
return Scaffold(
appBar: AppBar(
elevation: 0,
@ -356,4 +362,10 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
void setUserValues(value) async {
sharedPref.setObject(IMEI_USER_DATA, value);
}
checkValue(projectProvider) {
if (projectProvider.searchValue != null) {
_changeCurrentTab(2);
}
}
}

@ -271,10 +271,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
if (type == 2 || type == 3) {
fingrePrintBefore = type;
}
this.selectedOption =
(user != null && (user.logInType == 3 || user.logInType == 2))
? user.logInType
: fingrePrintBefore != null ? fingrePrintBefore : type;
this.selectedOption = fingrePrintBefore != null ? fingrePrintBefore : type;
switch (type) {
case 1:
@ -411,21 +408,12 @@ class _ConfirmLogin extends State<ConfirmLogin> {
});
}
setUser() async {
setUser() async {}
setDefault() async {
if (await sharedPref.getObject(IMEI_USER_DATA) != null)
user = SelectDeviceIMEIRES.fromJson(
await sharedPref.getObject(IMEI_USER_DATA));
}
setDefault() async {
// this.user = this.cs.sharedService.getSharedData(
// AuthenticationService.IMEI_USER_DATA,
// false
// );
setState(() {
setUser();
});
if (await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN) != null) {
isMoreOption = true;
@ -488,46 +476,43 @@ class _ConfirmLogin extends State<ConfirmLogin> {
SMSOTP.showLoadingDialog(context, true);
var request = this.getCommonRequest().toJson();
this
.authService
.checkActivationCode(request, value)
.then((result) => {
if (result is Map)
this.authService.checkActivationCode(request, value).then((result) => {
if (result is Map)
{
result = CheckActivationCode.fromJson(result),
if (this.registerd_data != null &&
this.registerd_data.isRegister == true)
{
result = CheckActivationCode.fromJson(result),
if (this.registerd_data != null &&
this.registerd_data.isRegister == true)
{
Navigator.of(context).pushNamed(
REGISTER_INFO,
)
}
else
{
this.userData = result
.list, //AuthenticatedUser.fromJson(result['List'][0]),
this.sharedPref.setObject(USER_PROFILE, result.list),
this.loginTokenID = result.logInTokenID,
this
.sharedPref
.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
this
.sharedPref
.setString(TOKEN, result.authenticationTokenID),
this.checkIfUserAgreedBefore(result),
// Navigator.of(context).pop(),
SMSOTP.showLoadingDialog(context, false),
}
Navigator.of(context).pushNamed(
REGISTER_INFO,
)
}
else
{
this.userData = result
.list, //AuthenticatedUser.fromJson(result['List'][0]),
this.sharedPref.setObject(USER_PROFILE, result.list),
this.loginTokenID = result.logInTokenID,
this
.sharedPref
.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
this
.sharedPref
.setString(TOKEN, result.authenticationTokenID),
this.checkIfUserAgreedBefore(result),
// Navigator.of(context).pop(),
SMSOTP.showLoadingDialog(context, false),
Future.delayed(Duration(seconds: 1), () {
AppToast.showErrorToast(message: result);
}),
}
});
}
else
{
// Navigator.of(context).pop(),
SMSOTP.showLoadingDialog(context, false),
Future.delayed(Duration(seconds: 1), () {
AppToast.showErrorToast(message: result);
}),
}
});
}
checkIfUserAgreedBefore(CheckActivationCode result) {
@ -540,7 +525,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}
insertIMEI() {
authService.insertDeviceImei().then((value) => {goToHome()});
authService.insertDeviceImei(selectedOption).then((value) => {goToHome()});
}
goToHome() {

@ -20,7 +20,7 @@ class DoctorProfilePage extends StatefulWidget {
}
class _DoctorProfilePageState extends State<DoctorProfilePage>
with SingleTickerProviderStateMixin {
with TickerProviderStateMixin {
TabController _tabController;
final PatientDoctorAppointment patientDoctorAppointment;
@ -61,10 +61,9 @@ class _DoctorProfilePageState extends State<DoctorProfilePage>
margin: EdgeInsets.all(5),
width: 50,
height: 50,
decoration:
BoxDecoration(shape: BoxShape.circle,
color: Colors.grey
),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.grey),
child: Icon(
Icons.calendar_view_day,
size: 25,
@ -82,10 +81,9 @@ class _DoctorProfilePageState extends State<DoctorProfilePage>
margin: EdgeInsets.all(5),
width: 50,
height: 50,
decoration:
BoxDecoration(shape: BoxShape.circle,
color: Colors.grey
),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.grey),
child: Icon(
Icons.format_list_bulleted,
size: 25,
@ -151,8 +149,7 @@ class _DoctorProfilePageState extends State<DoctorProfilePage>
indicatorWeight: 3.0,
tabs: [
Tab(
child: Text(
'Doctor Information',
child: Text('Doctor Information',
style: TextStyle(color: Colors.black))),
Tab(
child: Text(
@ -166,7 +163,12 @@ class _DoctorProfilePageState extends State<DoctorProfilePage>
height: MediaQuery.of(context).size.height * 0.8,
child: TabBarView(
physics: BouncingScrollPhysics(),
children: [DoctorInformation(doctorProfile: model.doctorProfile,), Container()],
children: [
DoctorInformation(
doctorProfile: model.doctorProfile,
),
Container()
],
controller: _tabController,
),
),

@ -8,6 +8,8 @@ import 'package:diplomaticquarterapp/pages/login/welcome.dart';
import 'package:diplomaticquarterapp/pages/login/login-type.dart';
import 'package:diplomaticquarterapp/pages/login/login.dart';
import 'package:diplomaticquarterapp/pages/login/register.dart';
import 'package:diplomaticquarterapp/pages/family/add-family_type.dart';
import 'package:diplomaticquarterapp/pages/family/add-family-member.dart';
const String INIT_ROUTE = '/';
const String HOME = '/';
@ -20,6 +22,8 @@ const String REGISTER = 'register';
const String CONFIRM_LOGIN = 'confrim-login';
const String REGISTER_INFO = 'register-info';
const String MY_FAMILIY = 'my-family';
const String ADD_FAMILY_MEMBER_TYPE = 'add-family-member-type';
const String ADD_FAMILY_MEMBER = 'add-family-member';
const String LIVE_CARE = 'live-care';
var routes = {
HOME: (_) => LandingPage(),
@ -31,5 +35,7 @@ var routes = {
CONFIRM_LOGIN: (_) => ConfirmLogin(),
REGISTER_INFO: (_) => RegisterInfo(),
MY_FAMILIY: (_) => MyFamily(),
ADD_FAMILY_MEMBER_TYPE: (_) => AddFamilyMemberType(),
ADD_FAMILY_MEMBER: (_) => AddMember(),
LIVE_CARE: (_) => LiveCareHome()
};

@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:flutter/cupertino.dart';
class DoctorsListService extends BaseService {
@ -19,8 +20,9 @@ class DoctorsListService extends BaseService {
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
Future<Map> getDoctorsList(
int clinicID, int projectID, BuildContext context) async {
Future<Map> getDoctorsList(int clinicID, int projectID, BuildContext context,
{doctorId}) async {
//Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -43,11 +45,12 @@ class DoctorsListService extends BaseService {
"SessionID": "YckwoXhUmWBsnHKEKig",
"ClinicID": clinicID,
"ProjectID": projectID,
"DoctorName": doctorId, //!= null ? doctorId : 0,
"ContinueDentalPlan": false,
"IsSearchAppointmnetByClinicID": true,
"PatientID": authUser.patientID != null ? authUser.patientID : 0,
"gender": authUser.gender != null ? authUser.gender : 0,
"age": authUser.age != null ? authUser.age : 0,
"gender": authUser.gender != null ? authUser.gender : 0,
"age": authUser.age != null ? authUser.age : 0,
"IsGetNearAppointment": false,
"Latitude": 0,
"Longitude": 0,
@ -92,8 +95,8 @@ class DoctorsListService extends BaseService {
"IsSearchAppointmnetByClinicID": false,
"DoctorName": docName,
"PatientID": authUser.patientID != null ? authUser.patientID : 0,
"gender": authUser.gender != null ? authUser.gender : 0,
"age": authUser.age != null ? authUser.age : 0,
"gender": authUser.gender != null ? authUser.gender : 0,
"age": authUser.age != null ? authUser.age : 0,
"IsGetNearAppointment": false,
"Latitude": 0,
"Longitude": 0,

@ -18,22 +18,24 @@ import 'package:flutter/cupertino.dart';
enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED }
AppSharedPreferences sharedPref = new AppSharedPreferences();
const String INSERT_DEVICE_IMEI = '/Patients.svc/REST/Patient_INSERTDeviceIMEI';
const String INSERT_DEVICE_IMEI =
'Services/Patients.svc/REST/Patient_INSERTDeviceIMEI';
const String SELECT_DEVICE_IMEI =
'/Patients.svc/REST/Patient_SELECTDeviceIMEIbyIMEI';
'Services/Patients.svc/REST/Patient_SELECTDeviceIMEIbyIMEI';
const String CHECK_PATIENT_AUTH =
'/Authentication.svc/REST/CheckPatientAuthentication';
const GET_MOBILE_INFO = '/Authentication.svc/REST/GetMobileLoginInfo';
'Services/Authentication.svc/REST/CheckPatientAuthentication';
const GET_MOBILE_INFO = 'Services/Authentication.svc/REST/GetMobileLoginInfo';
const SEND_ACTIVATION_CODE =
'/Authentication.svc/REST/SendActivationCodebyOTPNotificationType';
const CHECK_ACTIVATION_CODE = '/Authentication.svc/REST/CheckActivationCode';
'Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationType';
const CHECK_ACTIVATION_CODE =
'Services/Authentication.svc/REST/CheckActivationCode';
const CHECK_PATIENT_FOR_REGISTRATION =
"/Authentication.svc/REST/CheckPatientForRegisteration";
"Services/Authentication.svc/REST/CheckPatientForRegisteration";
const CHECK_USER_STATUS = "/NHIC.svc/REST/GetPatientInfo";
const REGISTER_USER = '/Authentication.svc/REST/PatientRegistration';
const CHECK_USER_STATUS = "Services/NHIC.svc/REST/GetPatientInfo";
const REGISTER_USER = 'Services/Authentication.svc/REST/PatientRegistration';
const LOGGED_IN_USER_URL =
'/MobileNotifications.svc/REST/Insert_PatientMobileDeviceInfo';
'Services/MobileNotifications.svc/REST/Insert_PatientMobileDeviceInfo';
class AuthProvider with ChangeNotifier {
bool isLogin = false;
@ -85,11 +87,11 @@ class AuthProvider with ChangeNotifier {
// }
// }
Future<dynamic> insertDeviceImei() async {
Future<dynamic> insertDeviceImei(lstLogin) async {
try {
dynamic localRes;
var lastLogin = await sharedPref.getInt(
LAST_LOGIN); //this.cs.sharedService.getStorage(AuthenticationService.LAST_LOGIN); //this.cs.sharedService.getSharedData(AuthenticationService.LAST_LOGIN, false);
var lastLogin = lstLogin; //await sharedPref.getInt(
// LAST_LOGIN); //this.cs.sharedService.getStorage(AuthenticationService.LAST_LOGIN); //this.cs.sharedService.getSharedData(AuthenticationService.LAST_LOGIN, false);
var request =
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));

@ -1,9 +1,14 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/family-file/add_family_file_request.dart';
import 'package:diplomaticquarterapp/core/model/family-file/insert_share_file_request.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:flutter/cupertino.dart';
// SharedPreferences sharedPref = new SharedPreferences();
@ -11,7 +16,23 @@ enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED }
AppSharedPreferences sharedPref = new AppSharedPreferences();
const String GET_SHARED_RECORD_BY_STATUS =
'/Authentication.svc/REST/GetAllSharedRecordsByStatus';
'Services/Authentication.svc/REST/GetAllSharedRecordsByStatus';
const String ADD_FAMILY_FILES =
'Services/Patients.svc/REST/ShareFamilyFileService';
const String SEND_FAMILY_FILE_ACTIVATION =
'Services/Authentication.svc/REST/SendActivationCodeForFamilyFile';
const String INSERT_PATIENT_FILE =
'Services/Authentication.svc/REST/Insert_SharePatientFile';
const String CHECK_ACTIVATION_CODE =
'Services/Authentication.svc/REST/CheckActivationCodeForFamilyFile';
const String UPDATE_FILE_STATUS =
'Services/Authentication.svc/REST/Update_FileStatus';
const String REMOVE_FILE_STATUS =
'Services/Authentication.svc/REST/ActiveDeactive_PatientFile';
const String ACTIVATION_CODE_URL =
"Services/Authentication.svc/REST/CheckActivationCode";
class FamilyFilesProvider with ChangeNotifier {
bool isLogin = false;
@ -27,8 +48,10 @@ class FamilyFilesProvider with ChangeNotifier {
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
AppToast.showErrorToast(message: error);
throw error;
}, body: request.toJson());
sharedPref.setObject(FAMILY_FILE, localRes);
return Future.value(
GetAllSharedRecordsByStatusResponse.fromJson(localRes));
} catch (error) {
@ -36,4 +59,179 @@ class FamilyFilesProvider with ChangeNotifier {
throw error;
}
}
Future<dynamic> addFamilyFile(AddFamilyFileReq request) async {
try {
dynamic localRes;
// var request = GetAllSharedRecordsByStatusReq();
//request.status = 0;
await new BaseAppClient().post(ADD_FAMILY_FILES,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
AppToast.showErrorToast(message: error);
throw error;
}, body: request.toJson());
//sharedPref.setObject(FAMILY_FILE, localRes);
return Future.value(localRes);
} catch (error) {
print(error);
return Future.value(error);
}
}
Future<dynamic> insertNewMember(InsertSharePatientFileReq request) async {
try {
dynamic localRes;
// var request = GetAllSharedRecordsByStatusReq();
//request.status = 0;
await new BaseAppClient().post(INSERT_PATIENT_FILE,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request.toJson());
return Future.value(localRes);
} catch (error) {
print(error);
throw error;
}
}
Future<dynamic> sendActivationCode(
cellNumber, zipCode, patientIdentificationID) async {
try {
dynamic localRes;
var request = SendActivationRequest();
request.zipCode = zipCode;
request.patientMobileNumber = int.parse(cellNumber);
request.patientIdentificationID = patientIdentificationID;
request.projectOutSA = zipCode == '966' ? 0 : 1;
request.loginType = request.searchType = 1;
request.oTPSendType = 1;
request.isRegister = false;
await new BaseAppClient().post(SEND_FAMILY_FILE_ACTIVATION,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
AppToast.showErrorToast(message: error);
throw error;
}, body: request.toJson());
return Future.value(localRes);
} catch (error) {
print(error);
throw error;
}
}
Future<dynamic> checkActivationCode(
loginTokenID, activationCode, indentification, mobileNo) async {
try {
dynamic localRes;
Map<String, dynamic> request = {};
// request['ZipCode'] = user.ZipCode;
request['PatientMobileNumber'] = mobileNo;
request['PatientIdentificationID'] = indentification;
request['LogInTokenID'] = loginTokenID;
request['activationCode'] = activationCode;
// this.authService.authenticateRequest(request);
await new BaseAppClient().post(CHECK_ACTIVATION_CODE,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
AppToast.showErrorToast(message: error);
throw error;
}, body: request);
return Future.value(localRes);
} catch (error) {
print(error);
throw error;
}
}
Future<dynamic> acceptAndRejectRecievedRequests(id, stauts) async {
try {
dynamic localRes;
Map<String, dynamic> request = {};
request['ID'] = id;
request['Status'] = stauts;
await new BaseAppClient().post(UPDATE_FILE_STATUS,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
AppToast.showErrorToast(message: error);
throw error;
}, body: request);
return Future.value(localRes);
} catch (error) {
print(error);
throw error;
}
}
Future<dynamic> deativateActivateMemberFile(request) async {
try {
dynamic localRes;
await new BaseAppClient().post(REMOVE_FILE_STATUS,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
AppToast.showErrorToast(message: error);
throw error;
}, body: request);
return Future.value(localRes);
} catch (error) {
print(error);
throw error;
}
}
Future<dynamic> silentLoggin(GetAllSharedRecordsByStatusList switchUser,
{onSuccess}) async {
//var currentUser = this.authService.getAuthenticatedUser();
var currentUser =
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
//const request = new SwitchUserRequest();
Map<String, dynamic> request = {};
request['LogInTokenID'] = '';
request['PatientOutSA'] = currentUser.outSA; //? 1 : 0;
request['PatientMobileNumber'] =
switchUser.mobileNumber; //['MobileNumber'];
request['SearchType'] = 2;
request['SuperUser'] = currentUser.patientID; //currentUser.PatientID;
request['PatientIdentificationID'] = '';
request['IsSilentLogin'] = true;
if (switchUser.mobileNumber != null &&
switchUser.patientID != currentUser.patientID) {
request['PatientID'] = switchUser.patientID; //['PatientID'];
} else {
request['PatientID'] = switchUser.responseID; //['ResponseID'];
}
request['ZipCode'] = currentUser.outSA == 1 ? "971" : "966";
request['activationCode'] = '0000';
request['isRegister'] = false;
try {
dynamic localRes;
await new BaseAppClient().post(ACTIVATION_CODE_URL,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
AppToast.showErrorToast(message: error);
throw error;
}, body: request);
return Future.value(localRes);
} catch (error) {
print(error);
throw error;
}
}
}

@ -0,0 +1,30 @@
import 'dart:async';
import 'package:flutter_tts/flutter_tts.dart';
class RobotProvider {
static final RobotProvider _singleton = RobotProvider._internal();
var value;
StreamController<Map> controller = StreamController<Map>.broadcast();
FlutterTts flutterTts = FlutterTts();
getData() {
// return data;
}
intStream() {
controller.add({});
}
setValue(Map data) {
value = data;
controller.add(value);
}
factory RobotProvider() {
return _singleton;
}
RobotProvider._internal();
speak(data) async {
await flutterTts.speak(data);
}
}

@ -0,0 +1,37 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:flutter/cupertino.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'dart:async';
import 'package:flutter/material.dart';
class SearchProvider with ChangeNotifier {
bool isLogin = false;
bool isLoading = true;
dynamic pageData = {};
Future<dynamic> getBotPages(request) async {
try {
await BaseAppClient().post(SEARCH_BOT,
onSuccess: (dynamic response, int statusCode) {
pageData = response;
// notifyListeners();
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(pageData);
} catch (error) {
print(error);
throw error;
}
}
setLisener(data) {
//SearchProvider.pageData = data;
//projectProvider.setSearchValue(pageData);
notifyListeners();
}
}

@ -110,7 +110,6 @@ class TranslationBase {
String get time => localizedValues['time'][locale.languageCode];
String get login => localizedValues['login'][locale.languageCode];
String get loginregister =>
@ -130,6 +129,8 @@ class TranslationBase {
String get logintypeRadio =>
localizedValues['logintyperadio'][locale.languageCode];
String get registerInfoFamily =>
localizedValues['register-info-family'][locale.languageCode];
String get registerNow => localizedValues['registernow'][locale.languageCode];
@ -222,29 +223,21 @@ class TranslationBase {
String get upcomingDetails =>
localizedValues['upcoming-details'][locale.languageCode];
String get reschedule =>
localizedValues['reschedule'][locale.languageCode];
String get reschedule => localizedValues['reschedule'][locale.languageCode];
String get raise =>
localizedValues['raise'][locale.languageCode];
String get raise => localizedValues['raise'][locale.languageCode];
String get complaint =>
localizedValues['complaint'][locale.languageCode];
String get complaint => localizedValues['complaint'][locale.languageCode];
String get add =>
localizedValues['add'][locale.languageCode];
String get add => localizedValues['add'][locale.languageCode];
String get reminder =>
localizedValues['reminder'][locale.languageCode];
String get reminder => localizedValues['reminder'][locale.languageCode];
String get location =>
localizedValues['location'][locale.languageCode];
String get location => localizedValues['location'][locale.languageCode];
String get online =>
localizedValues['online'][locale.languageCode];
String get online => localizedValues['online'][locale.languageCode];
String get payment =>
localizedValues['payment'][locale.languageCode];
String get payment => localizedValues['payment'][locale.languageCode];
String get cancel_nocaps =>
localizedValues['cancel-nocaps'][locale.languageCode];
@ -280,15 +273,21 @@ class TranslationBase {
String get appsetting => localizedValues['app-settings'][locale.languageCode];
String get rateApp => localizedValues['rate-app'][locale.languageCode];
String get setReminder => localizedValues['set-reminder'][locale.languageCode];
String get setReminder =>
localizedValues['set-reminder'][locale.languageCode];
String get before => localizedValues['before'][locale.languageCode];
String get minute => localizedValues['minute'][locale.languageCode];
String get hour => localizedValues['hour'][locale.languageCode];
String get reminderSuccess => localizedValues['reminderSuccess'][locale.languageCode];
String get patientShareToDo => localizedValues['patientShareToDo'][locale.languageCode];
String get patientTaxToDo => localizedValues['patientTaxToDo'][locale.languageCode];
String get patientShareTotalToDo => localizedValues['patientShareTotalToDo'][locale.languageCode];
String get paymentMethod => localizedValues['paymentMethod'][locale.languageCode];
String get reminderSuccess =>
localizedValues['reminderSuccess'][locale.languageCode];
String get patientShareToDo =>
localizedValues['patientShareToDo'][locale.languageCode];
String get patientTaxToDo =>
localizedValues['patientTaxToDo'][locale.languageCode];
String get patientShareTotalToDo =>
localizedValues['patientShareTotalToDo'][locale.languageCode];
String get paymentMethod =>
localizedValues['paymentMethod'][locale.languageCode];
String get moreVerification =>
localizedValues['more-verify'][locale.languageCode];
@ -304,22 +303,32 @@ class TranslationBase {
String get next => localizedValues['next'][locale.languageCode];
String get noNeedToWaitInLine => localizedValues['noNeedToWaitInLine'][locale.languageCode];
String get useQRAppoAttend => localizedValues['useQRAppoAttend'][locale.languageCode];
String get passQRAppoAttend => localizedValues['passQRAppoAttend'][locale.languageCode];
String get sitWaitingQR => localizedValues['sitWaitingQR'][locale.languageCode];
String get attendRegisterCode => localizedValues['attendRegisterCode'][locale.languageCode];
String get scanQRHospital => localizedValues['scanQRHospital'][locale.languageCode];
String get noNeedToWaitInLine =>
localizedValues['noNeedToWaitInLine'][locale.languageCode];
String get useQRAppoAttend =>
localizedValues['useQRAppoAttend'][locale.languageCode];
String get passQRAppoAttend =>
localizedValues['passQRAppoAttend'][locale.languageCode];
String get sitWaitingQR =>
localizedValues['sitWaitingQR'][locale.languageCode];
String get attendRegisterCode =>
localizedValues['attendRegisterCode'][locale.languageCode];
String get scanQRHospital =>
localizedValues['scanQRHospital'][locale.languageCode];
String get sendEmail => localizedValues['sendEmail'][locale.languageCode];
String get close => localizedValues['close'][locale.languageCode];
String get booked => localizedValues['booked'][locale.languageCode];
String get confirmed => localizedValues['confirmed'][locale.languageCode];
String get arrived => localizedValues['arrived'][locale.languageCode];
String get payNowBookSuccess => localizedValues['payNowBookSuccess'][locale.languageCode];
String get payNowBookSuccesstext1 => localizedValues['payNowBookSuccesstext1'][locale.languageCode];
String get payNowBookSuccesstext2 => localizedValues['payNowBookSuccesstext2'][locale.languageCode];
String get payNowBookSuccess =>
localizedValues['payNowBookSuccess'][locale.languageCode];
String get payNowBookSuccesstext1 =>
localizedValues['payNowBookSuccesstext1'][locale.languageCode];
String get payNowBookSuccesstext2 =>
localizedValues['payNowBookSuccesstext2'][locale.languageCode];
String get payLater => localizedValues['payLater'][locale.languageCode];
String get askDocNotAllowed => localizedValues['askDocNotAllowed'][locale.languageCode];
String get askDocNotAllowed =>
localizedValues['askDocNotAllowed'][locale.languageCode];
String get firstName => localizedValues['first-name'][locale.languageCode];
String get middleName => localizedValues['middle-name'][locale.languageCode];
@ -352,12 +361,12 @@ class TranslationBase {
localizedValues['family-title'][locale.languageCode];
String get oxygenation => localizedValues['oxygenation'][locale.languageCode];
String get respirationRate => localizedValues['respirationRate'][locale.languageCode];
String get respirationRate =>
localizedValues['respirationRate'][locale.languageCode];
String get bodyMeasurements =>
localizedValues ['bodyMeasurements'][locale.languageCode];
String get height =>
localizedValues ['height'][locale.languageCode];
localizedValues['bodyMeasurements'][locale.languageCode];
String get height => localizedValues['height'][locale.languageCode];
String get temperature => localizedValues['temperature'][locale.languageCode];
@ -402,30 +411,44 @@ class TranslationBase {
String get seeDetails => localizedValues['seeDetails'][locale.languageCode];
String get insuranceCards =>
localizedValues['insuranceCards'][locale.languageCode];
String get requestType =>
localizedValues['requestType'][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 requestType => localizedValues['requestType'][locale.languageCode];
String get addFamilyMember =>
localizedValues['add-new-member'][locale.languageCode];
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 consultation =>
localizedValues['consultation'][locale.languageCode];
String get logs =>
localizedValues['logs'][locale.languageCode];
String get logs => localizedValues['logs'][locale.languageCode];
String get textToSpeech =>
localizedValues['textToSpeech'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -1,4 +1,5 @@
import 'package:connectivity/connectivity.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -8,6 +9,7 @@ import 'app_toast.dart';
AppSharedPreferences sharedPref = new AppSharedPreferences();
class Utils {
// static ProgressDialog pr;
///show custom Error Toast
/// [message] to show for user
@ -106,4 +108,34 @@ class Utils {
var length = loginType == 1 ? 10 : 7;
return "([0-9]{" + length.toString() + "})";
}
static showProgressDialog(context, [String message = "Loading..."]) async {
// pr = ProgressDialog(context,
// type: ProgressDialogType.Normal, isDismissible: false, showLogs: false);
// pr.style(
// message: message,
// borderRadius: 10.0,
// backgroundColor: Colors.white,
// elevation: 10.0,
// insetAnimCurve: Curves.easeInOut,
// progress: 0.0,
// maxProgress: 100.0,
// progressTextStyle: TextStyle(
// color: Colors.black, fontSize: 13.0, fontWeight: FontWeight.w400),
// messageTextStyle: TextStyle(
// color: Colors.black, fontSize: 19.0, fontWeight: FontWeight.w600));
// if (!pr.isShowing()) {
// await pr.show();
// } else {
// await pr.hide();
// await pr.show();
// }
}
static hideProgressDialog() async {
// if (pr.isShowing()) {
// await pr.hide();
// }
}
}

@ -1,15 +1,19 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/routes.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/data_display/list/flexible_container.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../config/size_config.dart';
import 'drawer_item_widget.dart';
@ -26,11 +30,14 @@ class _AppDrawerState extends State<AppDrawer> {
checkUserData();
}
ProjectViewModel projectProvider;
var sharedPref = new AppSharedPreferences();
var familyFileProvider = FamilyFilesProvider();
AuthenticatedUser user;
@override
Widget build(BuildContext context) {
projectProvider = Provider.of(context);
return SizedBox(
width: MediaQuery.of(context).size.width * 0.75,
child: Container(
@ -120,9 +127,14 @@ class _AppDrawerState extends State<AppDrawer> {
TranslationBase.of(context).arabicChange,
Icons.translate),
onTap: () {
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
// Navigator.of(context).pushNamed(
// WELCOME_LOGIN,
// );
if (projectProvider.isArabic) {
projectProvider.changeLanguage('en');
} else {
projectProvider.changeLanguage('ar');
}
},
),
user != null
@ -184,30 +196,33 @@ class _AppDrawerState extends State<AppDrawer> {
.only(
bottom:
5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: <
Widget>[
Expanded(
child: Icon(
Icons
.person),
),
Expanded(
flex: 7,
child: Column(
crossAxisAlignment: CrossAxisAlignment
.start,
children: <
Widget>[
Text(result.patientName),
Text('File No:' +
result.iD.toString()),
])),
],
))
child: InkWell(
onTap: () {
switchUser(
result,
context);
},
child: Row(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: <
Widget>[
Expanded(
child: Icon(
Icons.person),
),
Expanded(
flex:
7,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(result.patientName),
Text('File No:' + result.iD.toString()),
])),
],
)))
: SizedBox();
}).toList()));
}
@ -336,7 +351,34 @@ class _AppDrawerState extends State<AppDrawer> {
}
}
Future<GetAllSharedRecordsByStatusResponse> getFamilyFiles() {
return familyFileProvider.getSharedRecordByStatus();
Future<GetAllSharedRecordsByStatusResponse> getFamilyFiles() async {
if (await sharedPref.getObject(FAMILY_FILE) != null) {
// print(await sharedPref.getObject(FAMILY_FILE));
return Future.value(GetAllSharedRecordsByStatusResponse.fromJson(
await sharedPref.getObject(FAMILY_FILE)));
} else {
return familyFileProvider.getSharedRecordByStatus();
}
}
switchUser(user, context) {
Utils.showProgressDialog(context);
this
.familyFileProvider
.silentLoggin(user)
.then((value) => loginAfter(value, context));
}
loginAfter(result, context) {
Utils.hideProgressDialog();
result = CheckActivationCode.fromJson(result);
this.sharedPref.clear();
this.sharedPref.setObject(USER_PROFILE, result.list);
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);
this.sharedPref.setString(TOKEN, result.authenticationTokenID);
//this.checkIfUserAgreedBefore(result),
Navigator.of(context).pushNamed(
HOME,
);
}
}

@ -1,9 +1,13 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart';
import 'package:diplomaticquarterapp/widgets/robo-search/robosearch.dart';
import 'package:diplomaticquarterapp/widgets/robo-search/search.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'floating_button_search.dart';
import '../progress_indicator/app_loader_widget.dart';
import 'arrow_back.dart';
import 'network_base_view.dart';
@ -29,42 +33,45 @@ class AppScaffold extends StatelessWidget {
@override
Widget build(BuildContext context) {
AppGlobal.context = context;
return Scaffold(
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
appBar: isShowAppBar
? AppBar(
elevation: 0,
backgroundColor: Theme.of(context).appBarTheme.color,
textTheme: TextTheme(
headline6:
TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
),
title: Text(appBarTitle.toUpperCase()),
leading: Builder(
builder: (BuildContext context) {
return ArrowBack();
},
),
centerTitle: true,
actions: <Widget>[
IconButton(
icon: Icon(FontAwesomeIcons.home),
color: Colors.white,
onPressed: () {
// TODO add navigator to home page
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
appBar: isShowAppBar
? AppBar(
elevation: 0,
backgroundColor: Theme.of(context).appBarTheme.color,
textTheme: TextTheme(
headline6: TextStyle(
color: Colors.white, fontWeight: FontWeight.bold),
),
title: Text(appBarTitle.toUpperCase()),
leading: Builder(
builder: (BuildContext context) {
return ArrowBack();
},
),
],
)
: null,
body: baseViewModel != null
? NetworkBaseView(
child: buildBodyWidget(),
baseViewModel: baseViewModel,
)
: buildBodyWidget(),
bottomSheet: bottomSheet,
);
centerTitle: true,
actions: <Widget>[
IconButton(
icon: Icon(FontAwesomeIcons.home),
color: Colors.white,
onPressed: () {
Navigator.of(context).popUntil(ModalRoute.withName('/'));
},
),
],
)
: null,
body: baseViewModel != null
? NetworkBaseView(
child: buildBodyWidget(),
baseViewModel: baseViewModel,
)
: buildBodyWidget(),
bottomSheet: bottomSheet,
bottomNavigationBar: BottomBarSearch()
//floatingActionButton: FloatingSearchButton(),
);
}
buildAppLoaderWidget(bool isLoading) {

@ -0,0 +1,372 @@
import 'dart:convert';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/DoctorProfile.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart';
import 'package:diplomaticquarterapp/pages/medical/my_admissions_page.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_tts/flutter_tts.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_recognition_result.dart';
import 'package:speech_to_text/speech_to_text.dart';
import 'package:diplomaticquarterapp/widgets/robo-search/robosearch.dart';
import 'dart:math';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class BottomBarSearch extends StatefulWidget {
@override
_SearchBot createState() => _SearchBot();
}
class _SearchBot extends State<BottomBarSearch> {
SearchProvider searchProvider = new SearchProvider();
RobotProvider eventProvider = RobotProvider();
bool isLoading = false;
bool isError = false;
final SpeechToText speech = SpeechToText();
String error = '';
String _currentLocaleId = "";
String lastError;
double level = 0.0;
double minSoundLevel = 50000;
double maxSoundLevel = -50000;
String reconizedWord = '';
FlutterTts flutterTts = FlutterTts();
var selectedLang;
bool isSearching = false;
Map results = {};
String lastStatus;
bool _isInit = true;
TextEditingController searchController = TextEditingController();
@override
void initState() {
requestPermissions();
super.initState();
}
@override
Widget build(BuildContext context) {
return BottomAppBar(
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Expanded(
child: SizedBox(
height: 64,
child: Material(
type: MaterialType.transparency,
child: TextField(
keyboardType: TextInputType.multiline,
maxLines: null,
controller: searchController,
decoration: InputDecoration(
hintText: TranslationBase.of(context).textToSpeech,
suffixIcon: IconButton(
icon: Icon(Icons.mic),
onPressed: () async {
setState(() {
searchController.text = '';
});
// await flutterTts.speak("Hello!");
//Future.delayed(const Duration(seconds: 1), () {
initSpeechState()
.then((value) => startVoiceSearch());
//});
},
)),
),
),
),
),
]),
);
}
startVoiceSearch() async {
speech.listen(
onResult: resultListener,
listenFor: Duration(seconds: 10),
localeId: _currentLocaleId,
onSoundLevelChange: soundLevelListener,
cancelOnError: true,
partialResults: true,
onDevice: true,
listenMode: ListenMode.confirmation);
}
void resultListener(SpeechRecognitionResult result) {
// lastWords = "${result.recognizedWords} - ${result.finalResult}";
if (result.finalResult == true) {
// setState(() {
reconizedWord = result.recognizedWords;
//});
setState(() {
searchController.text = reconizedWord;
});
Future.delayed(const Duration(seconds: 1), () {
_speak(reconizedWord);
});
}
//});
}
Future _speak(reconizedWord) async {
await flutterTts.speak(reconizedWord);
getPages(reconizedWord);
}
void soundLevelListener(double level) {
minSoundLevel = min(minSoundLevel, level);
maxSoundLevel = max(maxSoundLevel, level);
// print("sound level $level: $minSoundLevel - $maxSoundLevel ");
//setState(() {
this.level = level;
// });
}
void requestPermissions() async {
Map<Permission, PermissionStatus> statuses = await [
Permission.microphone,
].request();
}
Future<void> initSpeechState() async {
await speech.initialize(onError: errorListener, onStatus: statusListener);
_currentLocaleId =
TranslationBase.of(AppGlobal.context).locale.languageCode == 'en'
? 'en-GB'
: 'ar-SA'; // systemLocale.localeId;
flutterTts.setLanguage(_currentLocaleId);
// if (!mounted) return;
}
void errorListener(SpeechRecognitionError error) {
//setState(() {
// reconizedWord = "${error.errorMsg} - ${error.permanent}";
//});
}
void statusListener(String status) {
//setState(() {
reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....';
//});
}
getPages(text) {
var request = {
'VoiceMessage': text,
'Lang': TranslationBase.of(AppGlobal.context).locale.languageCode == 'en'
? 'En'
: 'Ar'
};
searchProvider
.getBotPages(request)
.then((value) => {getCommands(value['Understand'])});
//getDoctorsList(12, 17, 40036, context);
}
getCommands(result) async {
//RoboSearch.closeAlertDialog(context);
print(result);
results = result;
//getDoctorsList(12, 17, 40036, context);
switch (result["CommandNumber"]) {
case 100:
if (result['ProjectId'] != 0 &&
result['ClinicId'] != 0 &&
result['DoctorId'] != 0) {
getDoctorsList(
result['ProjectId'],
result['ClinicId'],
context,
doctorId: result['DoctorId'],
doctorName: result['DoctorName'],
);
} else if (result['ProjectId'] != 0 &&
result['ClinicId'] != 0 &&
result['DoctorId'] == 0) {
getDoctorsList(
result['ProjectId'],
result['ClinicId'],
context,
);
} else if (result['ProjectId'] == 0 &&
result['ClinicId'] != 0 &&
result['DoctorId'] == 0) {
getDoctorsList(
result['ProjectId'],
result['ClinicId'],
context,
);
} else if (result['ProjectId'] == 0 &&
result['ClinicId'] != 0 &&
result['DoctorId'] != 0) {
getDoctorsList(
result['ProjectId'],
result['ClinicId'],
context,
doctorId: result['DoctorId'],
doctorName: result['DoctorName'],
);
} else {
Navigator.push(
AppGlobal.context,
MaterialPageRoute(
builder: (context) => Search(
type: 0,
)));
}
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();
break;
}
//searchProvider.setLisener(result);
}
getDoctorProfile(projectId, clinicId, doctorId, context, doctorData) {
List<DoctorProfileList> docProfileList = [];
DoctorsListService service = new DoctorsListService();
service
.getDoctorsProfile(doctorId, clinicId, projectId, context)
.then((res) {
if (res['MessageStatus'] == 1) {
if (res['DoctorProfileList'].length != 0) {
res['DoctorProfileList'].forEach((v) {
docProfileList.add(new DoctorProfileList.fromJson(v));
});
}
navigateToDoctorProfile(context, doctorData[0], docProfileList[0],
isAppo: true);
//speak();
}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
getDoctorsList(projectId, clinicId, context, {doctorId, doctorName}) {
List<DoctorList> doctorsList = [];
DoctorsListService service = new DoctorsListService();
service
.getDoctorsList(clinicId, projectId, context, doctorId: doctorName)
.then((res) {
if (res['MessageStatus'] == 1) {
setState(() {
if (res['DoctorList'].length != 0) {
doctorsList.clear();
res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
});
if (res['DoctorList'].length == 1 && doctorId != null) {
getDoctorProfile(
projectId, clinicId, doctorId, context, doctorsList);
//speak();
} else {
navigateToSearchResults(context, doctorsList);
}
}
});
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
Future navigateToDoctorProfile(context, docObject, docProfile,
{isAppo}) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => DoctorProfile(
doctor: docObject,
docProfileList: docProfile,
isOpenAppt: isAppo,
)));
}
Future navigateToSearchResults(context, docList) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SearchResults(doctorsList: docList)));
}
speak() async {
if (_currentLocaleId == 'en-GB' && results['ReturnMessage'] != null) {
await flutterTts.speak(results['ReturnMessage']);
} else if (results['ReturnMessage_Ar'] != null) {
await flutterTts.speak(results['ReturnMessage_Ar']);
}
// Future.delayed(const Duration(seconds: 10), () {
// initSpeechState().then((value) => startVoiceSearch());
// });
}
}

@ -0,0 +1,22 @@
import 'package:diplomaticquarterapp/widgets/robo-search/robosearch.dart';
import 'package:diplomaticquarterapp/widgets/robo-search/search.dart';
import 'package:flutter/material.dart';
class FloatingSearchButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(bottom: 80),
child: FloatingActionButton(
child: Icon(Icons.mic),
onPressed: () {
SearchBot();
},
));
}
roboSearch(context) {
var dialog = RoboSearch(context: context);
dialog.showAlertDialog(context);
}
}

@ -307,4 +307,8 @@ class SMSOTP {
);
});
}
static void hideSMSBox(context) {
Navigator.pop(context);
}
}

@ -0,0 +1,42 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/robo-search/search.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class RoboSearch {
final BuildContext context;
RoboSearch({
@required this.context,
});
showAlertDialog(BuildContext context) {
// set up the buttons
// set up the AlertDialog
AlertDialog alert = AlertDialog(
title: Center(child: Text(TranslationBase.of(context).search)),
content: StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
return Container(
color: Colors.white,
height: SizeConfig.realScreenHeight * 0.5,
width: SizeConfig.realScreenWidth * 0.8,
child: Container());
}),
);
// show the dialog
showDialog(
context: context,
builder: (BuildContext context) {
return alert;
},
);
}
static closeAlertDialog(BuildContext context) {
Navigator.of(context).pop();
}
}

@ -0,0 +1,233 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart';
import 'package:diplomaticquarterapp/pages/medical/my_admissions_page.dart';
import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_tts/flutter_tts.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_recognition_result.dart';
import 'package:speech_to_text/speech_to_text.dart';
import 'package:diplomaticquarterapp/widgets/robo-search/robosearch.dart';
import 'dart:math';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
class SearchBot with ChangeNotifier {
SearchBot() {
requestPermissions();
initSpeechState();
}
SearchProvider searchProvider = new SearchProvider();
RobotProvider eventProvider = RobotProvider();
bool isLoading = false;
bool isError = false;
final SpeechToText speech = SpeechToText();
String error = '';
String _currentLocaleId = "";
String lastError;
double level = 0.0;
double minSoundLevel = 50000;
double maxSoundLevel = -50000;
String reconizedWord = '';
FlutterTts flutterTts = FlutterTts();
var selectedLang;
bool isSearching = false;
String lastStatus;
bool _isInit = true;
// @override
// void didChangeDependencies() {
// super.didChangeDependencies();
// if (_isInit) {
// } else {
// startVoiceSearch();
// }
// _isInit = false;
// }
//@override
// Widget build(BuildContext context) {
// return Column(
// children: <Widget>[
// Image.asset('assets/images/siri-ianzhao.gif'),
// AppText(
// reconizedWord,
// fontSize: 28,
// ),
// // SizedBox(
// // child: FlatButton(
// // child: Text('Start'),
// // onPressed: () {
// // setState(() {
// // reconizedWord = 'Lisening...';
// // });
// // },
// // ),
// // height: 40,
// // width: 80)
// ],
// );
// }
startVoiceSearch() async {
speech.listen(
onResult: resultListener,
listenFor: Duration(seconds: 10),
localeId: _currentLocaleId,
onSoundLevelChange: soundLevelListener,
cancelOnError: true,
partialResults: true,
onDevice: true,
listenMode: ListenMode.confirmation);
}
void resultListener(SpeechRecognitionResult result) {
// lastWords = "${result.recognizedWords} - ${result.finalResult}";
if (result.finalResult == true) {
// setState(() {
reconizedWord = result.recognizedWords;
//});
Future.delayed(const Duration(seconds: 1), () {
_speak(reconizedWord);
});
}
//});
}
Future _speak(reconizedWord) async {
await flutterTts.speak(reconizedWord);
getPages(reconizedWord);
}
void soundLevelListener(double level) {
minSoundLevel = min(minSoundLevel, level);
maxSoundLevel = max(maxSoundLevel, level);
// print("sound level $level: $minSoundLevel - $maxSoundLevel ");
//setState(() {
this.level = level;
// });
}
void requestPermissions() async {
Map<Permission, PermissionStatus> statuses = await [
Permission.microphone,
].request();
}
Future<void> initSpeechState() async {
await speech.initialize(onError: errorListener, onStatus: statusListener);
_currentLocaleId =
TranslationBase.of(AppGlobal.context).locale.languageCode == 'en'
? 'en-GB'
: 'ar-SA'; // systemLocale.localeId;
flutterTts.setLanguage(_currentLocaleId);
await flutterTts.speak("Hello! How May I help you?");
flutterTts.setCompletionHandler(() {
startVoiceSearch();
});
// if (!mounted) return;
}
void errorListener(SpeechRecognitionError error) {
//setState(() {
// reconizedWord = "${error.errorMsg} - ${error.permanent}";
//});
}
void statusListener(String status) {
//setState(() {
reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....';
//});
}
getPages(text) {
var request = {
'VoiceMessage': text,
'Lang': TranslationBase.of(AppGlobal.context).locale.languageCode == 'en'
? 'En'
: 'Ar'
};
searchProvider.getBotPages(request).then((value) => {});
//getCommands(value['Response'], value['Understand'])
}
getCommands(result, understand) async {
//RoboSearch.closeAlertDialog(context);
print(result);
switch (result["CommandNumber"]) {
case '100':
Navigator.push(
AppGlobal.context,
FadePage(
page: BookingOptions(
isAppbar: true,
)));
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:
{
eventProvider.setValue({"doctor_id": '40036'});
//eventProvider.setValue();
// if (result['CommandNumber'] == '0') {
// searchProvider.setData(understand);
// }
}
break;
}
if (_currentLocaleId == 'en-GB') {
await flutterTts.speak(result['ResponseEn']);
} else {
await flutterTts.speak(result['ResponseAr']);
}
//searchProvider.setLisener(result);
}
}

@ -5,12 +5,13 @@ description: A new Flutter application.
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
sdk: ">=2.2.2 <3.0.0"
dependencies:
flutter:
sdk: flutter
# Localizations
flutter_localizations:
sdk: flutter
@ -67,7 +68,7 @@ dependencies:
charts_flutter: ^0.9.0
# Qr code Scanner
barcode_scan: ^3.0.1
barcode_scan: any
# Rating Stars
rating_bar: ^0.2.0
@ -105,6 +106,10 @@ dependencies:
wakelock: ^0.1.4
after_layout: ^1.0.7
twilio_programmable_video: ^0.5.0+3
flutter_tts: ^1.2.6
speech_to_text:
path: speech_to_text
dev_dependencies:
flutter_test:

@ -0,0 +1,19 @@
name: build
on:
push:
branches:
- master
jobs:
test:
name: Test on Ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: subosito/flutter-action@v1.3.2
with:
flutter-version: '1.17.1'
channel: 'stable'
- run: flutter pub get
- run: flutter test

@ -0,0 +1,11 @@
.DS_Store
.dart_tool/
.packages
.pub/
build/
coverage/
example/.flutter-plugins-dependencies
**/ios/Flutter/flutter_export_environment.sh
android/.idea/

@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: 2d2a1ffec95cc70a3218872a2cd3f8de4933c42f
channel: stable
project_type: plugin

@ -0,0 +1,166 @@
# Changelog
## 2.3.0
### New
* new parameter `onDevice` on the `listen` method enforces on device recognition for sensitive content
* onSoundLevelChange now supported on iOS
* added compile troubleshooting help to README.md
* `SpeechToTextProvider` is an alternate and simpler way to interact with the `SpeechToText` plugin.
* new `provider_example.dart` example for usage of `SpeechToTextProvider`.
### Fix
* on iOS handles some conflicts with other applications better to keep speech working after calls for example
## 2.2.0
### New
* improved error handling and logging in the iOS implementation
* added general guides for iOS to the README
* moved stress testing out of the main example
* iOS now defaults to using the speaker rather than the receiver for start /stop sounds when no headphones
### Fix
* iOS now properly deactivates the audio session when no longer listening
* start and stop sounds on iOS should be more reliable when available
## 2.1.0
### Breaking
* `listenFor` now calls `stop` rather than `cancel` as this seems like more useful behaviour
### Fix
* Android no longer stops or cancels the speech recognizer if it has already been shutdown by a
timeout or other platform behaviour.
* Android no longer tries to restart the listener when it is already active
* Now properly notifies errors that happen after listening stops due to platform callback rather than
client request. See https://github.com/csdcorp/speech_to_text/issues/51
## 2.0.1
### Fix
* Resolves an issue with the Android implementation not handling permission requests properly on apps
that didn't use the 1.12.x plugin APIs for registration. The permission dialog would not appear and
permission was denied.
## 2.0.0
### Breaking
* Upgraded to New Swift 1.12 plugin structure, may work with older Flutter version but not guaranteed
### New
* the plugin now requests both speech and microphone permission on initialize on iOS
* added `debugLogging` parameter to the `initialize` method to control native logging
### Fix
* The Android implementation now blocks duplicate results notifications. It appears that at least on some
Android versions the final results notification onResults is notified twice when Android automatically
terminates the session due to a pause time. The de-duplication looks for successive notifications
with < 100 ms between them and blocks the second. If you miss any onResult notifications please post
an issue.
## 1.1.0
### New
* error_timeout has been separated into error_network_timeout and error_speech_timeout
## 1.0.0
### New
* hasPermission to check for the current permission without bringing up the system dialog
* `listen` has a new optional `cancelOnError` parameter to support automatically canceling
a listening session on a permanent error.
* `listen` has a new optional `partialResults` parameter that controls whether the callback
receives partial or only final results.
## 0.8.0
### New
* speech recognizer now exposes multiple possible transcriptions for each recognized speech
* alternates list on SpeechRecognitionResult exposes alternate transcriptions of voice
* confidence on SpeechRecognitionResult gives an estimate of confidence in the transcription
* isConfident on SpeechRecognitionResult supports testing confidence
* hasConfidenceRating on SpeechRecognitionResult indicates if confidence was provided from the device
* new SpeechRecognitionWords class gives details on per transcription words and confidence
### Fix
* speechRecognizer availabilityDidChange was crashing if invoked due to an invalid parameter type
* Added iOS platform 10 to example Podfile to resolve compilation warnings
## 0.7.2
### Breaking
* Upgrade Swift to version 5 to match Flutter. Projects using this plugin must now switch to 5.
## 0.7.1
### Fix
* Upgrade Kotlin to 1.3.5 to match the Flutter 1.12 version
* Upgrade Gradle build to 3.5.0 to match the Flutter 1.12 version
* Android version of the plugin was repeating the system default locale in the `locales` list
## 0.7.0
### New
* locales method returns the list of available languages for speech
* new optional localeId parameter on listen method supports choosing the comprehension language separately from the current system locale.
### Breaking
* `cancel` and `stop` are now async
## 0.6.3
### Fix
* request permission fix on Android to ensure it doesn't conflict with other requests
## 0.6.2
### Fix
* channel invoke wasn't being done on the main thread in iOS
## 0.6.1
### Fix
* listening sound was failing due to timing, now uses play and record mode on iOS.
## 0.6.0
### Breaking
* The filenames for the optional sounds for iOS have changed.
### New
* Added an optional listenFor parameter to set a max duration to listen for speech and then automatically cancel.
### Fix
* Was failing to play sounds because of record mode. Now plays sounds before going into record mode and after coming out.
* Status listener was being ignored, now properly notifies on status changes.
## 0.5.1
* Fixes a problem where the recognizer left the AVAudioSession in record mode which meant that subsequent sounds couldn't be played.
## 0.5.0
Initial draft with limited functionality, supports:
* initializing speech recognition
* asking the user for permission if required
* listening for recognized speech
* canceling the current recognition session
* stopping the current recognition session
* Android and iOS 10+ support
Missing:
* some error handling
* testing across multiple OS versions
* and more, to be discovered...

@ -0,0 +1,29 @@
BSD 3-Clause License
Copyright (c) 2019, Corner Software Development Corp.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

@ -0,0 +1,150 @@
# speech_to_text
[![pub package](https://img.shields.io/badge/pub-v2.3.0-blue)](https://pub.dartlang.org/packages/speech_to_text) [![build status](https://github.com/csdcorp/speech_to_text/workflows/build/badge.svg)](https://github.com/csdcorp/speech_to_text/actions?query=workflow%3Abuild)
A library that exposes device specific speech recognition capability.
This plugin contains a set of classes that make it easy to use the speech recognition
capabilities of the mobile device in Flutter. It supports both Android and iOS. The
target use cases for this library are commands and short phrases, not continuous spoken
conversion or always on listening.
## Recent Updates
The 2.3.0 version adds `SpeechToTextProvider` as a simpler way to interact with the plugin. Checkout
the new `provider_example.dart` for intended usage.
The 2.2.0 version improves audio session handling and start / stop sound playback on iOS.
*Note*: Feedback from any test devices is welcome.
## Using
To recognize text from the microphone import the package and call the plugin, like so:
```dart
import 'package:speech_to_text/speech_to_text.dart' as stt;
stt.SpeechToText speech = stt.SpeechToText();
bool available = await speech.initialize( onStatus: statusListener, onError: errorListener );
if ( available ) {
speech.listen( onResult: resultListener );
}
else {
print("The user has denied the use of speech recognition.");
}
// some time later...
speech.stop()
```
### Initialize once
The `initialize` method only needs to be called once per application session. After that `listen`,
`start`, `stop`, and `cancel` can be used to interact with the plugin. Subsequent calls to `initialize`
are ignored which is safe but does mean that the `onStatus` and `onError` callbacks cannot be reset after
the first call to `initialize`. For that reason there should be only one instance of the plugin per
application. The `SpeechToTextProvider` is one way to create a single instance and easily reuse it in
multiple widgets.
## Permissions
Applications using this plugin require user permissions.
### iOS
Add the following keys to your _Info.plist_ file, located in `<project root>/ios/Runner/Info.plist`:
* `NSSpeechRecognitionUsageDescription` - describe why your app uses speech recognition. This is called _Privacy - Speech Recognition Usage Description_ in the visual editor.
* `NSMicrophoneUsageDescription` - describe why your app needs access to the microphone. This is called _Privacy - Microphone Usage Description_ in the visual editor.
### Android
Add the record audio permission to your _AndroidManifest.xml_ file, located in `<project root>/android/app/src/main/AndroidManifest.xml`.
* `android.permission.RECORD_AUDIO` - this permission is required for microphone access.
* `android.permission.INTERNET` - this permission is required because speech recognition may use remote services.
## Adding Sounds for iOS (optional)
Android automatically plays system sounds when speech listening starts or stops but iOS does not. This plugin supports playing sounds to indicate listening status on iOS if sound files are available as assets in the application. To enable sounds in an application using this plugin add the sound files to the project and reference them in the assets section of the application `pubspec.yaml`. The location and filenames of the sound files must exactly match what
is shown below or they will not be found. The example application for the plugin shows the usage. *Note* These files should be very short as they delay
the start / end of the speech recognizer until the sound playback is complete.
```yaml
assets:
- assets/sounds/speech_to_text_listening.m4r
- assets/sounds/speech_to_text_cancel.m4r
- assets/sounds/speech_to_text_stop.m4r
```
* `speech_to_text_listening.m4r` - played when the listen method is called.
* `speech_to_text_cancel.m4r` - played when the cancel method is called.
* `speech_to_text_stop.m4r` - played when the stop method is called.
## Troubleshooting
### SDK version error trying to compile for Android
```
Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library [:speech_to_text]
```
The speech_to_text plugin requires at least Android SDK 21 because some of the speech functions in Android
were only introduced in that version. To fix this error you need to change the `build.gradle` entry to reflect
this version. Here's what the relevant part of that file looked like as of this writing:
```
defaultConfig {
applicationId "com.example.app"
minSdkVersion 21
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
```
### Incorrect Swift version trying to compile for iOS
```
/Users/markvandergon/flutter/.pub-cache/hosted/pub.dartlang.org/speech_to_text-1.1.0/ios/Classes/SwiftSpeechToTextPlugin.swift:224:44: error: value of type 'SwiftSpeechToTextPlugin' has no member 'AVAudioSession'
rememberedAudioCategory = self.AVAudioSession.Category
~~~~ ^~~~~~~~~~~~~~
/Users/markvandergon/flutter/.pub-cache/hosted/pub.dartlang.org/speech_to_text-1.1.0/ios/Classes/SwiftSpeechToTextPlugin.swift:227:63: error: type 'Int' has no member 'notifyOthersOnDeactivation'
try self.audioSession.setActive(true, withFlags: .notifyOthersOnDeactivation)
```
This happens when the Swift language version is not set correctly. See this thread for help https://github.com/csdcorp/speech_to_text/issues/45.
### Swift not supported trying to compile for iOS
```
`speech_to_text` does not specify a Swift version and none of the targets (`Runner`) integrating it have the `SWIFT_VERSION` attribute set.
```
This usually happens for older projects that only support Objective-C. See this thread for help https://github.com/csdcorp/speech_to_text/issues/88.
### Not working on a particular Android device
The symptom for this issue is that the `initialize` method will always fail. If you turn on debug logging
using the `debugLogging: true` flag on the `initialize` method you'll see `'Speech recognition unavailable'`
in the Android log. There's a lengthy issue discussion here https://github.com/csdcorp/speech_to_text/issues/36
about this. The issue seems to be that the recognizer is not always automatically enabled on the device. Two
key things helped resolve the issue in this case at least.
#### First
1. Go to Google Play
2. Search for 'Google'
3. You should find this app: https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox
If 'Disabled' enable it
This is the SO post that helped: https://stackoverflow.com/questions/28769320/how-to-check-wether-speech-recognition-is-available-or-not
#### Second
Ensure the app has the required permissions. The symptom for this that you get a permanent error notification
'error_audio_error` when starting a listen session. Here's a Stack Overflow post that addresses that
https://stackoverflow.com/questions/46376193/android-speechrecognizer-audio-recording-error
Here's the important excerpt:
>You should go to system setting, Apps, Google app, then enable its permission of microphone.
### iOS recognition guidelines
Apple has quite a good guide on the user experience for using speech, the original is here
https://developer.apple.com/documentation/speech/sfspeechrecognizer This is the section that I think is particularly relevant:
>#### Create a Great User Experience for Speech Recognition
>Here are some tips to consider when adding speech recognition support to your app.
>**Be prepared to handle failures caused by speech recognition limits.** Because speech recognition is a network-based service, limits are enforced so that the service can remain freely available to all apps. Individual devices may be limited in the number of recognitions that can be performed per day, and each app may be throttled globally based on the number of requests it makes per day. If a recognition request fails quickly (within a second or two of starting), check to see if the recognition service became unavailable. If it is, you may want to ask users to try again later.
>**Plan for a one-minute limit on audio duration.** Speech recognition places a relatively high burden on battery life and network usage. To minimize this burden, the framework stops speech recognition tasks that last longer than one minute. This limit is similar to the one for keyboard-related dictation.
Remind the user when your app is recording. For example, display a visual indicator and play sounds at the beginning and end of speech recognition to help users understand that they're being actively recorded. You can also display speech as it is being recognized so that users understand what your app is doing and see any mistakes made during the recognition process.
>**Do not perform speech recognition on private or sensitive information.** Some speech is not appropriate for recognition. Don't send passwords, health or financial data, and other sensitive speech for recognition.

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>

@ -0,0 +1,8 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>speech_to_text</name>
<comment>Project android_____ created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>

@ -0,0 +1,13 @@
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(5.6.1))
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true

@ -0,0 +1,44 @@
group 'com.csdcorp.speech_to_text'
version '1.0-SNAPSHOT'
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
rootProject.allprojects {
repositories {
google()
jcenter()
}
}
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 28
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
minSdkVersion 21
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
disable 'InvalidPackage'
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

@ -0,0 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true

@ -0,0 +1,3 @@
sdk.dir=/Users/stephen.owens/Library/Android/sdk
flutter.sdk=/Users/stephen.owens/Documents/dev/flutter/sdk/flutter
org.gradle.jvmargs=-Xmx1536m -Duser.country=US -Duser.language=en

@ -0,0 +1 @@
rootProject.name = 'speech_to_text'

@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

@ -0,0 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.csdcorp.speech_to_text">
</manifest>

@ -0,0 +1,595 @@
package com.csdcorp.speech_to_text
import androidx.annotation.NonNull;
import io.flutter.embedding.engine.plugins.FlutterPlugin
import android.Manifest
import android.annotation.TargetApi
import android.app.Activity
import android.content.Intent
import android.content.pm.PackageManager
import android.os.Build
import android.os.Bundle
import android.speech.RecognitionListener
import android.speech.SpeechRecognizer.createSpeechRecognizer
import android.speech.RecognizerIntent
import android.speech.SpeechRecognizer
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
import io.flutter.plugin.common.MethodChannel.Result
import io.flutter.plugin.common.PluginRegistry
import io.flutter.plugin.common.PluginRegistry.Registrar
import org.json.JSONObject
import android.content.Context
import android.content.BroadcastReceiver
import android.os.Handler
import android.os.Looper
import android.util.Log
import io.flutter.embedding.engine.plugins.activity.ActivityAware
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding
import io.flutter.plugin.common.BinaryMessenger
import org.json.JSONArray
import java.util.*
enum class SpeechToTextErrors {
multipleRequests,
unimplemented,
noLanguageIntent,
recognizerNotAvailable,
missingOrInvalidArg,
unknown
}
enum class SpeechToTextCallbackMethods {
textRecognition,
notifyStatus,
notifyError,
soundLevelChange,
}
enum class SpeechToTextStatus {
listening,
notListening,
unavailable,
available,
}
enum class ListenMode {
deviceDefault,
dictation,
search,
confirmation,
}
const val pluginChannelName = "plugin.csdcorp.com/speech_to_text"
@TargetApi(8)
/** SpeechToTextPlugin */
public class SpeechToTextPlugin :
MethodCallHandler, RecognitionListener,
PluginRegistry.RequestPermissionsResultListener, FlutterPlugin,
ActivityAware {
private var pluginContext: Context? = null
private var channel: MethodChannel? = null
private val minSdkForSpeechSupport = 21
private val speechToTextPermissionCode = 28521
private val missingConfidence: Double = -1.0
private val logTag = "SpeechToTextPlugin"
private var currentActivity: Activity? = null
private var activeResult: Result? = null
private var initializedSuccessfully: Boolean = false
private var permissionToRecordAudio: Boolean = false
private var listening = false
private var debugLogging: Boolean = false
private var speechRecognizer: SpeechRecognizer? = null
private var recognizerIntent: Intent? = null
private var previousRecognizerLang: String? = null
private var previousPartialResults: Boolean = true
private var previousListenMode: ListenMode = ListenMode.deviceDefault
private var lastFinalTime: Long = 0
private val handler: Handler = Handler(Looper.getMainLooper())
private val defaultLanguageTag: String = Locale.getDefault().toLanguageTag()
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
onAttachedToEngine(flutterPluginBinding.getApplicationContext(), flutterPluginBinding.getBinaryMessenger());
}
// This static function is optional and equivalent to onAttachedToEngine. It supports the old
// pre-Flutter-1.12 Android projects. You are encouraged to continue supporting
// plugin registration via this function while apps migrate to use the new Android APIs
// post-flutter-1.12 via https://flutter.dev/go/android-project-migration.
//
// It is encouraged to share logic between onAttachedToEngine and registerWith to keep
// them functionally equivalent. Only one of onAttachedToEngine or registerWith will be called
// depending on the user's project. onAttachedToEngine or registerWith must both be defined
// in the same class.
companion object {
@JvmStatic
fun registerWith(registrar: Registrar) {
val speechPlugin = SpeechToTextPlugin()
speechPlugin.currentActivity = registrar.activity()
registrar.addRequestPermissionsResultListener(speechPlugin)
speechPlugin.onAttachedToEngine(registrar.context(), registrar.messenger())
}
}
private fun onAttachedToEngine(applicationContext: Context, messenger: BinaryMessenger) {
this.pluginContext = applicationContext;
channel = MethodChannel(messenger, pluginChannelName)
channel?.setMethodCallHandler(this)
}
override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) {
this.pluginContext = null;
channel?.setMethodCallHandler(null)
channel = null
}
override fun onDetachedFromActivity() {
currentActivity = null
}
override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) {
currentActivity = binding.activity
binding.addRequestPermissionsResultListener(this)
}
override fun onAttachedToActivity(binding: ActivityPluginBinding) {
currentActivity = binding.activity
binding.addRequestPermissionsResultListener(this)
}
override fun onDetachedFromActivityForConfigChanges() {
currentActivity = null
}
override fun onMethodCall(@NonNull call: MethodCall, @NonNull rawrResult: Result) {
val result = ChannelResultWrapper(rawrResult)
try {
when (call.method) {
"has_permission" -> hasPermission(result)
"initialize" -> {
var dlog = call.argument<Boolean>("debugLogging")
if (null != dlog) {
debugLogging = dlog
}
initialize(result)
}
"listen" -> {
var localeId = call.argument<String>("localeId")
if (null == localeId) {
localeId = defaultLanguageTag
}
var partialResults = call.argument<Boolean>("partialResults")
if (null == partialResults) {
partialResults = true
}
val listenModeIndex = call.argument<Int>("listenMode")
if ( null == listenModeIndex ) {
result.error(SpeechToTextErrors.missingOrInvalidArg.name,
"listenMode is required", null)
return
}
startListening(result, localeId, partialResults, listenModeIndex )
}
"stop" -> stopListening(result)
"cancel" -> cancelListening(result)
"locales" -> locales(result)
else -> result.notImplemented()
}
} catch (exc: Exception) {
Log.e(logTag, "Unexpected exception", exc)
result.error(SpeechToTextErrors.unknown.name,
"Unexpected exception", exc.localizedMessage)
}
}
private fun hasPermission(result: Result) {
if (sdkVersionTooLow(result)) {
return
}
debugLog("Start has_permission")
val localContext = pluginContext
if (localContext != null) {
val hasPerm = ContextCompat.checkSelfPermission(localContext,
Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED
result.success(hasPerm)
}
}
private fun initialize(result: Result) {
if (sdkVersionTooLow(result)) {
return
}
debugLog("Start initialize")
if (null != activeResult) {
result.error(SpeechToTextErrors.multipleRequests.name,
"Only one initialize at a time", null)
return
}
activeResult = result
val localContext = pluginContext
initializeIfPermitted(pluginContext)
}
private fun sdkVersionTooLow(result: Result): Boolean {
if (Build.VERSION.SDK_INT < minSdkForSpeechSupport) {
result.success(false)
return true;
}
return false;
}
private fun isNotInitialized(result: Result): Boolean {
if (!initializedSuccessfully || null == pluginContext) {
result.success(false)
}
return !initializedSuccessfully
}
private fun isListening(): Boolean {
return listening
}
private fun isNotListening(): Boolean {
return !listening
}
private fun startListening(result: Result, languageTag: String, partialResults: Boolean,
listenModeIndex: Int) {
if (sdkVersionTooLow(result) || isNotInitialized(result) || isListening()) {
return
}
debugLog("Start listening")
var listenMode = ListenMode.deviceDefault
if ( listenModeIndex == ListenMode.dictation.ordinal) {
listenMode = ListenMode.dictation
}
setupRecognizerIntent(languageTag, partialResults, listenMode)
handler.post {
run {
speechRecognizer?.startListening(recognizerIntent)
}
}
notifyListening(isRecording = true)
result.success(true)
debugLog("Start listening done")
}
private fun stopListening(result: Result) {
if (sdkVersionTooLow(result) || isNotInitialized(result) || isNotListening()) {
return
}
debugLog("Stop listening")
handler.post {
run {
speechRecognizer?.stopListening()
}
}
notifyListening(isRecording = false)
result.success(true)
debugLog("Stop listening done")
}
private fun cancelListening(result: Result) {
if (sdkVersionTooLow(result) || isNotInitialized(result) || isNotListening()) {
return
}
debugLog("Cancel listening")
handler.post {
run {
speechRecognizer?.cancel()
}
}
notifyListening(isRecording = false)
result.success(true)
debugLog("Cancel listening done")
}
private fun locales(result: Result) {
if (sdkVersionTooLow(result) || isNotInitialized(result)) {
return
}
var detailsIntent = RecognizerIntent.getVoiceDetailsIntent(pluginContext)
if (null == detailsIntent) {
detailsIntent = Intent(RecognizerIntent.ACTION_GET_LANGUAGE_DETAILS)
}
if (null == detailsIntent) {
result.error(SpeechToTextErrors.noLanguageIntent.name,
"Could not get voice details", null)
return
}
pluginContext?.sendOrderedBroadcast(
detailsIntent, null, LanguageDetailsChecker(result),
null, Activity.RESULT_OK, null, null)
}
private fun notifyListening(isRecording: Boolean) {
debugLog("Notify listening")
listening = isRecording
val status = when (isRecording) {
true -> SpeechToTextStatus.listening.name
false -> SpeechToTextStatus.notListening.name
}
channel?.invokeMethod(SpeechToTextCallbackMethods.notifyStatus.name, status)
debugLog("Notify listening done")
}
private fun updateResults(speechBundle: Bundle?, isFinal: Boolean) {
if (isDuplicateFinal( isFinal )) {
debugLog("Discarding duplicate final")
return
}
val userSaid = speechBundle?.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION)
if (null != userSaid && userSaid.isNotEmpty()) {
val speechResult = JSONObject()
speechResult.put("finalResult", isFinal)
val confidence = speechBundle?.getFloatArray(SpeechRecognizer.CONFIDENCE_SCORES)
val alternates = JSONArray()
for (resultIndex in 0..userSaid.size - 1) {
val speechWords = JSONObject()
speechWords.put("recognizedWords", userSaid[resultIndex])
if (null != confidence && confidence.size >= userSaid.size) {
speechWords.put("confidence", confidence[resultIndex])
} else {
speechWords.put("confidence", missingConfidence)
}
alternates.put(speechWords)
}
speechResult.put("alternates", alternates)
val jsonResult = speechResult.toString()
debugLog("Calling results callback")
channel?.invokeMethod(SpeechToTextCallbackMethods.textRecognition.name,
jsonResult)
}
}
private fun isDuplicateFinal( isFinal: Boolean ) : Boolean {
if ( !isFinal ) {
return false
}
val delta = System.currentTimeMillis() - lastFinalTime
lastFinalTime = System.currentTimeMillis()
return delta >= 0 && delta < 100
}
private fun initializeIfPermitted(context: Context?) {
val localContext = context
if (null == localContext) {
completeInitialize()
return
}
permissionToRecordAudio = ContextCompat.checkSelfPermission(localContext,
Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED
debugLog("Checked permission")
if (!permissionToRecordAudio) {
val localActivity = currentActivity
if (null != localActivity) {
debugLog("Requesting permission")
ActivityCompat.requestPermissions(localActivity,
arrayOf(Manifest.permission.RECORD_AUDIO), speechToTextPermissionCode)
} else {
debugLog("no permission, no activity, completing")
completeInitialize()
}
} else {
debugLog("has permission, completing")
completeInitialize()
}
debugLog("leaving initializeIfPermitted")
}
private fun completeInitialize() {
debugLog("completeInitialize")
if (permissionToRecordAudio) {
debugLog("Testing recognition availability")
if (!SpeechRecognizer.isRecognitionAvailable(pluginContext)) {
Log.e(logTag, "Speech recognition not available on this device")
activeResult?.error(SpeechToTextErrors.recognizerNotAvailable.name,
"Speech recognition not available on this device", "")
activeResult = null
return
}
debugLog("Creating recognizer")
speechRecognizer = createSpeechRecognizer(pluginContext).apply {
debugLog("Setting listener")
setRecognitionListener(this@SpeechToTextPlugin)
}
if (null == speechRecognizer) {
Log.e(logTag, "Speech recognizer null")
activeResult?.error(
SpeechToTextErrors.recognizerNotAvailable.name,
"Speech recognizer null", "")
activeResult = null
}
debugLog("before setup intent")
setupRecognizerIntent(defaultLanguageTag, true, ListenMode.deviceDefault)
debugLog("after setup intent")
}
initializedSuccessfully = permissionToRecordAudio
debugLog("sending result")
activeResult?.success(permissionToRecordAudio)
debugLog("leaving complete")
activeResult = null
}
private fun setupRecognizerIntent(languageTag: String, partialResults: Boolean, listenMode: ListenMode) {
debugLog("setupRecognizerIntent")
if (previousRecognizerLang == null ||
previousRecognizerLang != languageTag ||
partialResults != previousPartialResults || previousListenMode != listenMode ) {
previousRecognizerLang = languageTag;
previousPartialResults = partialResults
previousListenMode = listenMode
handler.post {
run {
recognizerIntent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH).apply {
debugLog("In RecognizerIntent apply")
putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM)
debugLog("put model")
val localContext = pluginContext
if (null != localContext) {
putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,
localContext.applicationInfo.packageName)
}
debugLog("put package")
putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, partialResults)
debugLog("put partial")
if (languageTag != Locale.getDefault().toLanguageTag()) {
putExtra(RecognizerIntent.EXTRA_LANGUAGE, languageTag);
debugLog("put languageTag")
}
}
}
}
}
}
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>?,
grantResults: IntArray?): Boolean {
when (requestCode) {
speechToTextPermissionCode -> {
if (null != grantResults) {
permissionToRecordAudio = grantResults.isNotEmpty() &&
grantResults.get(0) == PackageManager.PERMISSION_GRANTED
}
completeInitialize()
return true
}
}
return false
}
override fun onPartialResults(results: Bundle?) = updateResults(results, false)
override fun onResults(results: Bundle?) = updateResults(results, true)
override fun onEndOfSpeech() = notifyListening(isRecording = false)
override fun onError(errorCode: Int) {
val errorMsg = when (errorCode) {
SpeechRecognizer.ERROR_AUDIO -> "error_audio_error"
SpeechRecognizer.ERROR_CLIENT -> "error_client"
SpeechRecognizer.ERROR_INSUFFICIENT_PERMISSIONS -> "error_permission"
SpeechRecognizer.ERROR_NETWORK -> "error_network"
SpeechRecognizer.ERROR_NETWORK_TIMEOUT -> "error_network_timeout"
SpeechRecognizer.ERROR_NO_MATCH -> "error_no_match"
SpeechRecognizer.ERROR_RECOGNIZER_BUSY -> "error_busy"
SpeechRecognizer.ERROR_SERVER -> "error_server"
SpeechRecognizer.ERROR_SPEECH_TIMEOUT -> "error_speech_timeout"
else -> "error_unknown"
}
sendError(errorMsg)
}
private fun debugLog( msg: String ) {
if ( debugLogging ) {
Log.d( logTag, msg )
}
}
private fun sendError(errorMsg: String) {
val speechError = JSONObject()
speechError.put("errorMsg", errorMsg)
speechError.put("permanent", true)
handler.post {
run {
channel?.invokeMethod(SpeechToTextCallbackMethods.notifyError.name, speechError.toString())
}
}
}
override fun onRmsChanged(rmsdB: Float) {
handler.post {
run {
channel?.invokeMethod(SpeechToTextCallbackMethods.soundLevelChange.name, rmsdB)
}
}
}
override fun onReadyForSpeech(p0: Bundle?) {}
override fun onBufferReceived(p0: ByteArray?) {}
override fun onEvent(p0: Int, p1: Bundle?) {}
override fun onBeginningOfSpeech() {}
}
// See https://stackoverflow.com/questions/10538791/how-to-set-the-language-in-speech-recognition-on-android/10548680#10548680
class LanguageDetailsChecker(flutterResult: Result) : BroadcastReceiver() {
private val result: Result = flutterResult
private var supportedLanguages: List<String>? = null
private var languagePreference: String? = null
override fun onReceive(context: Context, intent: Intent) {
val results = getResultExtras(true)
if (results.containsKey(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE)) {
languagePreference = results.getString(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE)
}
if (results.containsKey(RecognizerIntent.EXTRA_SUPPORTED_LANGUAGES)) {
supportedLanguages = results.getStringArrayList(
RecognizerIntent.EXTRA_SUPPORTED_LANGUAGES)
createResponse(supportedLanguages)
}
}
private fun createResponse(supportedLanguages: List<String>?) {
val currentLocale = Locale.getDefault()
val localeNames = ArrayList<String>()
localeNames.add(buildIdNameForLocale(currentLocale))
if (null != supportedLanguages) {
for (lang in supportedLanguages) {
if (currentLocale.toLanguageTag() == lang) {
continue
}
val locale = Locale.forLanguageTag(lang)
localeNames.add(buildIdNameForLocale(locale))
}
}
result.success(localeNames)
}
private fun buildIdNameForLocale(locale: Locale): String {
val name = locale.displayName.replace(':', ' ')
return "${locale.language}_${locale.country}:$name"
}
}
private class ChannelResultWrapper(result: Result) : Result {
// Caller handler
val handler: Handler = Handler(Looper.getMainLooper())
val result: Result = result
// make sure to respond in the caller thread
override fun success(results: Any?) {
handler.post {
run {
result.success(results);
}
}
}
override fun error(errorCode: String?, errorMessage: String?, data: Any?) {
handler.post {
run {
result.error(errorCode, errorMessage, data);
}
}
}
override fun notImplemented() {
handler.post {
run {
result.notImplemented();
}
}
}
}

@ -0,0 +1,73 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.packages
.pub-cache/
.pub/
/build/
# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java
# iOS/XCode related
**/ios/**/*.mode1v3
**/ios/**/*.mode2v3
**/ios/**/*.moved-aside
**/ios/**/*.pbxuser
**/ios/**/*.perspectivev3
**/ios/**/*sync/
**/ios/**/.sconsign.dblite
**/ios/**/.tags*
**/ios/**/.vagrant/
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata
**/ios/.generated/
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/Flutter/flutter_export_environment.sh
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*
# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: 2d2a1ffec95cc70a3218872a2cd3f8de4933c42f
channel: stable
project_type: app

@ -0,0 +1,155 @@
# speech_to_text_example
Demonstrates how to use the speech_to_text plugin. This example requires
that the plugin has been installed. It initializes speech recognition,
listens for words and prints them.
## Source
```dart
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:speech_to_text/speech_to_text.dart';
import 'package:speech_to_text/speech_recognition_result.dart';
import 'package:speech_to_text/speech_recognition_error.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
bool _hasSpeech = false;
String lastWords = "";
String lastError = "";
String lastStatus = "";
final SpeechToText speech = SpeechToText();
@override
void initState() {
super.initState();
initSpeechState();
}
Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener );
if (!mounted) return;
setState(() {
_hasSpeech = hasSpeech;
});
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Speech to Text Example'),
),
body: _hasSpeech
? Column(children: [
Expanded(
child: Center(
child: Text('Speech recognition available'),
),
),
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
FlatButton(
child: Text('Start'),
onPressed: startListening,
),
FlatButton(
child: Text('Stop'),
onPressed: stopListening,
),
FlatButton(
child: Text('Cancel'),
onPressed:cancelListening,
),
],
),
),
Expanded(
child: Column(
children: <Widget>[
Center(
child: Text('Recognized Words'),
),
Center(
child: Text(lastWords),
),
],
),
),
Expanded(
child: Column(
children: <Widget>[
Center(
child: Text('Error'),
),
Center(
child: Text(lastError),
),
],
),
),
Expanded(
child: Center(
child: speech.isListening ? Text("I'm listening...") : Text( 'Not listening' ),
),
),
])
: Center( child: Text('Speech recognition unavailable', style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold))),
),
);
}
void startListening() {
lastWords = "";
lastError = "";
speech.listen(onResult: resultListener );
setState(() {
});
}
void stopListening() {
speech.stop( );
setState(() {
});
}
void cancelListening() {
speech.cancel( );
setState(() {
});
}
void resultListener(SpeechRecognitionResult result) {
setState(() {
lastWords = "${result.recognizedWords} - ${result.finalResult}";
});
}
void errorListener(SpeechRecognitionError error ) {
setState(() {
lastError = "${error.errorMsg} - ${error.permanent}";
});
}
void statusListener(String status ) {
setState(() {
lastStatus = "$status";
});
}
}
```

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>android___</name>
<comment>Project android___ created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>

@ -0,0 +1,2 @@
connection.project.dir=
eclipse.preferences.version=1

@ -0,0 +1,67 @@
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.csdcorp.speech_to_text_example"
minSdkVersion 21
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.csdcorp.speech_to_text_example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>

@ -0,0 +1,32 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.csdcorp.speech_to_text_example">
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.INTERNET"/>
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="speech_to_text_example"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>

@ -0,0 +1,12 @@
package com.csdcorp.speech_to_text_example
import androidx.annotation.NonNull;
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant
class MainActivity: FlutterActivity() {
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine);
}
}

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
</resources>

@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.csdcorp.speech_to_text_example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>

@ -0,0 +1,31 @@
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}

@ -0,0 +1,4 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true

@ -0,0 +1,6 @@
#Mon Mar 16 08:57:32 EDT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

@ -0,0 +1,15 @@
include ':app'
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}
plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
}

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>App</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
</dict>
</plist>

@ -0,0 +1,2 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"

@ -0,0 +1,18 @@
#
# NOTE: This podspec is NOT to be published. It is only used as a local source!
#
Pod::Spec.new do |s|
s.name = 'Flutter'
s.version = '1.0.0'
s.summary = 'High-performance, high-fidelity mobile apps.'
s.description = <<-DESC
Flutter provides an easy and productive way to build and deploy high-performance mobile apps for Android and iOS.
DESC
s.homepage = 'https://flutter.io'
s.license = { :type => 'MIT' }
s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
s.ios.deployment_target = '8.0'
s.vendored_frameworks = 'Flutter.framework'
end

@ -0,0 +1,2 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"

@ -0,0 +1,90 @@
# Uncomment this line to define a global platform for your project
platform :ios, '10.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
end
generated_key_values = {}
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) do |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
generated_key_values[podname] = podpath
else
puts "Invalid plugin specification: #{line}"
end
end
generated_key_values
end
target 'Runner' do
use_frameworks!
use_modular_headers!
# Flutter Pod
copied_flutter_dir = File.join(__dir__, 'Flutter')
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
unless File.exist?(generated_xcode_build_settings_path)
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
unless File.exist?(copied_framework_path)
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
end
unless File.exist?(copied_podspec_path)
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
end
end
# Keep pod path relative so it can be checked into Podfile.lock.
pod 'Flutter', :path => 'Flutter'
# Plugin Pods
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.each do |name, path|
symlink = File.join('.symlinks', 'plugins', name)
File.symlink(path, symlink)
pod name, :path => File.join(symlink, 'ios')
end
end
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end

@ -0,0 +1,29 @@
PODS:
- Flutter (1.0.0)
- speech_to_text (0.0.1):
- Flutter
- Try
- Try (2.1.1)
DEPENDENCIES:
- Flutter (from `Flutter`)
- speech_to_text (from `.symlinks/plugins/speech_to_text/ios`)
SPEC REPOS:
trunk:
- Try
EXTERNAL SOURCES:
Flutter:
:path: Flutter
speech_to_text:
:path: ".symlinks/plugins/speech_to_text/ios"
SPEC CHECKSUMS:
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
speech_to_text: b43a7d99aef037bd758ed8e45d79bbac035d2dfe
Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96
PODFILE CHECKSUM: 0ba44ad07df4ab62269dc769727cf0f12b1e453d
COCOAPODS: 1.9.3

@ -0,0 +1,578 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
C446300A034BF27D9F1ACEF9 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E76E9615C6B4FABD88067D55 /* Pods_Runner.framework */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
59AFE6BB0B596A0E0811BDFF /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
6280E2A777726D2043BF80B7 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
C3909A4B7EC98A20255210E3 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
E76E9615C6B4FABD88067D55 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
C446300A034BF27D9F1ACEF9 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
7937AF765430D66F28F7FEEF /* Frameworks */ = {
isa = PBXGroup;
children = (
E76E9615C6B4FABD88067D55 /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */,
);
name = Flutter;
sourceTree = "<group>";
};
97C146E51CF9000F007C117D = {
isa = PBXGroup;
children = (
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
A68CCF1640763A551D35BD31 /* Pods */,
7937AF765430D66F28F7FEEF /* Frameworks */,
);
sourceTree = "<group>";
};
97C146EF1CF9000F007C117D /* Products */ = {
isa = PBXGroup;
children = (
97C146EE1CF9000F007C117D /* Runner.app */,
);
name = Products;
sourceTree = "<group>";
};
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97C147021CF9000F007C117D /* Info.plist */,
97C146F11CF9000F007C117D /* Supporting Files */,
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
);
path = Runner;
sourceTree = "<group>";
};
97C146F11CF9000F007C117D /* Supporting Files */ = {
isa = PBXGroup;
children = (
);
name = "Supporting Files";
sourceTree = "<group>";
};
A68CCF1640763A551D35BD31 /* Pods */ = {
isa = PBXGroup;
children = (
59AFE6BB0B596A0E0811BDFF /* Pods-Runner.debug.xcconfig */,
6280E2A777726D2043BF80B7 /* Pods-Runner.release.xcconfig */,
C3909A4B7EC98A20255210E3 /* Pods-Runner.profile.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
97C146ED1CF9000F007C117D /* Runner */ = {
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
949FCB95217187F2C022D6A9 /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
8B0988F04B6AE44AA0304FEF /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = Runner;
productName = Runner;
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = 3X949YE9K2;
LastSwiftMigration = 0910;
};
};
};
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
97C146ED1CF9000F007C117D /* Runner */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
97C146EC1CF9000F007C117D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Thin Binary";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
8B0988F04B6AE44AA0304FEF /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
949FCB95217187F2C022D6A9 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
97C146EA1CF9000F007C117D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C146FB1CF9000F007C117D /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C147001CF9000F007C117D /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Profile;
};
249021D4217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 3X949YE9K2;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.csdcorp.speechToTextExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Profile;
};
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
97C147061CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 3X949YE9K2;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.csdcorp.speechToTextExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
97C147071CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 3X949YE9K2;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.csdcorp.speechToTextExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147031CF9000F007C117D /* Debug */,
97C147041CF9000F007C117D /* Release */,
249021D3217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147061CF9000F007C117D /* Debug */,
97C147071CF9000F007C117D /* Release */,
249021D4217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
</Workspace>

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

@ -0,0 +1,13 @@
import UIKit
import Flutter
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}

@ -0,0 +1,122 @@
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@1x.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@1x.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@1x.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-App-83.5x83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-App-1024x1024@1x.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save