Merge branch 'sultan-patientapp' into 'development'

Sultan patientapp

See merge request Cloud_Solution/diplomatic-quarter!305
merge-requests/304/merge
Mohammad Aljammal 4 years ago
commit bfc687d161

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

@ -14,7 +14,7 @@ const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders';
const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
//const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs
const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
@ -33,7 +33,8 @@ const GET_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_GetAllPoints';
const LOG_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_InsertPatientFileInfo';
// Delivery Driver
const DRIVER_LOCATION = 'Services/Patients.svc/REST/PatientER_GetDriverLocation';
const DRIVER_LOCATION =
'Services/Patients.svc/REST/PatientER_GetDriverLocation';
//weather
const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo';
@ -220,9 +221,11 @@ const GET_PATIENT_SHARE =
const GET_PATIENT_APPOINTMENT_HISTORY =
"Services/Doctors.svc/REST/PateintHasAppoimentHistory";
const SEND_REPORT_EYE_EMAIL = "Services/Notifications.svc/REST/SendGlassesPrescriptionEmail";
const SEND_REPORT_EYE_EMAIL =
"Services/Notifications.svc/REST/SendGlassesPrescriptionEmail";
const SEND_CONTACT_LENS_PRESCRIPTION_EMAIL = "Services/Notifications.svc/REST/SendContactLensPrescriptionEmail";
const SEND_CONTACT_LENS_PRESCRIPTION_EMAIL =
"Services/Notifications.svc/REST/SendContactLensPrescriptionEmail";
//URL to get patient appointment curfew history
const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY =
@ -509,7 +512,7 @@ const LAKUM_GET_USER_TERMS_AND_CONDITIONS =
"Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy";
const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_RECOMMENDED_PRODUCT = 'alsoProduct/';
const GET_MOST_VIEWED_PRODUCTS ="mostview?";
const GET_MOST_VIEWED_PRODUCTS = "mostview?";
const GET_NEW_PRODUCTS = "newproducts?";
// Home Health Care

