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

Sultan

See merge request Cloud_Solution/diplomatic-quarter!116
fix_issues
Mohammad Aljammal 4 years ago
commit 0966269537

@ -6,8 +6,9 @@ import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
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';
///Doctor
@ -182,7 +183,8 @@ const CHECK_PAYMENT_STATUS =
//URL create advance payment
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 =
'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest';
@ -242,8 +244,8 @@ const LANGUAGE = 2;
const PATIENT_OUT_SA = 0;
const SESSION_ID = 'TMRhVmkGhOsvamErw';
const IS_DENTAL_ALLOWED_BACKEND = false;
const PATIENT_TYPE = 1;
const PATIENT_TYPE_ID = 1;
const PATIENT_TYPE = 2;
const PATIENT_TYPE_ID = 2;
var DEVICE_TOKEN = "";
var DeviceTypeID = Platform.isIOS ? 1 : 2;
const LANGUAGE_ID = 2;
@ -253,6 +255,10 @@ const GET_PAtIENTS_INSURANCE =
"Services/Patients.svc/REST/Get_PatientInsuranceDetails";
const GET_PAtIENTS_INSURANCE_UPDATED =
"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_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail";
const GET_PAtIENTS_INSURANCE_APPROVALS =

@ -111,10 +111,13 @@ const Map localizedValues = {
'login': {'en': 'Login', 'ar': 'تسجيل الدخول'},
'loginregister': {'en': 'Login / Register', 'ar': 'تسجيل الدخول'},
'poweredBy': {'en': 'Powered By', 'ar': 'مشغل بواسطة'},
'welcome': {'en': 'Welcome', 'ar': 'أهلا بك'},
'welcome_text': {
'en': 'Dr. Sulaiman Al Habib Mobile Application ',
'ar': 'الدكتور سليمان الحبيب لتطبيقات الهاتف المتحرك'
"welcome": {
"en": "Welcome",
"ar": "مرحبا"
},
"welcome_text": {
"en": "Dr. Sulaiman Al Habib Mobile Application",
"ar": "الدكتور سليمان الحبيب لتطبيقات الهاتف المتحرك"
},
'welcome_text2': {
'en': 'Have you visited AlHabib Medical Group before? ',
@ -127,8 +130,14 @@ const Map localizedValues = {
"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 No", "ar": "رقم الملف"},
"forgotFileNo": {"en": "Forgot file Number?", "ar": "نسيت رقم الملف الطبي؟"},
"forgotFileNoTitle": {
"en": "Forgot medical file Number",
@ -136,8 +145,8 @@ const Map localizedValues = {
},
"enter-national-id": {
"en": "Please enter mobile number and national ID / Iqama",
"ar": "الرجاء إدخال رقم الجوال والهوية الوطنية / الاقامة"
"en": "Please enter mobile number and identification number",
"ar": "الرجاء إدخال رقم الجوال ورقم الهوية"
},
"profile-info": {
"en": "Please enter profile information",
@ -823,6 +832,43 @@ const Map localizedValues = {
"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": "حالة الطلب"},
"CancelOrder": {"en": "Cancel Order", "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_SEARCH_APPO = 'is-search-appo';
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;
String groupName;
String companyName;
int companyID;
String subCategoryDesc;
int subCategoryID;
String patientCardID;
String insurancePolicyNumber;
bool isActive;
@ -25,6 +27,7 @@ class InsuranceCardModel {
InsuranceCardModel({
this.insurancePolicyNumber,
this.subCategoryDesc,
this.subCategoryID,
this.versionID,
this.channel,
this.languageID,
@ -40,6 +43,7 @@ class InsuranceCardModel {
this.patientType,
this.groupName,
this.companyName,
this.companyID,
this.patientCardID,
this.isActive,
this.cardValidTo
@ -50,6 +54,7 @@ class InsuranceCardModel {
insurancePolicyNumber = json['InsurancePolicyNo'];
patientCardID = json['PatientCardID'];
companyName = json['CompanyName'];
companyID = json['CompanyID'];
groupName = json['GroupName'];
versionID = json['VersionID'];
channel = json['Channel'];
@ -65,6 +70,7 @@ class InsuranceCardModel {
patientTypeID = json['PatientTypeID'];
patientType = json['PatientType'];
subCategoryDesc = json['SubCategoryDesc'];
subCategoryID = json["SubCategoryID"];
cardValidTo = json['CardValidTo'];
}

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

@ -125,4 +125,15 @@ class InsuranceCardService extends BaseService {
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
setState(ViewState.Idle);
}
}

@ -18,7 +18,8 @@ class ProjectViewModel extends BaseViewModel {
bool isError = false;
String error = '';
dynamic searchvalue;
bool isLogin = false;
bool isLogin
= false;
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/routes.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_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:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
@ -14,13 +16,15 @@ import 'locator.dart';
void main() async {
setupLocator();
runApp(MyApp());
runApp(ChangeNotifierProvider<ThemeNotifier>(
create: (context) => ThemeNotifier(defaultTheme), child: MyApp() ));
}
class MyApp extends StatelessWidget {
/// static final _myTabbedPageKey = new GlobalKey<_LandingPageState>();
@override
Widget build(BuildContext context) {
final themeNotifier = Provider.of<ThemeNotifier>(context);
return LayoutBuilder(
builder: (context, constraints) {
return OrientationBuilder(
@ -59,7 +63,7 @@ class MyApp extends StatelessWidget {
const Locale('en', ''), // English
],
theme: ThemeData(
fontFamily: projectProvider.isArabic ? 'Cairo' : 'WorkSans',
fontFamily: projectProvider.isArabic? 'Cairo' : 'WorkSans',
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
brightness: Brightness.light,
@ -76,12 +80,13 @@ class MyApp extends StatelessWidget {
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white,
backgroundColor: Color.fromRGBO(255, 255, 255, 1),
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),

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

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

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

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

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

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

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

@ -1,11 +1,16 @@
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/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/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.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/material.dart';
@ -21,6 +26,7 @@ class InsuranceCard extends StatefulWidget {
}
//TODO fix it
class _InsuranceCardState extends State<InsuranceCard> {
InsuranceCardService _insuranceCardService = locator<InsuranceCardService>();
@override
Widget build(BuildContext context) {
return BaseView<InsuranceViewModel>(
@ -140,6 +146,7 @@ class _InsuranceCardState extends State<InsuranceCard> {
Container(
color: Colors.transparent,
child: SecondaryButton(
onTap:()=>{ getDetails(model.insurance[index])},
label: TranslationBase.of(context).seeDetails,
textColor: Colors.white,
),
@ -179,4 +186,13 @@ class _InsuranceCardState extends State<InsuranceCard> {
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> {
ToDoCountProviderModel toDoProvider;
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
getToDoCount();
});
super.initState();
}
// @override
// void initState() {
// WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
// getToDoCount();
// });
// super.initState();
// }
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
@ -57,7 +57,7 @@ class _HomePageState extends State<HomePage> {
ProjectViewModel projectViewModel = Provider.of(context);
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
return BaseView<DashboardViewModel>(
onModelReady: (model) => model.getPatientRadOrders(),
onModelReady: (model) => {},//model.getPatientRadOrders(),
builder: (_, model, wi) => AppScaffold(
isShowDecPage: false,
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/LiveCare/IncomingCallData.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/livecare/incoming_call.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);
}
setState(() {
//setState(() {
print("didChangeAppLifecycleState");
print('state = $state');
AppGlobal.context = context;
@ -113,7 +114,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
if (state == AppLifecycleState.inactive) {
isPageNavigated = false;
}
});
//});
}
@override
@ -126,9 +127,9 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
void initState() {
super.initState();
WidgetsBinding.instance.addObserver(this);
setState(() {
//setState(() {
AppGlobal.context = context;
});
// });
_requestIOSPermissions();
pageController = PageController(keepPage: true);
_firebaseMessaging.setAutoInitEnabled(true);
@ -139,7 +140,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
_firebaseMessaging.getToken().then((String token) {
sharedPref.setString(PUSH_TOKEN, token);
if (token != null) {
if (token != null && DEVICE_TOKEN =="") {
DEVICE_TOKEN = token;
checkUserStatus(token);
}
@ -387,7 +388,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
),
MedicalProfilePage(),
BookingOptions(),
Container(),
MyFamily(isAppbarVisible:false),
ToDo(),
], // Please do not remove the BookingOptions from this array
),
@ -432,11 +433,10 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
var data =
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
if (data != null)
authService.registeredAuthenticatedUser(data, token, 0, 0);
// setState(() {
// this.user = data;
// print(this.user);
// });
authService
.registeredAuthenticatedUser(data, token, 0, 0)
.then((res) => {print(res)});
}
}

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

@ -14,7 +14,7 @@ class LoginType extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).welcome,
appBarTitle: TranslationBase.of(context).login,
isShowAppBar: true,
isShowDecPage: false,
body: Padding(
@ -73,7 +73,7 @@ class LoginType extends StatelessWidget {
),
AppText(
TranslationBase.of(context)
.nationalID,
.idNo,
fontSize:
SizeConfig.textMultiplier *
2,
@ -122,6 +122,7 @@ class LoginType extends StatelessWidget {
))))
],
),
SizedBox(height: 25,),
Divider(
color: Colors.grey,
height: 2,
@ -144,8 +145,14 @@ class LoginType extends StatelessWidget {
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Divider(
color: Colors.grey,
height: 2,
),
SizedBox(height: 10,),
Row(
children: <Widget>[
Expanded(
child: DefaultButton(
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/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -64,7 +65,7 @@ class _Login extends State<Login> {
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).login,
isShowAppBar: true,
@ -116,6 +117,11 @@ class _Login extends State<Login> {
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Divider(
color: Colors.grey,
height: 2,
),
SizedBox(height: 10,),
Row(
children: <Widget>[
Expanded(
@ -195,8 +201,22 @@ class _Login extends State<Login> {
}
})
.catchError((err) {
print(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);
});
// SMSOTP.showLoadingDialog(context, false),
}
@ -222,14 +242,16 @@ class _Login extends State<Login> {
// request.isRegister = false;
this.authService.checkActivationCode(request, code).then((result) => {
result = CheckActivationCode.fromJson(result),
this.sharedPref.setObject(USER_PROFILE, result.list),
result.list.isFamily =false,
this.sharedPref.setObject(USER_PROFILE, result.list),
this.sharedPref.setObject(MAIN_USER, result.list),
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
this.sharedPref.setString(TOKEN, result.authenticationTokenID),
authenticatedUserObject.getUser(),
// authenticatedUserObject.user = AuthenticatedUser.fromJson(result.list),
// authenticatedUserObject.user = AuthenticatedUser.fromJson(result.list),
authenticatedUserObject.isLogin = true,
appointmentRateViewModel.isLogin = true,
projectViewModel.isLogin = true,
projectViewModel.isLogin = true,
appointmentRateViewModel
.getIsLastAppointmentRatedList()
.then((value) => {

@ -8,9 +8,11 @@ import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
@ -86,7 +88,9 @@ class _RegisterInfo extends State<RegisterInfo> {
Container(
margin: EdgeInsets.only(bottom: 10),
child: TextFields(
hintText: registerInfo.firstNameEn,
hintText: registerInfo.firstNameEn == '-'
? registerInfo.firstNameAr
: registerInfo.firstNameEn,
padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10),
readOnly: true,
@ -95,7 +99,9 @@ class _RegisterInfo extends State<RegisterInfo> {
Container(
margin: EdgeInsets.only(bottom: 10),
child: TextFields(
hintText: registerInfo.secondNameEn,
hintText: registerInfo.secondNameEn == '-'
? registerInfo.secondNameAr
: registerInfo.secondNameEn,
padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10),
readOnly: true,
@ -104,7 +110,9 @@ class _RegisterInfo extends State<RegisterInfo> {
Container(
margin: EdgeInsets.only(bottom: 10),
child: TextFields(
hintText: registerInfo.lastNameEn,
hintText: registerInfo.lastNameEn == '-'
? registerInfo.lastNameAr
: registerInfo.lastNameEn,
padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10),
readOnly: true,
@ -202,7 +210,7 @@ class _RegisterInfo extends State<RegisterInfo> {
child: DropdownButtonHideUnderline(
child: DropdownButton(
isExpanded: true,
value: language,
value: location,
iconSize: 40,
elevation: 16,
onChanged: (value) => {
@ -269,17 +277,46 @@ class _RegisterInfo extends State<RegisterInfo> {
registerNow() {
dynamic request = getTempUserRequest();
GifLoaderDialogUtils.showMyDialog(context);
this.authService.registerUser(request).then((result) => {
print(result),
GifLoaderDialogUtils.hideDialog(context),
// userData = result.list;
//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.setString(TOKEN, result.authenticationTokenID),
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);
});
}
getRegisterInfo() async {
@ -310,9 +347,12 @@ class _RegisterInfo extends State<RegisterInfo> {
"PatientIdentificationNo": registerInfo.idNumber,
"MobileNumber": registerd_data.patientMobileNumber,
"PatientOutSA": registerd_data.zipCode == '966' ? 0 : 1,
"FirstName": registerInfo.firstNameEn,
"MiddleName": registerInfo.secondNameEn,
"LastName": registerInfo.lastNameEn,
"FirstNameN":registerInfo.firstNameAr =='-' ?"": registerInfo.firstNameAr,
"FirstName": registerInfo.firstNameEn =='-' ?"":registerInfo.firstNameEn,
"MiddleNameN":registerInfo.secondNameAr =='-' ? "" : registerInfo.secondNameAr,
"MiddleName":registerInfo.secondNameEn == '-' ? "": registerInfo.secondNameEn,
"LastNameN": registerInfo.lastNameAr =='-'? "" : registerInfo.lastNameAr,
"LastName": registerInfo.lastNameEn =='-' ? "": registerInfo.lastNameEn,
"StrDateofBirth": registerInfo.dateOfBirth,
"DateofBirth": DateUtil.convertISODateToJsonDate(
registerInfo.dateOfBirth.replaceAll('/', '-')),
@ -331,30 +371,6 @@ class _RegisterInfo extends State<RegisterInfo> {
"PatientIdentificationID": registerInfo.idNumber,
"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() {

@ -8,11 +8,14 @@ import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.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/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -46,9 +49,7 @@ class _Register extends State<Register> {
appBarTitle: TranslationBase.of(context).register,
isShowAppBar: true,
isShowDecPage: false,
body: isLoading == true
? AppCircularProgressIndicator()
: SingleChildScrollView(
body: SingleChildScrollView(
child: Container(
padding:
EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30),
@ -120,8 +121,12 @@ class _Register extends State<Register> {
),
],
),
Row(children: <Widget>[
Expanded(
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Container(
width: SizeConfig.realScreenWidth * .9,
height:60,
child: isHijri == 1
? TextFields(
onChanged: (value) => {dob = value},
@ -129,6 +134,11 @@ class _Register extends State<Register> {
prefixIcon: Icon(Icons.date_range),
)
: RaisedButton.icon(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15.0),
),
color:Colors.white,
onPressed: () => {
if (isHijri != null)
_selectDate(context)
@ -147,6 +157,11 @@ class _Register extends State<Register> {
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Divider(
color: Colors.grey,
height: 2,
),
SizedBox(height: 10,),
Row(
children: <Widget>[
Expanded(
@ -196,11 +211,28 @@ class _Register extends State<Register> {
}
checkPatientForRegisteration(request) {
showLoader(true);
GifLoaderDialogUtils.showMyDialog(context);
this
.authService
.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() {
@ -219,12 +251,20 @@ class _Register extends State<Register> {
}
checkUserStatus(response, CheckPatientForRegistration request) async {
showLoader(false);
GifLoaderDialogUtils.hideDialog(context);
if (response is Map) {
var nRequest = request.toJson();
nRequest['LogInTokenID'] = response['LogInTokenID'];
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 {
nRequest['forRegister'] = true;
nRequest['isRegister'] = true;
@ -236,7 +276,15 @@ class _Register extends State<Register> {
}
} else {
// 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/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:screen/screen.dart';
class GeneralSettings extends StatefulWidget {
@override
@ -10,15 +18,30 @@ class GeneralSettings extends StatefulWidget {
class _GeneralSettings extends State<GeneralSettings>
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) {
bool isVibration = true;
var bindValue;
themeNotifier = Provider.of<ThemeNotifier>(context);
return Container(
child: ListView(scrollDirection: Axis.vertical, children: <Widget>[
Container(
padding: EdgeInsets.all(10),
child: AppText(
'Modes',
TranslationBase.of(context).modes,
color: Colors.black,
fontWeight: FontWeight.bold,
),
@ -29,13 +52,15 @@ class _GeneralSettings extends State<GeneralSettings>
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('Vibration touch feedback'),
AppText(TranslationBase.of(context).vibration),
Switch(
value: isVibration,
value: vibration,
onChanged: (value) {
setState(() {
isVibration = value;
vibration = value;
});
setVibration(value);
},
activeTrackColor: Colors.lightGreenAccent,
activeColor: Colors.green,
@ -48,12 +73,12 @@ class _GeneralSettings extends State<GeneralSettings>
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('Accsibility Mode'),
AppText(TranslationBase.of(context).accessibility),
Switch(
value: isVibration,
value: accessibility,
onChanged: (value) {
setState(() {
isVibration = value;
accessibility = value;
});
},
activeTrackColor: Colors.lightGreenAccent,
@ -64,7 +89,7 @@ class _GeneralSettings extends State<GeneralSettings>
Container(
padding: EdgeInsets.all(10),
child: AppText(
'Modes for Partially Blind',
TranslationBase.of(context).blindMode,
color: Colors.black,
fontWeight: FontWeight.bold,
),
@ -82,14 +107,15 @@ class _GeneralSettings extends State<GeneralSettings>
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
new Text(
'Off',
TranslationBase.of(context).offTheme,
style: new TextStyle(fontSize: 16.0),
),
new Radio(
Radio(
value: 0,
groupValue: bindValue,
groupValue: blindValue,
onChanged: (value) {
bindValue = value;
setState(() => {this.blindValue = value});
setTheme(value);
},
),
],
@ -98,16 +124,17 @@ class _GeneralSettings extends State<GeneralSettings>
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
new Text(
'Invert',
TranslationBase.of(context).invertTheme,
style: new TextStyle(
fontSize: 16.0,
),
),
new Radio(
value: 1,
groupValue: bindValue,
groupValue: blindValue,
onChanged: (value) {
bindValue = value;
setState(() => {this.blindValue = value});
setTheme(value);
},
)
],
@ -116,14 +143,15 @@ class _GeneralSettings extends State<GeneralSettings>
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
new Text(
'Dim',
TranslationBase.of(context).dimTheme,
style: new TextStyle(fontSize: 16.0),
),
new Radio(
value: 2,
groupValue: bindValue,
groupValue: blindValue,
onChanged: (value) {
bindValue = value;
setState(() => {this.blindValue = value});
setTheme(value);
},
),
],
@ -132,14 +160,16 @@ class _GeneralSettings extends State<GeneralSettings>
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
new Text(
'Black and White',
TranslationBase.of(context).bwTheme,
style: new TextStyle(fontSize: 16.0),
),
new Radio(
value: 2,
groupValue: bindValue,
value: 3,
groupValue: blindValue,
onChanged: (value) {
bindValue = value;
setState(() => {this.blindValue = value});
setTheme(value);
},
),
],
@ -150,7 +180,7 @@ class _GeneralSettings extends State<GeneralSettings>
Container(
padding: EdgeInsets.all(10),
child: AppText(
'Permission',
TranslationBase.of(context).permissions,
color: Colors.black,
fontWeight: FontWeight.bold,
),
@ -161,12 +191,12 @@ class _GeneralSettings extends State<GeneralSettings>
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('Camera'),
AppText(TranslationBase.of(context).cameraPermission),
Switch(
value: isVibration,
value: camera,
onChanged: (value) {
setState(() {
isVibration = value;
camera = value;
});
},
activeTrackColor: Colors.lightGreenAccent,
@ -180,12 +210,12 @@ class _GeneralSettings extends State<GeneralSettings>
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('Location'),
AppText(TranslationBase.of(context).locationPermission),
Switch(
value: isVibration,
value: location,
onChanged: (value) {
setState(() {
isVibration = value;
location = value;
});
},
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/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -15,168 +17,180 @@ class _ProfileSettings extends State<ProfileSettings>
Widget build(BuildContext context) {
bool isVibration = true;
var language = 1;
return Container(
child: ListView(scrollDirection: Axis.vertical, children: <Widget>[
Container(
padding: EdgeInsets.all(15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
'File No',
color: Colors.black,
),
AppText(
'124545',
color: Colors.black,
),
],
),
),
SizedBox(
height: 1,
width: MediaQuery.of(context).size.width,
child: Container(
color: Colors.grey[300],
),
),
Padding(
child: AppText('SMS and Confirmation Calls Language ',
fontWeight: FontWeight.bold),
padding: EdgeInsets.all(10),
),
Container(
color: Colors.white,
padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText('English'),
new Radio(
value: 2,
groupValue: language,
onChanged: (value) {
language = value;
},
)
],
)),
Container(
color: Colors.white,
padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText('Arabic'),
new Radio(
value: 1,
groupValue: language,
onChanged: (value) {
language = value;
},
)
],
)),
Padding(
child: AppText('Alert'),
padding: EdgeInsets.all(10),
),
Container(
color: Colors.white,
padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText('Alert by Email'),
Switch(
value: isVibration,
onChanged: (value) {
setState(() {
isVibration = value;
});
},
activeTrackColor: Colors.lightGreenAccent,
activeColor: Colors.green,
)
],
)),
Container(
color: Colors.white,
padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText('Alert by SMS'),
Switch(
value: isVibration,
onChanged: (value) {
setState(() {
isVibration = value;
});
},
activeTrackColor: Colors.lightGreenAccent,
activeColor: Colors.green,
)
],
)),
Padding(
child: AppText('Alert'),
padding: EdgeInsets.all(10),
),
Container(
color: Colors.white,
padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText('Email'),
TextField(
style: TextStyle(color: Colors.red),
)
],
)),
Container(
color: Colors.white,
padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText('Emergency contact name'),
TextField(
style: TextStyle(color: Colors.red),
decoration: InputDecoration(
suffixIcon: Icon(Icons.edit),
))
],
)),
Container(
color: Colors.white,
padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText('Emergency contact number'),
TextField(
style: TextStyle(color: Colors.red),
decoration: InputDecoration(
suffixIcon: Icon(Icons.edit),
return BaseView<DashboardViewModel>(
onModelReady: (model) => model.getPatientRadOrders(),
builder: (_, model, wi) => Container(
child:
ListView(scrollDirection: Axis.vertical, children: <Widget>[
Container(
padding: EdgeInsets.all(15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
TranslationBase.of(context).fileNo,
color: Colors.black,
),
AppText(
model.user.patientID.toString(),
color: Colors.black,
),
],
),
),
SizedBox(
height: 1,
width: MediaQuery.of(context).size.width,
child: Container(
color: Colors.grey[300],
),
)
],
)),
Container(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).submit,
() {
),
Padding(
child: AppText(TranslationBase.of(context).languageSetting,
fontWeight: FontWeight.bold),
padding: EdgeInsets.all(10),
),
Container(
color: Colors.white,
padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(TranslationBase.of(context).english),
new Radio(
value: 2,
groupValue: language,
onChanged: (value) {
language = value;
},
)
],
)),
Container(
color: Colors.white,
padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(TranslationBase.of(context).arabic),
new Radio(
value: 1,
groupValue: language,
onChanged: (value) {
language = value;
},
)
],
)),
Padding(
child: AppText(TranslationBase.of(context).alert),
padding: EdgeInsets.all(10),
),
Container(
color: Colors.white,
padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(TranslationBase.of(context).emailAlert),
Switch(
value: isVibration,
onChanged: (value) {
setState(() {
isVibration = value;
});
},
activeTrackColor: Colors.lightGreenAccent,
activeColor: Colors.green,
)
],
)),
Container(
color: Colors.white,
padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(TranslationBase.of(context).smsAlert),
Switch(
value: isVibration,
onChanged: (value) {
setState(() {
isVibration = value;
});
},
activeTrackColor: Colors.lightGreenAccent,
activeColor: Colors.green,
)
],
)),
Padding(
child: AppText(TranslationBase.of(context).contactInfo),
padding: EdgeInsets.all(10),
),
Container(
color: Colors.white,
padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(TranslationBase.of(context).email),
TextField(
style: TextStyle(color: Colors.red),
decoration: InputDecoration(
suffixIcon: Icon(Icons.edit),
))
],
)),
Container(
color: Colors.white,
padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(TranslationBase.of(context).emergencyName),
TextField(
style: TextStyle(color: Colors.red),
decoration: InputDecoration(
suffixIcon: Icon(Icons.edit),
))
],
)),
Container(
color: Colors.white,
padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(TranslationBase.of(context).emergencyContact),
TextField(
style: TextStyle(color: Colors.red),
decoration: InputDecoration(
suffixIcon: Icon(Icons.edit),
),
)
],
)),
Container(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).submit,
() {
// print(mobileNo.text);
},
)),
],
))
]));
},
)),
],
))
])));
}
}

@ -233,7 +233,7 @@ class AuthProvider with ChangeNotifier {
neRequest.languageID = LANGUAGE_ID;
neRequest.deviceTypeID = DeviceTypeID;
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.forRegisteration =
neRequest.isRegister != null ? neRequest.isRegister : false;
@ -345,11 +345,14 @@ class AuthProvider with ChangeNotifier {
request.gender = user.gender;
request.patientID = user.patientID;
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.latitude = lat;
request.longitude = long;
request.languageID = int.parse(user.preferredLanguage);
request.patientTypeID = 2;
dynamic localRes;
try {
await new BaseAppClient().post(LOGGED_IN_USER_URL,

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

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

@ -1,12 +1,15 @@
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/services.dart';
class DefaultButton extends StatelessWidget {
final String text;
final Function onPress;
final Color textColor;
final Color color;
PermissionService permission = new PermissionService();
DefaultButton(this.text, this.onPress, {this.color, this.textColor});
@override
Widget build(BuildContext context) {
@ -15,12 +18,12 @@ class DefaultButton extends StatelessWidget {
child: RaisedButton(
shape:
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,
child: Text(
this.text,
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/core/service/AuthenticatedUserObject.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:provider/provider.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../config/size_config.dart';
import '../../locator.dart';
@ -36,6 +38,7 @@ class _AppDrawerState extends State<AppDrawer> {
var sharedPref = new AppSharedPreferences();
var familyFileProvider = FamilyFilesProvider();
AuthenticatedUser user;
AuthenticatedUser mainUser;
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
@ -97,7 +100,10 @@ class _AppDrawerState extends State<AppDrawer> {
child: Column(
children: <Widget>[
AppText(
'File No:' +
TranslationBase.of(
context)
.fileno +
": " +
user.patientID
.toString(),
color:
@ -189,48 +195,86 @@ class _AppDrawerState extends State<AppDrawer> {
),
)),
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
mainAxisSize:
MainAxisSize.min,
children: snapshot.data
.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return result.status == 3
? Padding(
padding: EdgeInsets
.only(
bottom:
5),
child: InkWell(
onTap: () {
switchUser(
result,
context);
},
child: Row(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: <
Widget>[
Expanded(
child: Icon(
Icons.person),
),
Expanded(
flex:
7,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(result.patientName),
Text('File No:' + result.iD.toString()),
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
.start,
mainAxisSize:
MainAxisSize.min,
children: snapshot.data
.getAllSharedRecordsByStatusList
.map<Widget>(
(result) {
return result
.status ==
3
? Container(
padding: EdgeInsets
.only(
bottom:
5),
child: InkWell(
onTap: () {
switchUser(
result,
context);
},
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <
Widget>[
Expanded(
child:
Icon(Icons.person, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black),
),
Expanded(
flex: 7,
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
AppText(result.patientName, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black),
AppText(TranslationBase.of(context).fileno + ": " + result.iD.toString(), color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black),
])),
],
)))
: SizedBox();
}).toList()));
],
)))
: SizedBox();
}).toList())
],
));
}
},
),
@ -264,9 +308,13 @@ class _AppDrawerState extends State<AppDrawer> {
TranslationBase.of(context).rateApp,
Icons.star),
onTap: () {
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
if (Platform.isIOS) {
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(
@ -343,8 +391,13 @@ class _AppDrawerState extends State<AppDrawer> {
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
var data2 = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(MAIN_USER));
print(data2);
setState(() {
this.user = data;
this.mainUser = data2;
});
}
}
@ -371,12 +424,14 @@ class _AppDrawerState extends State<AppDrawer> {
}
Future<GetAllSharedRecordsByStatusResponse> getFamilyFiles() async {
if (await sharedPref.getObject(FAMILY_FILE) != null) {
// print(await sharedPref.getObject(FAMILY_FILE));
return Future.value(GetAllSharedRecordsByStatusResponse.fromJson(
await sharedPref.getObject(FAMILY_FILE)));
} else {
return familyFileProvider.getSharedRecordByStatus();
if (user != null) {
if (await sharedPref.getObject(FAMILY_FILE) != null) {
// print(await sharedPref.getObject(FAMILY_FILE));
return Future.value(GetAllSharedRecordsByStatusResponse.fromJson(
await sharedPref.getObject(FAMILY_FILE)));
} else {
return familyFileProvider.getSharedRecordByStatus();
}
}
}
@ -384,7 +439,8 @@ class _AppDrawerState extends State<AppDrawer> {
Utils.showProgressDialog(context);
this
.familyFileProvider
.silentLoggin(user)
.silentLoggin(user is AuthenticatedUser ? null : user,
mainUser: user is AuthenticatedUser)
.then((value) => loginAfter(value, context))
.catchError((err) {
print(err);
@ -392,14 +448,20 @@ class _AppDrawerState extends State<AppDrawer> {
Navigator.of(context).pop();
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
;
}
loginAfter(result, context) {
loginAfter(result, context) async {
Utils.hideProgressDialog();
result = CheckActivationCode.fromJson(result);
var familyFile = await sharedPref.getObject(FAMILY_FILE);
var mainUser = await sharedPref.getObject(MAIN_USER);
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(FAMILY_FILE, familyFile);
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);
this.sharedPref.setString(TOKEN, result.authenticationTokenID);
//this.checkIfUserAgreedBefore(result),

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

@ -126,7 +126,7 @@ class AppScaffold extends StatelessWidget {
description: description,
infoList: infoList,
)
: baseViewModel != null
: baseViewModel != null
? NetworkBaseView(
child: buildBodyWidget(),
baseViewModel: baseViewModel,

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

@ -40,12 +40,12 @@ dependencies:
# Native
flutter_device_type: ^0.2.0
local_auth: ^0.6.2+3
localstorage: ^3.0.3+6
maps_launcher: ^1.2.1
url_launcher: ^5.5.0
shared_preferences: ^0.5.8
flutter_flexible_toast: ^0.1.4
firebase_messaging: ^7.0.0
# Progress bar
progress_hud_v2: ^2.0.0
percent_indicator: ^2.1.5
@ -139,10 +139,10 @@ dependencies:
#Handle Geolocation
geolocator: ^6.0.0+1
screen: ^0.0.5
#google maps places
google_maps_place_picker: ^1.0.0
#Dependencies for video call implementation
native_device_orientation: ^0.3.0
enum_to_string: ^1.0.9
@ -151,7 +151,7 @@ dependencies:
after_layout: ^1.0.7
twilio_programmable_video: ^0.5.0+3
flutter_tts: ^1.2.6
speech_to_text:
path: speech_to_text

Loading…
Cancel
Save