Merge branch 'sultan' into 'diplomatic-quarter-live'

Sultan

See merge request Cloud_Solution/diplomatic-quarter!116
merge-update-with-lab-changes
Mohammad Aljammal 6 years ago
commit 0966269537

@ -6,8 +6,9 @@ import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
const MAX_SMALL_SCREEN = 660; const MAX_SMALL_SCREEN = 660;
const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; //const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/';
const GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; const GET_PROJECT = 'Services/Lists.svc/REST/GetProject';
///Doctor ///Doctor
@ -182,7 +183,8 @@ const CHECK_PAYMENT_STATUS =
//URL create advance payment //URL create advance payment
const CREATE_ADVANCE_PAYMENT = "Services/Doctors.svc/REST/CreateAdvancePayment"; const CREATE_ADVANCE_PAYMENT = "Services/Doctors.svc/REST/CreateAdvancePayment";
const HIS_CREATE_ADVANCE_PAYMENT = "Services/Patients.svc/REST/HIS_CreateAdvancePayment"; const HIS_CREATE_ADVANCE_PAYMENT =
"Services/Patients.svc/REST/HIS_CreateAdvancePayment";
const ADD_ADVANCE_NUMBER_REQUEST = const ADD_ADVANCE_NUMBER_REQUEST =
'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest'; 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest';
@ -242,8 +244,8 @@ const LANGUAGE = 2;
const PATIENT_OUT_SA = 0; const PATIENT_OUT_SA = 0;
const SESSION_ID = 'TMRhVmkGhOsvamErw'; const SESSION_ID = 'TMRhVmkGhOsvamErw';
const IS_DENTAL_ALLOWED_BACKEND = false; const IS_DENTAL_ALLOWED_BACKEND = false;
const PATIENT_TYPE = 1; const PATIENT_TYPE = 2;
const PATIENT_TYPE_ID = 1; const PATIENT_TYPE_ID = 2;
var DEVICE_TOKEN = ""; var DEVICE_TOKEN = "";
var DeviceTypeID = Platform.isIOS ? 1 : 2; var DeviceTypeID = Platform.isIOS ? 1 : 2;
const LANGUAGE_ID = 2; const LANGUAGE_ID = 2;
@ -253,6 +255,10 @@ const GET_PAtIENTS_INSURANCE =
"Services/Patients.svc/REST/Get_PatientInsuranceDetails"; "Services/Patients.svc/REST/Get_PatientInsuranceDetails";
const GET_PAtIENTS_INSURANCE_UPDATED = const GET_PAtIENTS_INSURANCE_UPDATED =
"Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory";
const INSURANCE_DETAILS =
"Services/Patients.svc/REST/Get_InsuranceCheckList";
const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID"; const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID";
const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail"; const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail";
const GET_PAtIENTS_INSURANCE_APPROVALS = const GET_PAtIENTS_INSURANCE_APPROVALS =