@ -186,10 +186,7 @@ const Map localizedValues = {
"fileNo": {"en": "File Number", "ar": "رقم الملف"},
"fileno": {"en": "File No", "ar": "رقم الملف"},
"forgotFileNo": {"en": "Forgot file Number?", "ar": "نسيت رقم الملف الطبي؟"},
"forgotFileNoTitle": {
"en": "Forgot medical file Number",
"ar": "نسيت رقم الملف"
},
"forgotFileNoTitle": {"en": "Forgot medical file", "ar": "نسيت رقم الملف"},
"enter-national-id": {
"en": "Please enter mobile number and identification number",

@ -87,7 +87,7 @@ class BaseAppClient {
: IS_DENTAL_ALLOWED_BACKEND;
}
body['DeviceTypeID'] = Platform.isAndroid ? 1: 2;
body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
if (!body.containsKey('IsPublicRequest')) {
body['PatientType'] = body.containsKey('PatientType')
@ -117,7 +117,8 @@ class BaseAppClient {
'Accept': 'application/json',
'Authorization': pharmacyToken,
'Mobilenumber': user != null
? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString())
? Utils.getPhoneNumberWithoutZero(
user['MobileNumber'].toString())
: "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user['PatientID'].toString(),
@ -278,8 +279,7 @@ class BaseAppClient {
: IS_DENTAL_ALLOWED_BACKEND;
}
body['DeviceTypeID'] = Platform.isAndroid ? 1: 2;
body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
if (!body.containsKey('IsPublicRequest')) {
body['PatientType'] = body.containsKey('PatientType')
@ -507,10 +507,12 @@ class BaseAppClient {
}
}
simplePost(String fullUrl,
{ Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,}) async {
simplePost(
String fullUrl, {
Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
}) async {
String url = fullUrl;
print("URL Query String: $url");
@ -539,9 +541,8 @@ class BaseAppClient {
simpleGet(String fullUrl,
{Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
Map<String, String> queryParams}) async {
Function(String error, int statusCode) onFailure,
Map<String, String> queryParams}) async {
String url = fullUrl;
print("URL Query String: $url");
@ -574,12 +575,10 @@ class BaseAppClient {
}
}
simplePut(String fullUrl,
{ Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure}) async {
{Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure}) async {
String url = fullUrl;
print("URL Query String: $url");
@ -608,9 +607,8 @@ class BaseAppClient {
simpleDelete(String fullUrl,
{Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
Map<String, String> queryParams}) async {
Function(String error, int statusCode) onFailure,
Map<String, String> queryParams}) async {
String url = fullUrl;
print("URL Query String: $url");
@ -733,7 +731,7 @@ class BaseAppClient {
: IS_DENTAL_ALLOWED_BACKEND;
}
body['DeviceTypeID'] = Platform.isAndroid ? 1: 2;
body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
if (!body.containsKey('IsPublicRequest')) {
body['PatientType'] = body.containsKey('PatientType')

File diff suppressed because it is too large Load Diff

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
@ -13,12 +15,15 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/floating_button_search.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:speech_to_text/speech_recognition_error.dart';
import 'dart:convert';
import 'dart:io';
import 'appointment_history.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt;
class SendFeedbackPage extends StatefulWidget {
@override
@ -35,8 +40,10 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
String message;
final formKey = GlobalKey<FormState>();
MessageType messageType = MessageType.NON;
var _currentLocaleId;
stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord;
var event = RobotProvider();
String getSelected(BuildContext context) {
switch (messageType) {
case MessageType.ComplaintOnAnAppointment:
@ -61,13 +68,10 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
return TranslationBase.of(context).notClassified;
}
setMessageType(MessageType messageType) {
setState(() {
this.messageType = messageType;
});
setState(() {
this.messageType = messageType;
});
}
@override
@ -116,7 +120,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
getSelected(context),
variant: 'bodyText',
),
margin: EdgeInsets.only(left: 10,right: 10),
margin: EdgeInsets.only(left: 10, right: 10),
),
Icon(
Icons.arrow_drop_down,
@ -127,8 +131,8 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
),
),
),
if (appointHistory != null && messageType ==
MessageType.ComplaintOnAnAppointment)
if (appointHistory != null &&
messageType == MessageType.ComplaintOnAnAppointment)
InkWell(
onTap: () {
setState(() {
@ -203,10 +207,13 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
),
),
),
if (messageType == MessageType.ComplaintOnAnAppointment && model.appointHistoryList.length != 0 &&
if (messageType == MessageType.ComplaintOnAnAppointment &&
model.appointHistoryList.length != 0 &&
isShowListAppointHistory)
Container(
height: model.appointHistoryList.length>2?MediaQuery.of(context).size.height * 0.25:MediaQuery.of(context).size.height * 0.15,
height: model.appointHistoryList.length > 2
? MediaQuery.of(context).size.height * 0.25
: MediaQuery.of(context).size.height * 0.15,
child: ListView.builder(
itemCount: model.appointHistoryList.length,
itemBuilder: (context, index) => InkWell(
@ -336,6 +343,10 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
maxLines: 25,
minLines: 13,
controller: messageController,
suffixIcon: Icons.mic,
onSuffixTap: () {
openSpeechReco();
},
validator: (value) {
if (value.isEmpty)
return TranslationBase.of(context).emptyMessage;
@ -345,11 +356,12 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
),
InkWell(
onTap: () {
ImageOptions.showImageOptions(context, (String image,File file) {
ImageOptions.showImageOptions(context,
(String image, File file) {
setState(() {
images.add(image);
});
} );
});
},
child: Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
@ -427,18 +439,21 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
child: SecondaryButton(
label: TranslationBase.of(context).send,
textColor: Colors.white,
disabled: (titleController.text.toString().isEmpty || messageController.text.toString().isEmpty|| messageType == MessageType.NON),
disabled: (titleController.text.toString().isEmpty ||
messageController.text.toString().isEmpty ||
messageType == MessageType.NON),
onTap: () {
final form = formKey.currentState;
if (form.validate())
if (messageType != MessageType.NON){
GifLoaderDialogUtils.showMyDialog(context);
model.sendCOCItem(
if (form.validate()) if (messageType != MessageType.NON) {
GifLoaderDialogUtils.showMyDialog(context);
model
.sendCOCItem(
title: titleController.text,
attachment: images.length > 0 ? images[0] : "",
details: messageController.text,
cOCTypeName: getCOCName(),
appointHistory:messageType == MessageType.ComplaintOnAnAppointment
appointHistory: messageType ==
MessageType.ComplaintOnAnAppointment
? appointHistory
: null)
.then((value) {
@ -456,9 +471,10 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
AppToast.showErrorToast(message: model.error);
GifLoaderDialogUtils.hideDialog(context);
}
});}
else {
AppToast.showErrorToast(message: TranslationBase.of(context).selectPart);
});
} else {
AppToast.showErrorToast(
message: TranslationBase.of(context).selectPart);
}
},
),
@ -513,28 +529,64 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
},
));
}
openSpeechReco() async {
new RoboSearch(context: context).showAlertDialog(context);
_currentLocaleId =
TranslationBase.of(AppGlobal.context).locale.languageCode;
bool available = await speech.initialize(
onStatus: statusListener, onError: errorListener);
if (available) {
speech.listen(
onResult: resultListener,
// listenMode: ListenMode.confirmation,
localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA',
);
} else {
print("The user has denied the use of speech recognition.");
}
}
void errorListener(SpeechRecognitionError error) {}
void statusListener(String status) {
reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....';
}
void resultListener(result) {
reconizedWord = result.recognizedWords;
event.setValue({"searchText": reconizedWord});
if (result.finalResult == true) {
setState(() {
RoboSearch.closeAlertDialog(context);
messageController.text = reconizedWord;
});
}
}
}
class FeedbackTypeDialog extends StatefulWidget {
final Function(MessageType) onValueSelected;
final MessageType messageTypeDialog;
const FeedbackTypeDialog({Key key, this.onValueSelected, this.messageTypeDialog=MessageType.NON}) : super(key: key);
const FeedbackTypeDialog(
{Key key, this.onValueSelected, this.messageTypeDialog = MessageType.NON})
: super(key: key);
@override
State createState() => new FeedbackTypeDialogState();
}
class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
MessageType messageTypeDialog = MessageType.NON;
setMessageDialogType(MessageType messageType) {
setState(() {
messageTypeDialog = messageType;
});
setState(() {
messageTypeDialog = messageType;
});
}
@override
void initState() {
messageTypeDialog = widget.messageTypeDialog;
@ -562,10 +614,10 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
Expanded(
flex: 1,
child: InkWell(
onTap: () => setMessageDialogType(
MessageType.NON),
onTap: () => setMessageDialogType(MessageType.NON),
child: ListTile(
title: Texts(TranslationBase.of(context).notClassified),
title:
Texts(TranslationBase.of(context).notClassified),
leading: Radio(
value: MessageType.NON,
groupValue: messageTypeDialog,
@ -589,7 +641,8 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
onTap: () => setMessageDialogType(
MessageType.ComplaintOnAnAppointment),
child: ListTile(
title: Texts(TranslationBase.of(context).complainAppo),
title:
Texts(TranslationBase.of(context).complainAppo),
leading: Radio(
value: MessageType.ComplaintOnAnAppointment,
groupValue: messageTypeDialog,
@ -613,7 +666,8 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
onTap: () => setMessageDialogType(
MessageType.ComplaintWithoutAppointment),
child: ListTile(
title: Texts(TranslationBase.of(context).complainWithoutAppo),
title: Texts(
TranslationBase.of(context).complainWithoutAppo),
leading: Radio(
value: MessageType.ComplaintWithoutAppointment,
groupValue: messageTypeDialog,
@ -634,8 +688,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
Expanded(
flex: 1,
child: InkWell(
onTap: () =>
setMessageDialogType(MessageType.Question),
onTap: () => setMessageDialogType(MessageType.Question),
child: ListTile(
title: Texts(TranslationBase.of(context).question),
leading: Radio(
@ -690,7 +743,8 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
value: MessageType.Suggestion,
groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor,
onChanged: (MessageType value) => setMessageDialogType(value),
onChanged: (MessageType value) =>
setMessageDialogType(value),
),
),
),
@ -745,7 +799,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
TranslationBase.of(context).ok,
TranslationBase.of(context).ok,
fontWeight: FontWeight.w400,
)),
),

@ -358,7 +358,7 @@ class _HomePageState extends State<HomePage> {
height: 5,
),
Texts(
'${DateUtil.getMonthDayYearDateFormatted(model.user.dateofBirthDataTime)} ,${model.user.genderDescription} ${model.user.ageDesc}',
'${DateUtil.getMonthDayYearDateFormatted(model.user.dateofBirthDataTime)} ,${model.user.gender == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female} ${model.user.age.toString() + "y"}',
color: Colors.grey[100],
fontWeight: FontWeight.normal,
fontSize: 14,
@ -387,9 +387,10 @@ class _HomePageState extends State<HomePage> {
child: Center(
child: Texts(
TranslationBase.of(context)
.viewMore,
.myMedicalFile,
color: Colors.white,
fontSize: 12,
textAlign: TextAlign.center,
),
),
),
@ -461,23 +462,27 @@ class _HomePageState extends State<HomePage> {
],
),
Padding(
padding: const EdgeInsets.only(bottom: 15, right: 15, left: 15),
padding:
const EdgeInsets.only(bottom: 15, right: 15, left: 15),
child: InkWell(
onTap: (){
Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesHomePage()));
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => PackagesHomePage()));
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Color(0xffB8382C),
borderRadius: BorderRadius.circular(10),
color: Color(0xffB8382C),
),
child: Padding(
padding: const EdgeInsets.all(8),
child: Row(
children: [
Texts(
TranslationBase.of(context).offerAndPackages,
color: Colors.white, fontSize: 20, fontWeight: FontWeight.normal,
TranslationBase.of(context).offerAndPackages,
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.normal,
),
Spacer(),
Image.asset("assets/images/offer_icon.png"),
@ -833,7 +838,7 @@ class _HomePageState extends State<HomePage> {
}
getPharmacyToken(DashboardViewModel model) async {
if(!model.isLogin) {
if (!model.isLogin) {
Navigator.push(context, FadePage(page: LandingPagePharmacy()));
} else {
GifLoaderDialogUtils.showMyDialog(context);

@ -543,7 +543,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
children: [
HomePage(
goToMyProfile: () {
_changeCurrentTab(0);
_changeCurrentTab(1);
},
),
MedicalProfilePage(),

@ -31,6 +31,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:intl/intl.dart';
import 'package:local_auth/auth_strings.dart';
import 'package:local_auth/local_auth.dart';
import 'package:provider/provider.dart';
// import 'package:smart_progress_bar/smart_progress_bar.dart';
@ -383,10 +384,21 @@ class _ConfirmLogin extends State<ConfirmLogin> {
loginWithFingurePrintFace(type, isActive) async {
if (isActive == 1) {
// this.startBiometricLoginIfAvailable();
authenticated = await auth.authenticateWithBiometrics(
localizedReason: 'Scan your fingerprint to authenticate',
useErrorDialogs: true,
stickyAuth: true);
const iosStrings = const IOSAuthMessages(
cancelButton: 'cancel',
goToSettingsButton: 'settings',
goToSettingsDescription: 'Please set up your Touch ID.',
lockOut: 'Please reenable your Touch ID');
try {
authenticated = await auth.authenticateWithBiometrics(
localizedReason: 'Scan your fingerprint to authenticate',
useErrorDialogs: true,
stickyAuth: true,
iOSAuthStrings: iosStrings);
} on PlatformException catch (e) {
AppToast.showErrorToast(message: e.toString());
}
if (authenticated == true) {
if (user != null && (user.logInType == 2 || user.logInType == 3)) {
@ -530,6 +542,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
userData = result.list,
// sharedPref.setString(
// BLOOD_TYPE, result['PatientBloodType']),
authenticatedUserObject.user = result.list,
sharedPref.setObject(MAIN_USER, result.list),
sharedPref.setObject(USER_PROFILE, result.list),
loginTokenID = result.logInTokenID,

@ -21,7 +21,7 @@ class _ForgotPassword extends State<ForgotPassword> {
String selectedType = 'Saudi Arabia';
String countryCode = '966';
final TextEditingController nationalIDorFile = null;
String mobileNo;
String mobileNo = "";
var con;
@override
Widget build(BuildContext context) {
@ -53,9 +53,15 @@ class _ForgotPassword extends State<ForgotPassword> {
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[],
),
MobileNo(
onNumberChange: (value) => {mobileNo = value},
onCountryChange: (value) => countryCode = value),
MobileNo(onNumberChange: (value) {
setState(() {
mobileNo = value;
});
}, onCountryChange: (value) {
setState(() {
countryCode = value;
});
}),
],
),
),
@ -73,6 +79,10 @@ class _ForgotPassword extends State<ForgotPassword> {
sendPatientIDBySMS();
// print(mobileNo.text);
},
color: mobileNo.length >= 9 == true
? Colors.grey[900]
: Colors.grey,
textColor: Colors.white,
)),
],
),
@ -85,7 +95,7 @@ class _ForgotPassword extends State<ForgotPassword> {
sendPatientIDBySMS() {
GifLoaderDialogUtils.showMyDialog(context);
final authService = new AuthProvider();
authService.sendPatientIDSMS(mobileNo, context).then((res) {
authService.sendPatientIDSMS(mobileNo, countryCode, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
this.startSMSService(mobileNo, res['LogInTokenID']);

@ -265,6 +265,7 @@ class _Login extends State<Login> {
authenticatedUserObject.isLogin = true;
appointmentRateViewModel.isLogin = true;
projectViewModel.isLogin = true;
authenticatedUserObject.user = result.list;
projectViewModel.user = authenticatedUserObject.user;
await pharmacyModuleViewModel.generatePharmacyToken().then((value) async {

@ -376,26 +376,16 @@ class AuthProvider with ChangeNotifier {
}
}
Future<Map> sendPatientIDSMS(mobileNo, context) async {
Future<Map> sendPatientIDSMS(mobileNo, zipCode, context) async {
Map<String, dynamic> request;
// var languageID =
// await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
// "LanguageID": languageID == 'ar' ? 1 : 2,
// "IPAdress": "10.20.10.20",
// "VersionID": req.VersionID,
// "Channel": req.Channel,
// "generalid": 'Cs2020@2016\$2958',
// "PatientOutSA": 0,
// "PatientID": 0,
// "TokenID": "",
"PatientOutSA": zipCode == '+966' ? 0 : 1,
"PatientMobileNumber": mobileNo,
"SearchType": 2,
// "ZipCode": "966",
// "PatientIdentificationID": "",
"ZipCode": zipCode,
"DeviceTypeID": req.DeviceTypeID,
// "SessionID": null
};
dynamic localRes;

@ -160,8 +160,13 @@ class _AppDrawerState extends State<AppDrawer> {
children: <Widget>[
InkWell(
child: DrawerItem(
TranslationBase.of(context).arabicChange,
Icons.translate),
TranslationBase.of(context).arabicChange,
Padding(
child:
Image.asset('assets/images/lang.png'),
padding: EdgeInsets.all(3)),
isImageIcon: true,
),
onTap: () {
sharedPref.setBool(IS_ROBOT_INIT, null);
if (projectProvider.isArabic) {
@ -304,7 +309,7 @@ class _AppDrawerState extends State<AppDrawer> {
padding: EdgeInsets.only(left: 5, right: 5),
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),
AppText(TranslationBase.of(context).fileno + ": " + result.patientID.toString(), color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black),
]))),
],
)))

@ -9,19 +9,21 @@ import 'package:flutter/material.dart';
class DrawerItem extends StatefulWidget {
final String title;
final String subTitle;
final IconData icon;
final icon;
final Color textColor;
final Color iconColor;
final bool bottomLine;
final bool sideArrow;
final Widget count;
final bool isImageIcon;
DrawerItem(this.title, this.icon,
{this.textColor,
this.iconColor,
this.subTitle = '',
this.bottomLine = true,
this.count,
this.sideArrow = false});
this.sideArrow = false,
this.isImageIcon = false});
@override
_DrawerItemState createState() => _DrawerItemState();
@ -47,13 +49,15 @@ class _DrawerItemState extends State<DrawerItem> {
children: <Widget>[
Expanded(
flex: 1,
child: Icon(
widget.icon,
color: widget.iconColor == null
? Theme.of(context).textTheme.bodyText1.color
: widget.iconColor,
size: SizeConfig.imageSizeMultiplier * 5,
)),
child: widget.isImageIcon == true
? widget.icon
: Icon(
widget.icon,
color: widget.iconColor == null
? Theme.of(context).textTheme.bodyText1.color
: widget.iconColor,
size: SizeConfig.imageSizeMultiplier * 5,
)),
Expanded(
flex: 7,
child: Column(

@ -1,24 +1,14 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/mobile_number.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../Constants.dart';
// OWNER : Ibrahim albitar
// DATE : 12-04-2020
// DESCRIPTION : Customization for Texts in app
class MobileNo extends StatefulWidget {
final bool disabled;
// final String data;
final List<Countries> countries = [
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;
final double marginRight;
@ -44,9 +34,18 @@ class MobileNo extends StatefulWidget {
}
class _MobileNo extends State<MobileNo> {
var _selectedType = '966';
String countryCode = '966';
var _selectedType = '+966';
String countryCode = '+966';
List<Countries> counties = [];
ProjectViewModel projectProvider;
@override
void initState() {
countriesData.forEach((element) {
this.counties.add(Countries.fromJson(element));
});
super.initState();
}
@override
Widget build(BuildContext context) {
projectProvider = Provider.of(context);
@ -83,11 +82,13 @@ class _MobileNo extends State<MobileNo> {
_selectedType = value;
})
},
items: widget.countries
.map<DropdownMenuItem<String>>((Countries value) {
items: counties.map<DropdownMenuItem<String>>(
(Countries value) {
return DropdownMenuItem<String>(
value: value.code,
child: Text(projectProvider.isArabic == true ? value.name_ar : value.name),
child: Text(projectProvider.isArabic == true
? value.nameAr
: value.name),
);
}).toList())))),
),
@ -124,13 +125,19 @@ class _MobileNo extends State<MobileNo> {
left: widget.marginLeft),
child: TextField(
controller: widget.controller,
keyboardType: TextInputType.phone,
keyboardType: TextInputType.number,
maxLength: 10,
// maxLengthEnforced: true,
// onChanged: (value) {
// widget.controller.text = countryCode;
// },
onChanged: (value) => widget.onNumberChange(value),
decoration: InputDecoration(
border: InputBorder.none, hintText: '5xxxxxxxx'),
counterText: "",
border: InputBorder.none,
hintText: '5xxxxxxxx'),
),
),
)
@ -140,10 +147,10 @@ class _MobileNo extends State<MobileNo> {
}
}
class Countries {
final String name;
final String name_ar;
final String code;
// class Countries {
// final String name;
// final String name_ar;
// final String code;
Countries({this.name, this.name_ar, this.code});
}
// Countries({this.name, this.name_ar, this.code});
// }

Loading…
Cancel
Save