@ -111,10 +111,13 @@ const Map localizedValues = {
'login': {'en': 'Login', 'ar': 'تسجيل الدخول'}, 'login': {'en': 'Login', 'ar': 'تسجيل الدخول'},
'loginregister': {'en': 'Login / Register', 'ar': 'تسجيل الدخول'}, 'loginregister': {'en': 'Login / Register', 'ar': 'تسجيل الدخول'},
'poweredBy': {'en': 'Powered By', 'ar': 'مشغل بواسطة'}, 'poweredBy': {'en': 'Powered By', 'ar': 'مشغل بواسطة'},
'welcome': {'en': 'Welcome', 'ar': 'أهلا بك'}, "welcome": {
'welcome_text': { "en": "Welcome",
'en': 'Dr. Sulaiman Al Habib Mobile Application ', "ar": "مرحبا"
'ar': 'الدكتور سليمان الحبيب لتطبيقات الهاتف المتحرك' },
"welcome_text": {
"en": "Dr. Sulaiman Al Habib Mobile Application",
"ar": "الدكتور سليمان الحبيب لتطبيقات الهاتف المتحرك"
}, },
'welcome_text2': { 'welcome_text2': {
'en': 'Have you visited AlHabib Medical Group before? ', 'en': 'Have you visited AlHabib Medical Group before? ',
@ -127,8 +130,14 @@ const Map localizedValues = {
"ar": "اختر من الخيارات أدناه لتسجيل الدخول إلى ملفك الطبي." "ar": "اختر من الخيارات أدناه لتسجيل الدخول إلى ملفك الطبي."
}, },
"registernow": {"en": "Register Now", "ar": "تسجيل الان"}, "registernow": {"en": "Register Now", "ar": "تسجيل الان"},
"nationalID": {"en": "National ID", "ar": "رقم الهوية"}, "nationalID": { "en": "Enter the Identification Number",
"ar": "أدخل رقم الهوية الوطنية او الاقامة"},
"national-id": {
"en": "National ID",
"ar": "رقم الهوية"
},
"fileNo": {"en": "File Number", "ar": "رقم الملف"}, "fileNo": {"en": "File Number", "ar": "رقم الملف"},
"fileno": {"en": "File No", "ar": "رقم الملف"},
"forgotFileNo": {"en": "Forgot file Number?", "ar": "نسيت رقم الملف الطبي؟"}, "forgotFileNo": {"en": "Forgot file Number?", "ar": "نسيت رقم الملف الطبي؟"},
"forgotFileNoTitle": { "forgotFileNoTitle": {
"en": "Forgot medical file Number", "en": "Forgot medical file Number",
@ -136,8 +145,8 @@ const Map localizedValues = {
}, },
"enter-national-id": { "enter-national-id": {
"en": "Please enter mobile number and national ID / Iqama", "en": "Please enter mobile number and identification number",
"ar": "الرجاء إدخال رقم الجوال والهوية الوطنية / الاقامة" "ar": "الرجاء إدخال رقم الجوال ورقم الهوية"
}, },
"profile-info": { "profile-info": {
"en": "Please enter profile information", "en": "Please enter profile information",
@ -823,6 +832,43 @@ const Map localizedValues = {
"ar": "ar":
"خدمة التقارير الشهرية: عند تفعيل هذه الخدمة سيقوم النظام بارسال تقرير شهري بشكل آلي على الايميل المسجل والذي يسرد المؤشرات الحيوية ونتائج التحاليل لآخر زيارات تمت بمجموعة الحبيب الطبية." "خدمة التقارير الشهرية: عند تفعيل هذه الخدمة سيقوم النظام بارسال تقرير شهري بشكل آلي على الايميل المسجل والذي يسرد المؤشرات الحيوية ونتائج التحاليل لآخر زيارات تمت بمجموعة الحبيب الطبية."
}, },
"language-setting": {
"en": "SMS and Confirmation Calls Language",
"ar": "لغة الرسائل القصيرة و الاتصال الآلي"
},
"alert": {"en": "Alerts", "ar": "التنبيهات"},
"email-alert": {
"en": "Alert By Email",
"ar": "استلام التنبيهات بالبريد الالكتروني"
},
"sms-alert": {
"en": "Alert By SMS",
"ar": "استلام التنبيهات بالرسائل القصيرة"
},
"contact-info": {"en": "Contact Information", "ar": "معلومات التواصل"},
"emrg-name": {
"en": "Emergency Contact Name",
"ar": "اسم للتواصل في حالة الطوارئ"
},
"emrg-no": {
"en": "Emergency Contact Number",
"ar": "رقم للتواصل في حالة الطوارئ"
},
"modes": {"en": "Modes", "ar": "الاوضاع"},
"vibration": {"en": "Vibration Touch Feedback", "ar": "الاهتزاز عند اللمس"},
"blind-modes": {
"en": "Modes for Partially Blind",
"ar": "تأثيرات لدعم ضعاف البصر"
},
"invert-theme": {"en": "Invert", "ar": "ألوان سلبية"},
"off-theme": {"en": "Off", "ar": "إيقاف"},
"dim-theme": {"en": "Dim", "ar": "ضوء خافت"},
"bw-theme": {"en": "Black and White", "ar": "أبيض و أسود"},
"permissions": {"en": "Permission", "ar": "الصلاحيات"},
"camera-permission": {"en": "Camera", "ar": "الكاميرا"},
"location-permission": {"en": "Location", "ar": "تحديد المواقع"},
"accessibility": {"en": "Accessibility Mode", "ar": "وضع امكانية الوصول"},
"orderStatus": {"en": "Order Status", "ar": "حالة الطلب"}, "orderStatus": {"en": "Order Status", "ar": "حالة الطلب"},
"CancelOrder": {"en": "Cancel Order", "ar": "الغاء الطلب"}, "CancelOrder": {"en": "Cancel Order", "ar": "الغاء الطلب"},
"FindUs": {"en": "Find Us", "ar": "اين تجدنا"}, "FindUs": {"en": "Find Us", "ar": "اين تجدنا"},

@ -16,3 +16,6 @@ const USER_LONG = 'user-long';
const IS_GO_TO_PARKING = 'IS_GO_TO_PARKING'; const IS_GO_TO_PARKING = 'IS_GO_TO_PARKING';
const IS_SEARCH_APPO = 'is-search-appo'; const IS_SEARCH_APPO = 'is-search-appo';
const IS_LIVECARE_APPOINTMENT = 'is_livecare_appointment'; const IS_LIVECARE_APPOINTMENT = 'is_livecare_appointment';
const IS_VIBRATION = 'is_vibration';
const THEME_VALUE = 'is_vibration';
const MAIN_USER = 'main-user';

@ -16,7 +16,9 @@ class InsuranceCardModel {
int patientType; int patientType;
String groupName; String groupName;
String companyName; String companyName;
int companyID;
String subCategoryDesc; String subCategoryDesc;
int subCategoryID;
String patientCardID; String patientCardID;
String insurancePolicyNumber; String insurancePolicyNumber;
bool isActive; bool isActive;
@ -25,6 +27,7 @@ class InsuranceCardModel {
InsuranceCardModel({ InsuranceCardModel({
this.insurancePolicyNumber, this.insurancePolicyNumber,
this.subCategoryDesc, this.subCategoryDesc,
this.subCategoryID,
this.versionID, this.versionID,
this.channel, this.channel,
this.languageID, this.languageID,
@ -40,6 +43,7 @@ class InsuranceCardModel {
this.patientType, this.patientType,
this.groupName, this.groupName,
this.companyName, this.companyName,
this.companyID,
this.patientCardID, this.patientCardID,
this.isActive, this.isActive,
this.cardValidTo this.cardValidTo
@ -50,6 +54,7 @@ class InsuranceCardModel {
insurancePolicyNumber = json['InsurancePolicyNo']; insurancePolicyNumber = json['InsurancePolicyNo'];
patientCardID = json['PatientCardID']; patientCardID = json['PatientCardID'];
companyName = json['CompanyName']; companyName = json['CompanyName'];
companyID = json['CompanyID'];
groupName = json['GroupName']; groupName = json['GroupName'];
versionID = json['VersionID']; versionID = json['VersionID'];
channel = json['Channel']; channel = json['Channel'];
@ -65,6 +70,7 @@ class InsuranceCardModel {
patientTypeID = json['PatientTypeID']; patientTypeID = json['PatientTypeID'];
patientType = json['PatientType']; patientType = json['PatientType'];
subCategoryDesc = json['SubCategoryDesc']; subCategoryDesc = json['SubCategoryDesc'];
subCategoryID = json["SubCategoryID"];
cardValidTo = json['CardValidTo']; cardValidTo = json['CardValidTo'];
} }

@ -35,7 +35,7 @@ class BaseAppClient {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE); //Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
var languageID = var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'en'); await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var user = await sharedPref.getObject(USER_PROFILE); var user = await sharedPref.getObject(USER_PROFILE);
if (body.containsKey('SetupID')) { if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
@ -79,15 +79,18 @@ class BaseAppClient {
body['PatientType'] = body.containsKey('PatientType') body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null ? body['PatientType'] != null
? body['PatientType'] ? body['PatientType']
: user['PatientType'] != null
? user['PatientType']
: PATIENT_TYPE : PATIENT_TYPE
: PATIENT_TYPE; : PATIENT_TYPE;
body['PatientTypeID'] = body.containsKey('PatientTypeID') body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null ? body['PatientTypeID'] != null
? body['PatientTypeID'] ? body['PatientTypeID']
: user['PatientTypeID'] != null
? user['PatientTypeID']
: PATIENT_TYPE_ID : PATIENT_TYPE_ID
: PATIENT_TYPE_ID; : PATIENT_TYPE_ID;
if (user != null) { if (user != null) {
body['TokenID'] = token; body['TokenID'] = token;
body['PatientID'] = body['PatientID'] =

@ -125,4 +125,15 @@ class InsuranceCardService extends BaseService {
throw error; throw error;
} }
} }
Future getInsuranceDetails(data) async{
dynamic localRes;
await baseAppClient.post(INSURANCE_DETAILS,
onSuccess: (dynamic response, int statusCode) {
localRes = response['List_InsuranceCheckList'];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body:{'CompanyID': data.companyID,'SubCategoryID':data.subCategoryID },);
return Future.value(localRes);
}
} }

@ -72,4 +72,5 @@ class InsuranceViewModel extends BaseViewModel {
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }

@ -18,7 +18,8 @@ class ProjectViewModel extends BaseViewModel {
bool isError = false; bool isError = false;
String error = ''; String error = '';
dynamic searchvalue; dynamic searchvalue;
bool isLogin = false; bool isLogin
= false;
dynamic get searchValue => searchvalue; dynamic get searchValue => searchvalue;

@ -1,7 +1,9 @@
import 'package:diplomaticquarterapp/theme/theme_notifier.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'package:diplomaticquarterapp/theme/theme_value.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart';
@ -14,13 +16,15 @@ import 'locator.dart';
void main() async { void main() async {
setupLocator(); setupLocator();
runApp(MyApp()); runApp(ChangeNotifierProvider<ThemeNotifier>(
create: (context) => ThemeNotifier(defaultTheme), child: MyApp() ));
} }
class MyApp extends StatelessWidget { class MyApp extends StatelessWidget {
/// static final _myTabbedPageKey = new GlobalKey<_LandingPageState>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final themeNotifier = Provider.of<ThemeNotifier>(context);
return LayoutBuilder( return LayoutBuilder(
builder: (context, constraints) { builder: (context, constraints) {
return OrientationBuilder( return OrientationBuilder(
@ -59,7 +63,7 @@ class MyApp extends StatelessWidget {
const Locale('en', ''), // English const Locale('en', ''), // English
], ],
theme: ThemeData( theme: ThemeData(
fontFamily: projectProvider.isArabic ? 'Cairo' : 'WorkSans', fontFamily: projectProvider.isArabic? 'Cairo' : 'WorkSans',
primarySwatch: Colors.blue, primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity, visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light, brightness: Brightness.light,
@ -76,12 +80,13 @@ class MyApp extends StatelessWidget {
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey, textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white, canvasColor: Colors.white,
backgroundColor: Color.fromRGBO(255, 255, 255, 1), backgroundColor: Colors.white,
highlightColor: Colors.grey[100].withOpacity(0.4), highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent, splashColor: Colors.transparent,
primaryColor: Color(0xff40ACC9), primaryColor: Color(0xff40ACC9),
bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)), bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
cursorColor: Colors.grey, cursorColor: Colors.grey,
cardColor: Colors.white,
iconTheme: IconThemeData(), iconTheme: IconThemeData(),
appBarTheme: AppBarTheme( appBarTheme: AppBarTheme(
color: Color(0xff40ACC9), color: Color(0xff40ACC9),

@ -60,6 +60,7 @@ class AuthenticatedUser {
dynamic strDateofBirth; dynamic strDateofBirth;
dynamic tempAddress; dynamic tempAddress;
dynamic zipCode; dynamic zipCode;
dynamic isFamily;
// dynamic patientPayType; // dynamic patientPayType;
// dynamic patientType; // dynamic patientType;
// dynamic status; // dynamic status;
@ -123,6 +124,7 @@ class AuthenticatedUser {
this.strDateofBirth, this.strDateofBirth,
this.tempAddress, this.tempAddress,
this.zipCode, this.zipCode,
this.isFamily
}); });
AuthenticatedUser.fromJson(Map<String, dynamic> json) { AuthenticatedUser.fromJson(Map<String, dynamic> json) {
@ -190,6 +192,7 @@ class AuthenticatedUser {
strDateofBirth = json['StrDateofBirth']; strDateofBirth = json['StrDateofBirth'];
tempAddress = json['TempAddress']; tempAddress = json['TempAddress'];
zipCode = json['ZipCode']; zipCode = json['ZipCode'];
isFamily = json['IsFamily'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -255,7 +258,7 @@ class AuthenticatedUser {
data['StrDateofBirth'] = this.strDateofBirth; data['StrDateofBirth'] = this.strDateofBirth;
data['TempAddress'] = this.tempAddress; data['TempAddress'] = this.tempAddress;
data['ZipCode'] = this.zipCode; data['ZipCode'] = this.zipCode;
data['IsFamily'] = this.isFamily;
return data; return data;
} }
} }

@ -2,7 +2,7 @@ class CheckActivationCodeReq {
int patientMobileNumber; int patientMobileNumber;
String mobileNo; String mobileNo;
String deviceToken; String deviceToken;
int projectOutSA; bool projectOutSA;
int loginType; int loginType;
String zipCode; String zipCode;
bool isRegister; bool isRegister;

@ -76,6 +76,9 @@ class Patientobject {
String firstName; String firstName;
String middleName; String middleName;
String lastName; String lastName;
String firstNameN;
String middleNameN;
String lastNameN;
dynamic strDateofBirth; dynamic strDateofBirth;
String dateofBirth; String dateofBirth;
int gender; int gender;
@ -95,6 +98,9 @@ class Patientobject {
this.firstName, this.firstName,
this.middleName, this.middleName,
this.lastName, this.lastName,
this.firstNameN,
this.middleNameN,
this.lastNameN,
this.strDateofBirth, this.strDateofBirth,
this.dateofBirth, this.dateofBirth,
this.gender, this.gender,
@ -114,6 +120,9 @@ class Patientobject {
firstName = json['FirstName']; firstName = json['FirstName'];
middleName = json['MiddleName']; middleName = json['MiddleName'];
lastName = json['LastName']; lastName = json['LastName'];
firstNameN = json['FirstNameN'];
middleNameN = json['MiddleNameN'];
lastNameN = json['LastNameN'];
strDateofBirth = json['StrDateofBirth']; strDateofBirth = json['StrDateofBirth'];
dateofBirth = json['DateofBirth']; dateofBirth = json['DateofBirth'];
gender = json['Gender']; gender = json['Gender'];
@ -136,6 +145,9 @@ class Patientobject {
data['FirstName'] = this.firstName; data['FirstName'] = this.firstName;
data['MiddleName'] = this.middleName; data['MiddleName'] = this.middleName;
data['LastName'] = this.lastName; data['LastName'] = this.lastName;
data['FirstNameN'] = this.firstNameN;
data['MiddleNameN'] = this.middleNameN;
data['LastNameN'] = this.lastNameN;
data['StrDateofBirth'] = this.strDateofBirth; data['StrDateofBirth'] = this.strDateofBirth;
data['DateofBirth'] = this.dateofBirth; data['DateofBirth'] = this.dateofBirth;
data['Gender'] = this.gender; data['Gender'] = this.gender;

@ -2,7 +2,7 @@ class SendActivationRequest {
int patientMobileNumber; int patientMobileNumber;
String mobileNo; String mobileNo;
String deviceToken; String deviceToken;
int projectOutSA; bool projectOutSA;
int loginType; int loginType;
String zipCode; String zipCode;
bool isRegister; bool isRegister;

@ -224,7 +224,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
), ),
); );
}, },
markersBuilder: (context, date, events, holidays) { markersBuilder: (context, date, events, _) {
final children = <Widget>[]; final children = <Widget>[];
if (events.isNotEmpty) { if (events.isNotEmpty) {
children.add( children.add(
@ -239,8 +239,8 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
return children; return children;
}, },
), ),
onDaySelected: (date, events, holidays) { onDaySelected: (date, event, _) {
_onDaySelected(date, events); _onDaySelected(date, event);
_animationController.forward(from: 0.0); _animationController.forward(from: 0.0);
}, },
onVisibleDaysChanged: _onVisibleDaysChanged, onVisibleDaysChanged: _onVisibleDaysChanged,

@ -348,7 +348,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
return children; return children;
}, },
), ),
onDaySelected: (date, event, holidays) { onDaySelected: (date, event, _) {
_onDaySelected( _onDaySelected(
date, date,
event, event,

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStat
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
@ -19,6 +20,8 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
class MyFamily extends StatefulWidget { class MyFamily extends StatefulWidget {
final bool isAppbarVisible;
MyFamily({this.isAppbarVisible =true});
@override @override
_MyFamily createState() => _MyFamily(); _MyFamily createState() => _MyFamily();
} }
@ -38,65 +41,66 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
bool expandFlag = false; bool expandFlag = false;
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( // return Scaffold(
appBar: AppBar( // appBar: AppBar(
bottom: TabBar( // bottom: TabBar(
indicatorColor: Colors.red,
tabs: [
Padding(
padding: EdgeInsets.all(6),
child: AppText(
TranslationBase.of(context).family,
color: Colors.white,
)),
Padding(
padding: EdgeInsets.all(6),
child: AppText(
TranslationBase.of(context).request,
color: Colors.white,
)),
],
controller: _tabController,
),
title: AppText(TranslationBase.of(context).myFamilyFiles,
color: Colors.white)),
body: TabBarView(
// physics: NeverScrollableScrollPhysics(),
children: [myFamilyDetails(context), myFamilyRequest(context)],
controller: _tabController),
bottomNavigationBar: BottomBarSearch());
// AppScaffold(
// appBarTitle: TranslationBase.of(context).myFamilyFiles,
// isShowAppBar: true,
// body: SingleChildScrollView(
// child: Container(
// height: SizeConfig.screenHeight,
// width: SizeConfig.realScreenWidth,
// padding: EdgeInsets.all(20),
// child: Stack(
// children: <Widget>[
// TabBar(
// controller: _tabController,
// indicatorColor: Colors.red, // indicatorColor: Colors.red,
// tabs: [ // tabs: [
// Padding( // Padding(
// padding: EdgeInsets.all(6), // padding: EdgeInsets.all(6),
// child: Text(TranslationBase.of(context).family)), // child: AppText(
// TranslationBase.of(context).family,
// color: Colors.white,
// )),
// Padding( // Padding(
// padding: EdgeInsets.all(6), // padding: EdgeInsets.all(6),
// child: Text(TranslationBase.of(context).request)), // child: AppText(
// TranslationBase.of(context).request,
// color: Colors.white,
// )),
// ], // ],
// ),
// TabBarView(
// controller: _tabController, // controller: _tabController,
// children: [ // ),
// myFamilyDetails(context), //
// myFamilyRequest(context) // ),
// ], // body: TabBarView(
// ) // // physics: NeverScrollableScrollPhysics(),
// ], // children: [myFamilyDetails(context), myFamilyRequest(context)],
// )))); // controller: _tabController),
// );
// //bottomNavigationBar: BottomBarSearch());
return AppScaffold(
appBarTitle: TranslationBase.of(context).myFamilyFiles,
isShowAppBar: widget.isAppbarVisible,
body: SingleChildScrollView(
child: Container(
height: SizeConfig.screenHeight,
width: SizeConfig.realScreenWidth,
padding: EdgeInsets.all(20),
child: Stack(
children: <Widget>[
TabBar(
controller: _tabController,
indicatorColor: Colors.red,
tabs: [
Padding(
padding: EdgeInsets.all(6),
child: Text(TranslationBase.of(context).family)),
Padding(
padding: EdgeInsets.all(6),
child: Text(TranslationBase.of(context).request)),
],
),
TabBarView(
controller: _tabController,
children: [
myFamilyDetails(context),
myFamilyRequest(context)
],
)
],
))));
} }
Widget myFamilyDetails(context) { Widget myFamilyDetails(context) {
@ -218,12 +222,15 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
} }
Widget myFamilyRequest(context) { Widget myFamilyRequest(context) {
return Padding( return //Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0), // padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: SingleChildScrollView( // child:
SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height,
margin: EdgeInsets.only(top:50),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
// SizedBox(height: 20.0),
RoundedContainer( RoundedContainer(
child: ExpansionTile( child: ExpansionTile(
title: Text( title: Text(
@ -512,17 +519,19 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
} }
switchUser(user, context) { switchUser(user, context) {
Utils.showProgressDialog(context); GifLoaderDialogUtils.showMyDialog(context);
this this
.familyFileProvider .familyFileProvider
.silentLoggin(user) .silentLoggin(user)
.then((value) => loginAfter(value, context)); .then((value) => loginAfter(value, context));
} }
loginAfter(result, context) { loginAfter(result, context) async{
Utils.hideProgressDialog(); GifLoaderDialogUtils.hideDialog(context);
var familyFile = await sharedPref.getObject(FAMILY_FILE);
result = CheckActivationCode.fromJson(result); result = CheckActivationCode.fromJson(result);
this.sharedPref.clear(); this.sharedPref.clear();
this.sharedPref.setObject(FAMILY_FILE, familyFile);
this.sharedPref.setObject(USER_PROFILE, result.list); this.sharedPref.setObject(USER_PROFILE, result.list);
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);
this.sharedPref.setString(TOKEN, result.authenticationTokenID); this.sharedPref.setString(TOKEN, result.authenticationTokenID);

@ -1,11 +1,16 @@
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/service/insurance_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_details.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -21,6 +26,7 @@ class InsuranceCard extends StatefulWidget {
} }
//TODO fix it //TODO fix it
class _InsuranceCardState extends State<InsuranceCard> { class _InsuranceCardState extends State<InsuranceCard> {
InsuranceCardService _insuranceCardService = locator<InsuranceCardService>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<InsuranceViewModel>( return BaseView<InsuranceViewModel>(
@ -140,6 +146,7 @@ class _InsuranceCardState extends State<InsuranceCard> {
Container( Container(
color: Colors.transparent, color: Colors.transparent,
child: SecondaryButton( child: SecondaryButton(
onTap:()=>{ getDetails(model.insurance[index])},
label: TranslationBase.of(context).seeDetails, label: TranslationBase.of(context).seeDetails,
textColor: Colors.white, textColor: Colors.white,
), ),
@ -179,4 +186,13 @@ class _InsuranceCardState extends State<InsuranceCard> {
return newDate.toString(); return newDate.toString();
} }
getDetails(data){
GifLoaderDialogUtils.showMyDialog(context);
_insuranceCardService.getInsuranceDetails(data).then((value) => {
GifLoaderDialogUtils.hideDialog(context),
Navigator.push(context,
FadePage(page: InsuranceCardDetails(data:value[0]['CheckList'])))
});
}
} }

@ -0,0 +1,35 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:html/dom.dart' as dom;
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class InsuranceCardDetails extends StatefulWidget {
final String data;
InsuranceCardDetails({this.data});
@override
_InsuranceCardInsuranceCardDetailsState createState() => _InsuranceCardInsuranceCardDetailsState();
}
//TODO fix it
class _InsuranceCardInsuranceCardDetailsState extends State<InsuranceCardDetails> {
@override
Widget build(BuildContext context) {
return
AppScaffold(
isShowAppBar: true,
body: Center(
child: SingleChildScrollView(
child: Html(
data:widget.data,
)
)
),
);
}
}

@ -42,13 +42,13 @@ class HomePage extends StatefulWidget {
class _HomePageState extends State<HomePage> { class _HomePageState extends State<HomePage> {
ToDoCountProviderModel toDoProvider; ToDoCountProviderModel toDoProvider;
@override // @override
void initState() { // void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { // WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
getToDoCount(); // getToDoCount();
}); // });
super.initState(); // super.initState();
} // }
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
@ -57,7 +57,7 @@ class _HomePageState extends State<HomePage> {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
toDoProvider = Provider.of<ToDoCountProviderModel>(context); toDoProvider = Provider.of<ToDoCountProviderModel>(context);
return BaseView<DashboardViewModel>( return BaseView<DashboardViewModel>(
onModelReady: (model) => model.getPatientRadOrders(), onModelReady: (model) => {},//model.getPatientRadOrders(),
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
isShowDecPage: false, isShowDecPage: false,
body: Container( body: Container(

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart'; import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart';
import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart'; import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart';
@ -85,7 +86,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
print(route.settings.name); print(route.settings.name);
} }
setState(() { //setState(() {
print("didChangeAppLifecycleState"); print("didChangeAppLifecycleState");
print('state = $state'); print('state = $state');
AppGlobal.context = context; AppGlobal.context = context;
@ -113,7 +114,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
if (state == AppLifecycleState.inactive) { if (state == AppLifecycleState.inactive) {
isPageNavigated = false; isPageNavigated = false;
} }
}); //});
} }
@override @override
@ -126,9 +127,9 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
void initState() { void initState() {
super.initState(); super.initState();
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
setState(() { //setState(() {
AppGlobal.context = context; AppGlobal.context = context;
}); // });
_requestIOSPermissions(); _requestIOSPermissions();
pageController = PageController(keepPage: true); pageController = PageController(keepPage: true);
_firebaseMessaging.setAutoInitEnabled(true); _firebaseMessaging.setAutoInitEnabled(true);
@ -139,7 +140,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
_firebaseMessaging.getToken().then((String token) { _firebaseMessaging.getToken().then((String token) {
sharedPref.setString(PUSH_TOKEN, token); sharedPref.setString(PUSH_TOKEN, token);
if (token != null) { if (token != null && DEVICE_TOKEN =="") {
DEVICE_TOKEN = token; DEVICE_TOKEN = token;
checkUserStatus(token); checkUserStatus(token);
} }
@ -387,7 +388,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
), ),
MedicalProfilePage(), MedicalProfilePage(),
BookingOptions(), BookingOptions(),
Container(), MyFamily(isAppbarVisible:false),
ToDo(), ToDo(),
], // Please do not remove the BookingOptions from this array ], // Please do not remove the BookingOptions from this array
), ),
@ -432,11 +433,10 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
var data = var data =
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
if (data != null) if (data != null)
authService.registeredAuthenticatedUser(data, token, 0, 0); authService
// setState(() { .registeredAuthenticatedUser(data, token, 0, 0)
// this.user = data; .then((res) => {print(res)});
// print(this.user);
// });
} }
} }

@ -291,7 +291,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
checkUserAuthentication(type) { checkUserAuthentication(type) {
showLoader(true); showLoader(true);
var req = getCommonRequest(); var req = getCommonRequest(type: type);
req.logInTokenID = "";
var request = CheckPatientAuthenticationReq.fromJson(req.toJson()); var request = CheckPatientAuthenticationReq.fromJson(req.toJson());
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
@ -321,7 +323,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
} }
sendActivationCode(type) async { sendActivationCode(type) async {
var request = this.getCommonRequest(); var request = this.getCommonRequest(type: type);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await this.authService.sendActivationCode(request).then((result) { await this.authService.sendActivationCode(request).then((result) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -352,11 +354,17 @@ class _ConfirmLogin extends State<ConfirmLogin> {
localizedReason: 'Scan your fingerprint to authenticate', localizedReason: 'Scan your fingerprint to authenticate',
useErrorDialogs: true, useErrorDialogs: true,
stickyAuth: true); stickyAuth: true);
print(authenticated);
if (authenticated == true) { if (authenticated == true) {
var request = this.getCommonRequest();
if(user.logInType==2 || user.logInType ==3){
this.checkActivationCode();
}else{
var request = this.getCommonRequest(type: type);
this.getMobileInfo(request); this.getMobileInfo(request);
} }
}
} }
} }
@ -444,30 +452,40 @@ class _ConfirmLogin extends State<ConfirmLogin> {
//this.cs.sharedService.getStorage(AuthenticationService.LAST_LOGIN); //this.cs.sharedService.getStorage(AuthenticationService.LAST_LOGIN);
} }
getCommonRequest() { getCommonRequest({type}) {
var request = SendActivationRequest(); var request = SendActivationRequest();
request.patientMobileNumber = this.mobileNumber; request.patientMobileNumber = this.mobileNumber;
request.mobileNo = '0' + this.mobileNumber.toString(); request.mobileNo = '0' + this.mobileNumber.toString();
request.deviceToken = this.deviceToken; request.deviceToken = this.deviceToken;
request.projectOutSA = this.patientOutSA == true ? 1 : 0; request.projectOutSA = this.patientOutSA == true ? true : false;
request.loginType = this.selectedOption; request.loginType = this.selectedOption;
request.oTPSendType = this.selectedOption == 1 ? 1 : 2; request.oTPSendType =
type == 1 ? type : 2; //this.selectedOption == 1 ? 1 : 2;
request.zipCode = this.zipCode; request.zipCode = this.zipCode;
request.logInTokenID = this.loginTokenID ?? ""; request.logInTokenID = this.loginTokenID ?? "";
if (this.registerd_data != null) { if (this.registerd_data != null) {
request.searchType = this.registerd_data.searchType ?? 1; request.searchType = this.registerd_data.searchType != null
request.patientID = this.registerd_data.patientID ?? 0; ? this.registerd_data.searchType
: 1;
request.patientID = this.registerd_data.patientID != null
? this.registerd_data.patientID
: 0;
request.patientIdentificationID = request.nationalID = request.patientIdentificationID = request.nationalID =
this.registerd_data.patientIdentificationID ?? '0'; this.registerd_data.patientIdentificationID != null
? this.registerd_data.patientIdentificationID
: '0';
request.isRegister = this.registerd_data.isRegister; request.isRegister = this.registerd_data.isRegister;
} else { } else {
request.searchType = request.searchType ?? 2; request.searchType = request.searchType != null ? request.searchType : 2;
request.patientID = this.user.patientID ?? 0; request.patientID = this.user.patientID != null ? this.user.patientID : 0;
request.nationalID = request.nationalID ?? '0'; request.nationalID =
request.patientIdentificationID = request.patientIdentificationID ?? '0'; request.nationalID != null ? request.nationalID : '0';
request.patientIdentificationID = request.patientIdentificationID != null
? request.patientIdentificationID
: '0';
request.isRegister = false; request.isRegister = false;
} }
request.deviceTypeID = request.searchType; request.deviceTypeID = request.searchType;
@ -493,8 +511,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
} }
else else
{ {
result.list.isFamily = false,
userData = result.list, userData = result.list,
//AuthenticatedUser.fromJson(result['List'][0]), sharedPref.setObject(MAIN_USER, result.list),
sharedPref.setObject(USER_PROFILE, result.list), sharedPref.setObject(USER_PROFILE, result.list),
loginTokenID = result.logInTokenID, loginTokenID = result.logInTokenID,
sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),

@ -14,7 +14,7 @@ class LoginType extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).welcome, appBarTitle: TranslationBase.of(context).login,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
body: Padding( body: Padding(
@ -73,7 +73,7 @@ class LoginType extends StatelessWidget {
), ),
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context)
.nationalID, .idNo,
fontSize: fontSize:
SizeConfig.textMultiplier * SizeConfig.textMultiplier *
2, 2,
@ -122,6 +122,7 @@ class LoginType extends StatelessWidget {
)))) ))))
], ],
), ),
SizedBox(height: 25,),
Divider( Divider(
color: Colors.grey, color: Colors.grey,
height: 2, height: 2,
@ -144,8 +145,14 @@ class LoginType extends StatelessWidget {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
Divider(
color: Colors.grey,
height: 2,
),
SizedBox(height: 10,),
Row( Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).registerNow, TranslationBase.of(context).registerNow,

@ -16,6 +16,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.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/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -116,6 +117,11 @@ class _Login extends State<Login> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
Divider(
color: Colors.grey,
height: 2,
),
SizedBox(height: 10,),
Row( Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
@ -195,8 +201,22 @@ class _Login extends State<Login> {
} }
}) })
.catchError((err) { .catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: err,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {
ConfirmDialog.closeAlertDialog(context),
Navigator.of(context).pushNamed(
REGISTER,
),
},
cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)});
dialog.showAlertDialog(context);
}); });
// SMSOTP.showLoadingDialog(context, false), // SMSOTP.showLoadingDialog(context, false),
} }
@ -222,7 +242,9 @@ class _Login extends State<Login> {
// request.isRegister = false; // request.isRegister = false;
this.authService.checkActivationCode(request, code).then((result) => { this.authService.checkActivationCode(request, code).then((result) => {
result = CheckActivationCode.fromJson(result), result = CheckActivationCode.fromJson(result),
result.list.isFamily =false,
this.sharedPref.setObject(USER_PROFILE, result.list), this.sharedPref.setObject(USER_PROFILE, result.list),
this.sharedPref.setObject(MAIN_USER, result.list),
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
this.sharedPref.setString(TOKEN, result.authenticationTokenID), this.sharedPref.setString(TOKEN, result.authenticationTokenID),
authenticatedUserObject.getUser(), authenticatedUserObject.getUser(),

@ -8,9 +8,11 @@ import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.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/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
@ -86,7 +88,9 @@ class _RegisterInfo extends State<RegisterInfo> {
Container( Container(
margin: EdgeInsets.only(bottom: 10), margin: EdgeInsets.only(bottom: 10),
child: TextFields( child: TextFields(
hintText: registerInfo.firstNameEn, hintText: registerInfo.firstNameEn == '-'
? registerInfo.firstNameAr
: registerInfo.firstNameEn,
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10), top: 20, bottom: 20, left: 10, right: 10),
readOnly: true, readOnly: true,
@ -95,7 +99,9 @@ class _RegisterInfo extends State<RegisterInfo> {
Container( Container(
margin: EdgeInsets.only(bottom: 10), margin: EdgeInsets.only(bottom: 10),
child: TextFields( child: TextFields(
hintText: registerInfo.secondNameEn, hintText: registerInfo.secondNameEn == '-'
? registerInfo.secondNameAr
: registerInfo.secondNameEn,
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10), top: 20, bottom: 20, left: 10, right: 10),
readOnly: true, readOnly: true,
@ -104,7 +110,9 @@ class _RegisterInfo extends State<RegisterInfo> {
Container( Container(
margin: EdgeInsets.only(bottom: 10), margin: EdgeInsets.only(bottom: 10),
child: TextFields( child: TextFields(
hintText: registerInfo.lastNameEn, hintText: registerInfo.lastNameEn == '-'
? registerInfo.lastNameAr
: registerInfo.lastNameEn,
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10), top: 20, bottom: 20, left: 10, right: 10),
readOnly: true, readOnly: true,
@ -202,7 +210,7 @@ class _RegisterInfo extends State<RegisterInfo> {
child: DropdownButtonHideUnderline( child: DropdownButtonHideUnderline(
child: DropdownButton( child: DropdownButton(
isExpanded: true, isExpanded: true,
value: language, value: location,
iconSize: 40, iconSize: 40,
elevation: 16, elevation: 16,
onChanged: (value) => { onChanged: (value) => {
@ -269,16 +277,45 @@ class _RegisterInfo extends State<RegisterInfo> {
registerNow() { registerNow() {
dynamic request = getTempUserRequest(); dynamic request = getTempUserRequest();
GifLoaderDialogUtils.showMyDialog(context);
this.authService.registerUser(request).then((result) => { this.authService.registerUser(request).then((result) => {
print(result), GifLoaderDialogUtils.hideDialog(context),
// userData = result.list; // userData = result.list;
//AuthenticatedUser.fromJson(result['List'][0]), //AuthenticatedUser.fromJson(result['List'][0]),
sharedPref.setObject(USER_PROFILE, result.list), if(result is String){
new ConfirmDialog(
context: context,
confirmMessage: result,
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {
ConfirmDialog.closeAlertDialog(context)
},
cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)})
.showAlertDialog(context)
}else
{
result.list.isFamily = false,
sharedPref.setObject(USER_PROFILE, result.list),
this.sharedPref.setObject(MAIN_USER, result.list),
sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
sharedPref.setString(TOKEN, result.authenticationTokenID), sharedPref.setString(TOKEN, result.authenticationTokenID),
Navigator.of(context).pushNamed(HOME) Navigator.of(context).pushNamed(HOME)
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: err,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {
ConfirmDialog.closeAlertDialog(context)
},
cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)});
dialog.showAlertDialog(context);
}); });
} }
@ -310,9 +347,12 @@ class _RegisterInfo extends State<RegisterInfo> {
"PatientIdentificationNo": registerInfo.idNumber, "PatientIdentificationNo": registerInfo.idNumber,
"MobileNumber": registerd_data.patientMobileNumber, "MobileNumber": registerd_data.patientMobileNumber,
"PatientOutSA": registerd_data.zipCode == '966' ? 0 : 1, "PatientOutSA": registerd_data.zipCode == '966' ? 0 : 1,
"FirstName": registerInfo.firstNameEn, "FirstNameN":registerInfo.firstNameAr =='-' ?"": registerInfo.firstNameAr,
"MiddleName": registerInfo.secondNameEn, "FirstName": registerInfo.firstNameEn =='-' ?"":registerInfo.firstNameEn,
"LastName": registerInfo.lastNameEn, "MiddleNameN":registerInfo.secondNameAr =='-' ? "" : registerInfo.secondNameAr,
"MiddleName":registerInfo.secondNameEn == '-' ? "": registerInfo.secondNameEn,
"LastNameN": registerInfo.lastNameAr =='-'? "" : registerInfo.lastNameAr,
"LastName": registerInfo.lastNameEn =='-' ? "": registerInfo.lastNameEn,
"StrDateofBirth": registerInfo.dateOfBirth, "StrDateofBirth": registerInfo.dateOfBirth,
"DateofBirth": DateUtil.convertISODateToJsonDate( "DateofBirth": DateUtil.convertISODateToJsonDate(
registerInfo.dateOfBirth.replaceAll('/', '-')), registerInfo.dateOfBirth.replaceAll('/', '-')),
@ -331,30 +371,6 @@ class _RegisterInfo extends State<RegisterInfo> {
"PatientIdentificationID": registerInfo.idNumber, "PatientIdentificationID": registerInfo.idNumber,
"PatientMobileNumber": registerd_data.patientMobileNumber, "PatientMobileNumber": registerd_data.patientMobileNumber,
}; };
// var patientObject ={};
// var request ={};
// patientObject['PatientIdentificationType'] = this.identificationType;
// patientObject['PatientIdentificationNo'] = this.id;
// request['PatientIdentificationID'] = this.id;
// request['PatientMobileNumber'] = this.registerInfo.MobileNumber;
// patientObject['MobileNumber'] = this.registerInfo.MobileNumber;
// patientObject['PatientOutSA'] = this.registerInfo.PatientOutSA;
// request['LogInTokenID'] = this.registerInfo.LogInTokenID;
// request['activationCode'] = this.registerInfo.activationCode;
// request['ProjectID'] = this.selectedProjectID;
// patientObject['ProjectID'] = this.selectedProjectID;
// request
// request.setBirthDate(this.dateOfBirth, this.cs.convertISODateToJsonDate(this.dateOfBirth));
// request.setGender(this.gender);
// request.Patientobject.NationalityID = this.selectedNationalityID;
// request.Patientobject.StrDateofBirth = this.dateOfBirth;
// request.Patientobject.DateofBirthN = this.dateHijri;
// request.Patientobject.EmailAddress = this.eMail;
// request.Patientobject.SourceType = this.iSOCountryID
// request.Patientobject.PreferredLanguage = this.preferredLanguage
// request.Patientobject.Marital = this.maritalStatus;
//return request;
} }
bool isValid() { bool isValid() {

@ -8,11 +8,14 @@ import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -46,9 +49,7 @@ class _Register extends State<Register> {
appBarTitle: TranslationBase.of(context).register, appBarTitle: TranslationBase.of(context).register,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
body: isLoading == true body: SingleChildScrollView(
? AppCircularProgressIndicator()
: SingleChildScrollView(
child: Container( child: Container(
padding: padding:
EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30),
@ -120,8 +121,12 @@ class _Register extends State<Register> {
), ),
], ],
), ),
Row(children: <Widget>[ Row(
Expanded( mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Container(
width: SizeConfig.realScreenWidth * .9,
height:60,
child: isHijri == 1 child: isHijri == 1
? TextFields( ? TextFields(
onChanged: (value) => {dob = value}, onChanged: (value) => {dob = value},
@ -129,6 +134,11 @@ class _Register extends State<Register> {
prefixIcon: Icon(Icons.date_range), prefixIcon: Icon(Icons.date_range),
) )
: RaisedButton.icon( : RaisedButton.icon(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15.0),
),
color:Colors.white,
onPressed: () => { onPressed: () => {
if (isHijri != null) if (isHijri != null)
_selectDate(context) _selectDate(context)
@ -147,6 +157,11 @@ class _Register extends State<Register> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
Divider(
color: Colors.grey,
height: 2,
),
SizedBox(height: 10,),
Row( Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
@ -196,11 +211,28 @@ class _Register extends State<Register> {
} }
checkPatientForRegisteration(request) { checkPatientForRegisteration(request) {
showLoader(true); GifLoaderDialogUtils.showMyDialog(context);
this this
.authService .authService
.checkPatientForRegisteration(request) .checkPatientForRegisteration(request)
.then((response) => {checkUserStatus(response, request)}); .then((response) => {checkUserStatus(response, request)}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: err,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {
ConfirmDialog.closeAlertDialog(context),
Navigator.of(context).pushNamed(
REGISTER,
),
},
cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)});
dialog.showAlertDialog(context);
});
} }
void validateForm() { void validateForm() {
@ -219,12 +251,20 @@ class _Register extends State<Register> {
} }
checkUserStatus(response, CheckPatientForRegistration request) async { checkUserStatus(response, CheckPatientForRegistration request) async {
showLoader(false); GifLoaderDialogUtils.hideDialog(context);
if (response is Map) { if (response is Map) {
var nRequest = request.toJson(); var nRequest = request.toJson();
nRequest['LogInTokenID'] = response['LogInTokenID']; nRequest['LogInTokenID'] = response['LogInTokenID'];
if (response['hasFile'] == true) { if (response['hasFile'] == true) {
AppToast.showErrorToast(message: response['ErrorEndUserMessage']); // AppToast.showErrorToast(message: response['ErrorEndUserMessage']);
AlertDialogBox(
context: context,
confirmMessage: response['ErrorEndUserMessage'],
okText: TranslationBase.of(context).ok,
okFunction: () {
AlertDialogBox.closeAlertDialog(context);
Navigator.of(context).pop();
}).showAlertDialog(context);
} else { } else {
nRequest['forRegister'] = true; nRequest['forRegister'] = true;
nRequest['isRegister'] = true; nRequest['isRegister'] = true;
@ -236,7 +276,15 @@ class _Register extends State<Register> {
} }
} else { } else {
// if (response['ErrorCode'] == '-986') { // if (response['ErrorCode'] == '-986') {
AppToast.showErrorToast(message: response); //AppToast.showErrorToast(message: response);
AlertDialogBox(
context: context,
confirmMessage: response,
okText: TranslationBase.of(context).ok,
okFunction: () {
AlertDialogBox.closeAlertDialog(context);
Navigator.of(context).pop();
}).showAlertDialog(context);
//} //}
} }
} }

@ -1,7 +1,15 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:diplomaticquarterapp/theme/theme_notifier.dart';
import 'package:diplomaticquarterapp/theme/theme_value.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:screen/screen.dart';
class GeneralSettings extends StatefulWidget { class GeneralSettings extends StatefulWidget {
@override @override
@ -10,15 +18,30 @@ class GeneralSettings extends StatefulWidget {
class _GeneralSettings extends State<GeneralSettings> class _GeneralSettings extends State<GeneralSettings>
with TickerProviderStateMixin { with TickerProviderStateMixin {
var themeNotifier;
int blindValue = 0;
bool vibration =false;
bool accessibility =false;
bool camera =false;
bool location =false;
var sharedPref = new AppSharedPreferences();
var permission = new PermissionService();
@override
void initState() {
getValues();
super.initState();
}
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isVibration = true;
var bindValue; themeNotifier = Provider.of<ThemeNotifier>(context);
return Container( return Container(
child: ListView(scrollDirection: Axis.vertical, children: <Widget>[ child: ListView(scrollDirection: Axis.vertical, children: <Widget>[
Container( Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: AppText( child: AppText(
'Modes', TranslationBase.of(context).modes,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@ -29,13 +52,15 @@ class _GeneralSettings extends State<GeneralSettings>
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text('Vibration touch feedback'), AppText(TranslationBase.of(context).vibration),
Switch( Switch(
value: isVibration, value: vibration,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
isVibration = value; vibration = value;
}); });
setVibration(value);
}, },
activeTrackColor: Colors.lightGreenAccent, activeTrackColor: Colors.lightGreenAccent,
activeColor: Colors.green, activeColor: Colors.green,
@ -48,12 +73,12 @@ class _GeneralSettings extends State<GeneralSettings>
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text('Accsibility Mode'), AppText(TranslationBase.of(context).accessibility),
Switch( Switch(
value: isVibration, value: accessibility,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
isVibration = value; accessibility = value;
}); });
}, },
activeTrackColor: Colors.lightGreenAccent, activeTrackColor: Colors.lightGreenAccent,
@ -64,7 +89,7 @@ class _GeneralSettings extends State<GeneralSettings>
Container( Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: AppText( child: AppText(
'Modes for Partially Blind', TranslationBase.of(context).blindMode,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@ -82,14 +107,15 @@ class _GeneralSettings extends State<GeneralSettings>
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
new Text( new Text(
'Off', TranslationBase.of(context).offTheme,
style: new TextStyle(fontSize: 16.0), style: new TextStyle(fontSize: 16.0),
), ),
new Radio( Radio(
value: 0, value: 0,
groupValue: bindValue, groupValue: blindValue,
onChanged: (value) { onChanged: (value) {
bindValue = value; setState(() => {this.blindValue = value});
setTheme(value);
}, },
), ),
], ],
@ -98,16 +124,17 @@ class _GeneralSettings extends State<GeneralSettings>
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
new Text( new Text(
'Invert', TranslationBase.of(context).invertTheme,
style: new TextStyle( style: new TextStyle(
fontSize: 16.0, fontSize: 16.0,
), ),
), ),
new Radio( new Radio(
value: 1, value: 1,
groupValue: bindValue, groupValue: blindValue,
onChanged: (value) { onChanged: (value) {
bindValue = value; setState(() => {this.blindValue = value});
setTheme(value);
}, },
) )
], ],
@ -116,14 +143,15 @@ class _GeneralSettings extends State<GeneralSettings>
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
new Text( new Text(
'Dim', TranslationBase.of(context).dimTheme,
style: new TextStyle(fontSize: 16.0), style: new TextStyle(fontSize: 16.0),
), ),
new Radio( new Radio(
value: 2, value: 2,
groupValue: bindValue, groupValue: blindValue,
onChanged: (value) { onChanged: (value) {
bindValue = value; setState(() => {this.blindValue = value});
setTheme(value);
}, },
), ),
], ],
@ -132,14 +160,16 @@ class _GeneralSettings extends State<GeneralSettings>
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
new Text( new Text(
'Black and White', TranslationBase.of(context).bwTheme,
style: new TextStyle(fontSize: 16.0), style: new TextStyle(fontSize: 16.0),
), ),
new Radio( new Radio(
value: 2, value: 3,
groupValue: bindValue, groupValue: blindValue,
onChanged: (value) { onChanged: (value) {
bindValue = value; setState(() => {this.blindValue = value});
setTheme(value);
}, },
), ),
], ],
@ -150,7 +180,7 @@ class _GeneralSettings extends State<GeneralSettings>
Container( Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: AppText( child: AppText(
'Permission', TranslationBase.of(context).permissions,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@ -161,12 +191,12 @@ class _GeneralSettings extends State<GeneralSettings>
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text('Camera'), AppText(TranslationBase.of(context).cameraPermission),
Switch( Switch(
value: isVibration, value: camera,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
isVibration = value; camera = value;
}); });
}, },
activeTrackColor: Colors.lightGreenAccent, activeTrackColor: Colors.lightGreenAccent,
@ -180,12 +210,12 @@ class _GeneralSettings extends State<GeneralSettings>
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text('Location'), AppText(TranslationBase.of(context).locationPermission),
Switch( Switch(
value: isVibration, value: location,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
isVibration = value; location = value;
}); });
}, },
activeTrackColor: Colors.lightGreenAccent, activeTrackColor: Colors.lightGreenAccent,
@ -195,4 +225,165 @@ class _GeneralSettings extends State<GeneralSettings>
)) ))
])); ]));
} }
setTheme(value) async{
switch (value) {
case 0:
{
themeNotifier.setTheme(await getTheme(value));
Screen.setBrightness(1.0);
}
break;
case 1:
{
themeNotifier.setTheme(await getTheme(value));
Screen.setBrightness(1.0);
}
break;
case 2:
themeNotifier.setTheme(await getTheme(value));
Screen.setBrightness(0.01);
break;
case 3:
{
themeNotifier.setTheme(await getTheme(value));
Screen.setBrightness(1.0);
}
break;
default:
{
themeNotifier.setTheme(await getTheme(value));
Screen.setBrightness(1.0);
}
break;
}
permission.setTheme(value);
}
setVibration(value){
permission.setVibrationPermission(value);
}
getValues() async{
blindValue= permission.isThemeEnabled() == null ? 0 : permission.isThemeEnabled();
vibration = permission.isVibrationEnabled() ==null ? false : permission.isVibrationEnabled();
}
getTheme(value) async{
if(value ==1){
return ThemeData(
fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'ar' ? 'Cairo' : 'WorkSans',
primarySwatch: Colors.grey,
visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light,
pageTransitionsTheme: const PageTransitionsTheme(
builders: {
TargetPlatform.android: ZoomPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
},
),
hintColor: Colors.grey[400],
cardColor: Colors.black,
buttonColor: Colors.grey[400],
disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: Colors.grey,
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white,
backgroundColor: Colors.grey,
highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent,
primaryColor: Colors.grey,
bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
cursorColor: Colors.grey,
iconTheme: IconThemeData(),
appBarTheme: AppBarTheme(
color: Colors.grey,
brightness: Brightness.dark,
elevation: 10.0,
actionsIconTheme: IconThemeData(
color: Colors.grey,
),
),
);
}else if(value ==3){
return ThemeData(
fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'ar' ? 'Cairo' : 'WorkSans',
primarySwatch: Colors.grey,
visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light,
pageTransitionsTheme: const PageTransitionsTheme(
builders: {
TargetPlatform.android: ZoomPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
},
),
hintColor: Colors.grey[400],
cardColor: Colors.black,
buttonColor: Colors.grey[400],
disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: Colors.grey,
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white,
backgroundColor: Colors.grey,
highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent,
primaryColor: Colors.grey,
bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
cursorColor: Colors.grey,
iconTheme: IconThemeData(),
appBarTheme: AppBarTheme(
color: Colors.black45,
brightness: Brightness.dark,
elevation: 10.0,
actionsIconTheme: IconThemeData(
color: Colors.grey,
),
),
);
}else {
return ThemeData(
fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'ar' ? 'Cairo' : 'WorkSans',
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light,
pageTransitionsTheme: const PageTransitionsTheme(
builders: {
TargetPlatform.android: ZoomPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
},
),
hintColor: Colors.grey[400],
disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: Color(0xffEEEEEE),
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white,
backgroundColor: Colors.white,
highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent,
primaryColor: Color(0xff40ACC9),
bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
cursorColor: Colors.grey,
cardColor: Colors.white,
iconTheme: IconThemeData(),
appBarTheme: AppBarTheme(
color: Color(0xff40ACC9),
brightness: Brightness.dark,
elevation: 10.0,
actionsIconTheme: IconThemeData(
color: Color(0xff40ACC9),
),
),
);
}
}
} }

@ -1,3 +1,5 @@
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -15,19 +17,22 @@ class _ProfileSettings extends State<ProfileSettings>
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isVibration = true; bool isVibration = true;
var language = 1; var language = 1;
return Container( return BaseView<DashboardViewModel>(
child: ListView(scrollDirection: Axis.vertical, children: <Widget>[ onModelReady: (model) => model.getPatientRadOrders(),
builder: (_, model, wi) => Container(
child:
ListView(scrollDirection: Axis.vertical, children: <Widget>[
Container( Container(
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
AppText( AppText(
'File No', TranslationBase.of(context).fileNo,
color: Colors.black, color: Colors.black,
), ),
AppText( AppText(
'124545', model.user.patientID.toString(),
color: Colors.black, color: Colors.black,
), ),
], ],
@ -41,17 +46,18 @@ class _ProfileSettings extends State<ProfileSettings>
), ),
), ),
Padding( Padding(
child: AppText('SMS and Confirmation Calls Language ', child: AppText(TranslationBase.of(context).languageSetting,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
), ),
Container( Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
AppText('English'), AppText(TranslationBase.of(context).english),
new Radio( new Radio(
value: 2, value: 2,
groupValue: language, groupValue: language,
@ -63,11 +69,12 @@ class _ProfileSettings extends State<ProfileSettings>
)), )),
Container( Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
AppText('Arabic'), AppText(TranslationBase.of(context).arabic),
new Radio( new Radio(
value: 1, value: 1,
groupValue: language, groupValue: language,
@ -78,16 +85,17 @@ class _ProfileSettings extends State<ProfileSettings>
], ],
)), )),
Padding( Padding(
child: AppText('Alert'), child: AppText(TranslationBase.of(context).alert),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
), ),
Container( Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
AppText('Alert by Email'), AppText(TranslationBase.of(context).emailAlert),
Switch( Switch(
value: isVibration, value: isVibration,
onChanged: (value) { onChanged: (value) {
@ -102,11 +110,12 @@ class _ProfileSettings extends State<ProfileSettings>
)), )),
Container( Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
AppText('Alert by SMS'), AppText(TranslationBase.of(context).smsAlert),
Switch( Switch(
value: isVibration, value: isVibration,
onChanged: (value) { onChanged: (value) {
@ -120,28 +129,32 @@ class _ProfileSettings extends State<ProfileSettings>
], ],
)), )),
Padding( Padding(
child: AppText('Alert'), child: AppText(TranslationBase.of(context).contactInfo),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
), ),
Container( Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText('Email'), AppText(TranslationBase.of(context).email),
TextField( TextField(
style: TextStyle(color: Colors.red), style: TextStyle(color: Colors.red),
) decoration: InputDecoration(
suffixIcon: Icon(Icons.edit),
))
], ],
)), )),
Container( Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText('Emergency contact name'), AppText(TranslationBase.of(context).emergencyName),
TextField( TextField(
style: TextStyle(color: Colors.red), style: TextStyle(color: Colors.red),
decoration: InputDecoration( decoration: InputDecoration(
@ -151,11 +164,12 @@ class _ProfileSettings extends State<ProfileSettings>
)), )),
Container( Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText('Emergency contact number'), AppText(TranslationBase.of(context).emergencyContact),
TextField( TextField(
style: TextStyle(color: Colors.red), style: TextStyle(color: Colors.red),
decoration: InputDecoration( decoration: InputDecoration(
@ -177,6 +191,6 @@ class _ProfileSettings extends State<ProfileSettings>
)), )),
], ],
)) ))
])); ])));
} }
} }

@ -233,7 +233,7 @@ class AuthProvider with ChangeNotifier {
neRequest.languageID = LANGUAGE_ID; neRequest.languageID = LANGUAGE_ID;
neRequest.deviceTypeID = DeviceTypeID; neRequest.deviceTypeID = DeviceTypeID;
neRequest.patientOutSA = neRequest.zipCode == '966' ? 0 : 1; neRequest.patientOutSA = neRequest.zipCode == '966' ? 0 : 1;
neRequest.projectOutSA = neRequest.zipCode == '966' ? 0 : 1; neRequest.projectOutSA = neRequest.zipCode == '966' ? false : true;
neRequest.isDentalAllowedBackend = false; neRequest.isDentalAllowedBackend = false;
neRequest.forRegisteration = neRequest.forRegisteration =
neRequest.isRegister != null ? neRequest.isRegister : false; neRequest.isRegister != null ? neRequest.isRegister : false;
@ -345,11 +345,14 @@ class AuthProvider with ChangeNotifier {
request.gender = user.gender; request.gender = user.gender;
request.patientID = user.patientID; request.patientID = user.patientID;
request.patientOutSA = user.outSA; request.patientOutSA = user.outSA;
request.loginType = await sharedPref.getInt(LAST_LOGIN) ?? 1; request.loginType = await sharedPref.getInt(LAST_LOGIN) != null
? await sharedPref.getInt(LAST_LOGIN)
: 1;
request.mACAddress = '00:00:00:00:00:00'; request.mACAddress = '00:00:00:00:00:00';
request.latitude = lat; request.latitude = lat;
request.longitude = long; request.longitude = long;
request.languageID = int.parse(user.preferredLanguage); request.languageID = int.parse(user.preferredLanguage);
request.patientTypeID = 2;
dynamic localRes; dynamic localRes;
try { try {
await new BaseAppClient().post(LOGGED_IN_USER_URL, await new BaseAppClient().post(LOGGED_IN_USER_URL,

@ -55,6 +55,7 @@ class FamilyFilesProvider with ChangeNotifier {
AppToast.showErrorToast(message: error); AppToast.showErrorToast(message: error);
throw error; throw error;
}, body: request.toJson()); }, body: request.toJson());
sharedPref.setObject(FAMILY_FILE, localRes); sharedPref.setObject(FAMILY_FILE, localRes);
return Future.value( return Future.value(
GetAllSharedRecordsByStatusResponse.fromJson(localRes)); GetAllSharedRecordsByStatusResponse.fromJson(localRes));
@ -64,7 +65,8 @@ class FamilyFilesProvider with ChangeNotifier {
} }
} }
Future<GetAllSharedRecordsByStatusResponse> getUserViewRequest(responseID) async { Future<GetAllSharedRecordsByStatusResponse> getUserViewRequest(
responseID) async {
try { try {
dynamic localRes; dynamic localRes;
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
@ -75,11 +77,12 @@ class FamilyFilesProvider with ChangeNotifier {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
return Future.error(error); return Future.error(error);
}, body: request); }, body: request);
if(localRes!=null){ if (localRes != null) {
sharedPref.setObject(FAMILY_FILE, localRes); sharedPref.setObject(FAMILY_FILE, localRes);
allSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse.fromJson(localRes); allSharedRecordsByStatusResponse =
return Future.value(allSharedRecordsByStatusResponse);} GetAllSharedRecordsByStatusResponse.fromJson(localRes);
else return Future.value(allSharedRecordsByStatusResponse);
} else
return Future.error("No Data"); return Future.error("No Data");
} catch (error) { } catch (error) {
print(error); print(error);
@ -157,7 +160,7 @@ class FamilyFilesProvider with ChangeNotifier {
request.zipCode = zipCode; request.zipCode = zipCode;
request.patientMobileNumber = int.parse(cellNumber); request.patientMobileNumber = int.parse(cellNumber);
request.patientIdentificationID = patientIdentificationID; request.patientIdentificationID = patientIdentificationID;
request.projectOutSA = zipCode == '966' ? 0 : 1; request.projectOutSA = zipCode == '966' ? false : true;
request.loginType = request.searchType = 1; request.loginType = request.searchType = 1;
request.oTPSendType = 1; request.oTPSendType = 1;
request.isRegister = false; request.isRegister = false;
@ -175,6 +178,7 @@ class FamilyFilesProvider with ChangeNotifier {
throw error; throw error;
} }
} }
//TODO //TODO
Future<dynamic> checkActivationCode( Future<dynamic> checkActivationCode(
loginTokenID, activationCode, indentification, mobileNo) async { loginTokenID, activationCode, indentification, mobileNo) async {
@ -243,29 +247,42 @@ class FamilyFilesProvider with ChangeNotifier {
} }
Future<dynamic> silentLoggin(GetAllSharedRecordsByStatusList switchUser, Future<dynamic> silentLoggin(GetAllSharedRecordsByStatusList switchUser,
{onSuccess}) async { {onSuccess, mainUser}) async {
//var currentUser = this.authService.getAuthenticatedUser(); Map<String, dynamic> request = {};
if(mainUser ==true){
var currentUser =
AuthenticatedUser.fromJson(await sharedPref.getObject(MAIN_USER));
//const request = new SwitchUserRequest();
request['LogInTokenID'] = '';
request['PatientOutSA'] = currentUser.outSA; //? 1 : 0;
request['PatientMobileNumber'] =
currentUser.mobileNumber; //['MobileNumber'];
request['SearchType'] = 2;
request['SuperUser'] = currentUser.patientID; //currentUser.PatientID;
request['PatientIdentificationID'] = '';
request['IsSilentLogin'] = true;
request['PatientID'] = currentUser.patientID; //['PatientID'];
request['ZipCode'] = currentUser.outSA == 1 ? "971" : "966";
request['activationCode'] = '0000';
request['isRegister'] = false;
}else {
var currentUser = var currentUser =
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
//const request = new SwitchUserRequest(); //const request = new SwitchUserRequest();
Map<String, dynamic> request = {};
request['LogInTokenID'] = ''; request['LogInTokenID'] = '';
request['PatientOutSA'] = currentUser.outSA; //? 1 : 0; request['PatientOutSA'] = currentUser.outSA; //? 1 : 0;
request['PatientMobileNumber'] = request['PatientMobileNumber'] =
switchUser.mobileNumber; //['MobileNumber']; switchUser.mobileNumber; //['MobileNumber'];
request['SearchType'] = 2; request['SearchType'] = 2;
request['SuperUser'] = currentUser.patientID; //currentUser.PatientID; request['SuperUser'] = switchUser.patientID; //currentUser.PatientID;
request['PatientIdentificationID'] = ''; request['PatientIdentificationID'] = '';
request['IsSilentLogin'] = true; request['IsSilentLogin'] = true;
if (switchUser.mobileNumber != null && request['PatientID'] = switchUser.responseID; //['PatientID'];
switchUser.patientID != currentUser.patientID) {
request['PatientID'] = switchUser.patientID; //['PatientID'];
} else {
request['PatientID'] = switchUser.responseID; //['ResponseID'];
}
request['ZipCode'] = currentUser.outSA == 1 ? "971" : "966"; request['ZipCode'] = currentUser.outSA == 1 ? "971" : "966";
request['activationCode'] = '0000'; request['activationCode'] = '0000';
request['isRegister'] = false; request['isRegister'] = false;
}
try { try {
dynamic localRes; dynamic localRes;

@ -0,0 +1,32 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/material.dart';
import 'package:localstorage/localstorage.dart';
class PermissionService extends BaseService {
final LocalStorage storage = new LocalStorage("permission");
AppGlobal appGlobal = new AppGlobal();
setVibrationPermission(flag) async {
storage.setItem('isVibration', flag);
}
isVibrationEnabled() {
return storage.getItem('isVibration');
}
setTheme(flag) async {
storage.setItem('isTheme', flag);
}
isThemeEnabled() {
return storage.getItem('isTheme');
}
}

@ -0,0 +1,15 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/theme/theme_value.dart';
import 'package:flutter/material.dart';
class ThemeNotifier with ChangeNotifier {
ThemeData _themeData = defaultTheme;
ThemeNotifier(this._themeData);
getTheme() => _themeData;
setTheme(ThemeData themeData) async {
_themeData = themeData;
notifyListeners();
}
}

@ -0,0 +1,129 @@
import 'dart:ui';
import 'package:diplomaticquarterapp/config/config.dart';
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:flutter/material.dart';
import 'package:provider/provider.dart';
/// ---- Default Theme ----
///
//final projectProvider = Provider.of(AppGlobal.context);
final bluePrimary = Color(0xFF3F51B5);
final blueAccent = Color(0xFFFF9800);
final blueBackground = Color(0xFFFFFFFF);
// ProjectViewModel projectProvider = Provider.of(AppGlobal.context);
final bwTheme = ThemeData(
//fontFamily: projectProvider.isArabic ? 'Cairo' : 'WorkSans',
primarySwatch: Colors.grey,
visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light,
pageTransitionsTheme: const PageTransitionsTheme(
builders: {
TargetPlatform.android: ZoomPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
},
),
hintColor: Colors.grey[400],
cardColor: Colors.black,
buttonColor: Colors.grey[400],
disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: Colors.grey,
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white,
backgroundColor: Colors.grey,
highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent,
primaryColor: Colors.grey,
bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
cursorColor: Colors.grey,
iconTheme: IconThemeData(),
appBarTheme: AppBarTheme(
color: Colors.black45,
brightness: Brightness.dark,
elevation: 10.0,
actionsIconTheme: IconThemeData(
color: Colors.grey,
),
),
);
final defaultTheme = ThemeData(
//fontFamily: ProjectViewModel().isArabic? 'Cairo' : 'WorkSans',
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light,
pageTransitionsTheme: const PageTransitionsTheme(
builders: {
TargetPlatform.android: ZoomPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
},
),
hintColor: Colors.grey[400],
disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: Color(0xffEEEEEE),
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white,
backgroundColor: Colors.white,
highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent,
primaryColor: Color(0xff40ACC9),
bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
cursorColor: Colors.grey,
cardColor: Colors.white,
iconTheme: IconThemeData(),
appBarTheme: AppBarTheme(
color: Color(0xff40ACC9),
brightness: Brightness.dark,
elevation: 10.0,
actionsIconTheme: IconThemeData(
color: Color(0xff40ACC9),
),
),
);
final invertTheme = ThemeData(
//fontFamily: projectProvider.isArabic ? 'Cairo' : 'WorkSans',
primarySwatch: Colors.grey,
visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light,
pageTransitionsTheme: const PageTransitionsTheme(
builders: {
TargetPlatform.android: ZoomPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
},
),
hintColor: Colors.grey[400],
cardColor: Colors.black,
buttonColor: Colors.grey[400],
disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: Colors.grey,
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white,
backgroundColor: Colors.grey,
highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent,
primaryColor: Colors.grey,
bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
cursorColor: Colors.grey,
iconTheme: IconThemeData(),
appBarTheme: AppBarTheme(
color: Colors.grey,
brightness: Brightness.dark,
elevation: 10.0,
actionsIconTheme: IconThemeData(
color: Colors.grey,
),
),
);

@ -145,8 +145,10 @@ class TranslationBase {
String get nationalID => localizedValues['nationalID'][locale.languageCode]; String get nationalID => localizedValues['nationalID'][locale.languageCode];
String get fileNo => localizedValues['fileNo'][locale.languageCode]; String get idNo => localizedValues['national-id'][locale.languageCode];
String get fileNo => localizedValues['fileNo'][locale.languageCode];
String get fileno => localizedValues['fileno'][locale.languageCode];
String get forgotPassword => String get forgotPassword =>
localizedValues['forgotFileNo'][locale.languageCode]; localizedValues['forgotFileNo'][locale.languageCode];
@ -776,6 +778,31 @@ class TranslationBase {
localizedValues['month-report'][locale.languageCode]; localizedValues['month-report'][locale.languageCode];
String get infoMonthReport => String get infoMonthReport =>
localizedValues['info-month-report'][locale.languageCode]; localizedValues['info-month-report'][locale.languageCode];
String get languageSetting =>
localizedValues['language-setting'][locale.languageCode];
String get alert => localizedValues['alert'][locale.languageCode];
String get emailAlert => localizedValues['email-alert'][locale.languageCode];
String get smsAlert => localizedValues['sms-alert'][locale.languageCode];
String get contactInfo =>
localizedValues['contact-info'][locale.languageCode];
String get emergencyName => localizedValues['emrg-name'][locale.languageCode];
String get emergencyContact =>
localizedValues['emrg-no'][locale.languageCode];
String get modes => localizedValues['modes'][locale.languageCode];
String get vibration => localizedValues['vibration'][locale.languageCode];
String get blindMode => localizedValues['blind-modes'][locale.languageCode];
String get invertTheme => localizedValues['invert-theme'][locale.languageCode];
String get offTheme => localizedValues['off-theme'][locale.languageCode];
String get dimTheme => localizedValues['dim-theme'][locale.languageCode];
String get bwTheme => localizedValues['bw-theme'][locale.languageCode];
String get permissions => localizedValues['permissions'][locale.languageCode];
String get cameraPermission =>
localizedValues['camera-permission'][locale.languageCode];
String get locationPermission =>
localizedValues['location-permission'][locale.languageCode];
String get accessibility =>
localizedValues['accessibility'][locale.languageCode];
String get selectClinic => String get selectClinic =>
localizedValues['selectClinic'][locale.languageCode]; localizedValues['selectClinic'][locale.languageCode];
String get reviews => String get reviews =>

@ -1,4 +1,6 @@
import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
/// Button widget /// Button widget
@ -33,7 +35,7 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
double _buttonSize = 1.0; double _buttonSize = 1.0;
AnimationController _animationController; AnimationController _animationController;
Animation _animation; Animation _animation;
PermissionService permission = new PermissionService();
@override @override
void initState() { void initState() {
_animationController = AnimationController( _animationController = AnimationController(
@ -88,7 +90,7 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
onTapCancel: () { onTapCancel: () {
_animationController.forward(); _animationController.forward();
}, },
onTap: Feedback.wrapForTap(widget.onTap, context), onTap: (){Feedback.wrapForTap(widget.onTap, context); if(permission.isVibrationEnabled()){ HapticFeedback.vibrate();}},
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
child: Transform.scale( child: Transform.scale(
scale: _buttonSize, scale: _buttonSize,

@ -1,12 +1,15 @@
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class DefaultButton extends StatelessWidget { class DefaultButton extends StatelessWidget {
final String text; final String text;
final Function onPress; final Function onPress;
final Color textColor; final Color textColor;
final Color color; final Color color;
PermissionService permission = new PermissionService();
DefaultButton(this.text, this.onPress, {this.color, this.textColor}); DefaultButton(this.text, this.onPress, {this.color, this.textColor});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -15,12 +18,12 @@ class DefaultButton extends StatelessWidget {
child: RaisedButton( child: RaisedButton(
shape: shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
color: color != null ? color : Colors.grey[700], color: color != null ? color : Colors.grey[900],
textColor: color != null ? textColor : Colors.white, textColor: color != null ? textColor : Colors.white,
child: Text( child: Text(
this.text, this.text,
style: TextStyle(fontSize: SizeConfig.textMultiplier * 2), style: TextStyle(fontSize: SizeConfig.textMultiplier * 2),
), ),
onPressed: () => this.onPress())); onPressed: () =>{ this.onPress(), if(permission.isVibrationEnabled()){ HapticFeedback.vibrate()}}));
} }
} }

@ -1,3 +1,4 @@
import 'dart:io';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
@ -15,6 +16,7 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../config/size_config.dart'; import '../../config/size_config.dart';
import '../../locator.dart'; import '../../locator.dart';
@ -36,6 +38,7 @@ class _AppDrawerState extends State<AppDrawer> {
var sharedPref = new AppSharedPreferences(); var sharedPref = new AppSharedPreferences();
var familyFileProvider = FamilyFilesProvider(); var familyFileProvider = FamilyFilesProvider();
AuthenticatedUser user; AuthenticatedUser user;
AuthenticatedUser mainUser;
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>(); locator<AuthenticatedUserObject>();
@ -97,7 +100,10 @@ class _AppDrawerState extends State<AppDrawer> {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
AppText( AppText(
'File No:' + TranslationBase.of(
context)
.fileno +
": " +
user.patientID user.patientID
.toString(), .toString(),
color: color:
@ -189,15 +195,55 @@ class _AppDrawerState extends State<AppDrawer> {
), ),
)), )),
child: Column( child: Column(
children: [
user.isFamily == true
? Container(
padding:
EdgeInsets.only(
bottom: 5),
child: InkWell(
onTap: () {
switchUser(
mainUser,
context);
},
child: Row(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: <
Widget>[
Expanded(
child: Icon(
Icons
.person),
),
Expanded(
flex: 7,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(mainUser.firstName + ' ' + mainUser.lastName),
AppText(TranslationBase.of(context).fileno + ": " + mainUser.patientID.toString()),
])),
],
)))
: SizedBox(),
Column(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment
.start,
mainAxisSize: mainAxisSize:
MainAxisSize.min, MainAxisSize.min,
children: snapshot.data children: snapshot.data
.getAllSharedRecordsByStatusList .getAllSharedRecordsByStatusList
.map<Widget>((result) { .map<Widget>(
return result.status == 3 (result) {
? Padding( return result
.status ==
3
? Container(
padding: EdgeInsets padding: EdgeInsets
.only( .only(
bottom: bottom:
@ -210,27 +256,25 @@ class _AppDrawerState extends State<AppDrawer> {
}, },
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment CrossAxisAlignment.start,
.start,
children: < children: <
Widget>[ Widget>[
Expanded( Expanded(
child: Icon( child:
Icons.person), Icon(Icons.person, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black),
), ),
Expanded( Expanded(
flex: flex: 7,
7, child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
child: Column( AppText(result.patientName, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black),
crossAxisAlignment: CrossAxisAlignment.start, AppText(TranslationBase.of(context).fileno + ": " + result.iD.toString(), color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black),
children: <Widget>[
Text(result.patientName),
Text('File No:' + result.iD.toString()),
])), ])),
], ],
))) )))
: SizedBox(); : SizedBox();
}).toList())); }).toList())
],
));
} }
}, },
), ),
@ -264,9 +308,13 @@ class _AppDrawerState extends State<AppDrawer> {
TranslationBase.of(context).rateApp, TranslationBase.of(context).rateApp,
Icons.star), Icons.star),
onTap: () { onTap: () {
Navigator.of(context).pushNamed( if (Platform.isIOS) {
WELCOME_LOGIN, launch(
); "https://apps.apple.com/sa/app/dr-suliaman-alhabib/id733503978");
} else {
launch(
"https://play.google.com/store/apps/details?id=com.ejada.hmg&hl=en");
}
}, },
), ),
InkWell( InkWell(
@ -343,8 +391,13 @@ class _AppDrawerState extends State<AppDrawer> {
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE)); await this.sharedPref.getObject(USER_PROFILE));
var data2 = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(MAIN_USER));
print(data2);
setState(() { setState(() {
this.user = data; this.user = data;
this.mainUser = data2;
}); });
} }
} }
@ -371,6 +424,7 @@ class _AppDrawerState extends State<AppDrawer> {
} }
Future<GetAllSharedRecordsByStatusResponse> getFamilyFiles() async { Future<GetAllSharedRecordsByStatusResponse> getFamilyFiles() async {
if (user != null) {
if (await sharedPref.getObject(FAMILY_FILE) != null) { if (await sharedPref.getObject(FAMILY_FILE) != null) {
// print(await sharedPref.getObject(FAMILY_FILE)); // print(await sharedPref.getObject(FAMILY_FILE));
return Future.value(GetAllSharedRecordsByStatusResponse.fromJson( return Future.value(GetAllSharedRecordsByStatusResponse.fromJson(
@ -379,12 +433,14 @@ class _AppDrawerState extends State<AppDrawer> {
return familyFileProvider.getSharedRecordByStatus(); return familyFileProvider.getSharedRecordByStatus();
} }
} }
}
switchUser(user, context) { switchUser(user, context) {
Utils.showProgressDialog(context); Utils.showProgressDialog(context);
this this
.familyFileProvider .familyFileProvider
.silentLoggin(user) .silentLoggin(user is AuthenticatedUser ? null : user,
mainUser: user is AuthenticatedUser)
.then((value) => loginAfter(value, context)) .then((value) => loginAfter(value, context))
.catchError((err) { .catchError((err) {
print(err); print(err);
@ -392,14 +448,20 @@ class _AppDrawerState extends State<AppDrawer> {
Navigator.of(context).pop(); Navigator.of(context).pop();
}).showProgressBar( }).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
;
} }
loginAfter(result, context) { loginAfter(result, context) async {
Utils.hideProgressDialog(); Utils.hideProgressDialog();
result = CheckActivationCode.fromJson(result); result = CheckActivationCode.fromJson(result);
var familyFile = await sharedPref.getObject(FAMILY_FILE);
var mainUser = await sharedPref.getObject(MAIN_USER);
this.sharedPref.clear(); this.sharedPref.clear();
if (mainUser["PatientID"] != result.list.patientID) {
result.list.isFamily = true;
}
this.sharedPref.setObject(MAIN_USER, mainUser);
this.sharedPref.setObject(USER_PROFILE, result.list); this.sharedPref.setObject(USER_PROFILE, result.list);
this.sharedPref.setObject(FAMILY_FILE, familyFile);
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);
this.sharedPref.setString(TOKEN, result.authenticationTokenID); this.sharedPref.setString(TOKEN, result.authenticationTokenID);
//this.checkIfUserAgreedBefore(result), //this.checkIfUserAgreedBefore(result),

@ -1,5 +1,7 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
// OWNER : Ibrahim albitar // OWNER : Ibrahim albitar
// DATE : 12-04-2020 // DATE : 12-04-2020
@ -10,8 +12,10 @@ class MobileNo extends StatefulWidget {
// final String data; // final String data;
final List<Countries> countries = [ final List<Countries> countries = [
new Countries(name: 'Saudi Arabia', code: '966'), new Countries( name: "Saudi Arabia",
new Countries(name: 'Dubai', code: '971'), name_ar:"المملكة العربية السعودية", code: '966' ),
new Countries(name: "United Arab Emirates",
name_ar:"الإمارات العربية المتحدة", code: '971'),
]; ];
final double margin; final double margin;
final double marginTop; final double marginTop;
@ -40,9 +44,10 @@ class MobileNo extends StatefulWidget {
class _MobileNo extends State<MobileNo> { class _MobileNo extends State<MobileNo> {
var _selectedType = '966'; var _selectedType = '966';
String countryCode = '966'; String countryCode = '966';
ProjectViewModel projectProvider;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectProvider = Provider.of(context);
return Visibility( return Visibility(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Row( Row(
@ -79,7 +84,7 @@ class _MobileNo extends State<MobileNo> {
.map<DropdownMenuItem<String>>((Countries value) { .map<DropdownMenuItem<String>>((Countries value) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value.code, value: value.code,
child: Text(value.name), child: Text(projectProvider.isArabic == true ? value.name_ar : value.name),
); );
}).toList())))), }).toList())))),
], ],
@ -133,7 +138,8 @@ class _MobileNo extends State<MobileNo> {
class Countries { class Countries {
final String name; final String name;
final String name_ar;
final String code; final String code;
Countries({this.name, this.code}); Countries({this.name, this.name_ar, this.code});
} }

@ -1,11 +1,14 @@
import 'dart:async'; import 'dart:async';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'dart:math'; import 'dart:math';
import 'package:provider/provider.dart';
class SMSOTP { class SMSOTP {
final type; final type;
final mobileNo; final mobileNo;
@ -47,13 +50,15 @@ class SMSOTP {
final focusD3 = FocusNode(); final focusD3 = FocusNode();
final focusD4 = FocusNode(); final focusD4 = FocusNode();
String errorMsg; String errorMsg;
ProjectViewModel projectProvider;
String displayTime = ''; String displayTime = '';
displayDialog(BuildContext context) async { displayDialog(BuildContext context) async {
return showDialog( return showDialog(
context: context, context: context,
builder: (context) { builder: (context) {
projectProvider = Provider.of(context);
return AlertDialog( return AlertDialog(
title: Row( title: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
@ -95,7 +100,9 @@ class SMSOTP {
key: verifyAccountForm, key: verifyAccountForm,
child: Padding( child: Padding(
padding: EdgeInsets.only(top: 20), padding: EdgeInsets.only(top: 20),
child: Row( child: Directionality(
textDirection:TextDirection.ltr,
child:Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[ children: <Widget>[
Container( Container(
@ -201,7 +208,7 @@ class SMSOTP {
}, },
validator: validateCodeDigit)), validator: validateCodeDigit)),
], ],
), )),
), ),
), ),
Padding( Padding(

@ -40,12 +40,12 @@ dependencies:
# Native # Native
flutter_device_type: ^0.2.0 flutter_device_type: ^0.2.0
local_auth: ^0.6.2+3 local_auth: ^0.6.2+3
localstorage: ^3.0.3+6
maps_launcher: ^1.2.1 maps_launcher: ^1.2.1
url_launcher: ^5.5.0 url_launcher: ^5.5.0
shared_preferences: ^0.5.8 shared_preferences: ^0.5.8
flutter_flexible_toast: ^0.1.4 flutter_flexible_toast: ^0.1.4
firebase_messaging: ^7.0.0 firebase_messaging: ^7.0.0
# Progress bar # Progress bar
progress_hud_v2: ^2.0.0 progress_hud_v2: ^2.0.0
percent_indicator: ^2.1.5 percent_indicator: ^2.1.5
@ -139,7 +139,7 @@ dependencies:
#Handle Geolocation #Handle Geolocation
geolocator: ^6.0.0+1 geolocator: ^6.0.0+1
screen: ^0.0.5
#google maps places #google maps places
google_maps_place_picker: ^1.0.0 google_maps_place_picker: ^1.0.0

Loading…
Cancel
Save