Merge branch 'develop' into 'master'

Develop

See merge request Cloud_Solution/doctor_app_flutter!26
merge-requests/27/merge
ibrahim albitar 5 years ago
commit 262a8ff163

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/interceptor/http_interceptor.dart'; import 'package:doctor_app_flutter/interceptor/http_interceptor.dart';
import 'package:http/http.dart'; import 'package:http/http.dart';
@ -6,7 +7,6 @@ import 'package:http/http.dart';
// DESCRIPTION : Custom App client to pin base url for all srvices // DESCRIPTION : Custom App client to pin base url for all srvices
class AppClient { class AppClient {
static const String BASE_URL = "https://hmgwebservices.com/";
static Client client = HttpInterceptor().getClient(); static Client client = HttpInterceptor().getClient();

@ -1,2 +1,5 @@
const MAX_SMALL_SCREEN = 660; const MAX_SMALL_SCREEN = 660;
const BASE_URL = 'https://hmgwebservices.com/Services/'; const BASE_URL = 'https://hmgwebservices.com/Services/';
const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z]";
const ONLY_DATE = "[0-9/]";

@ -1,22 +1,19 @@
import 'dart:convert'; import 'dart:convert';
import 'package:doctor_app_flutter/client/app_client.dart'; import 'package:doctor_app_flutter/client/app_client.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import '../config/config.dart';
import '../interceptor/http_interceptor.dart';
import '../models/user_model.dart'; import '../models/user_model.dart';
const LOGIN_URL = const LOGIN_URL =
'Services/Sentry.svc/REST/MemberLogIN_New'; 'Sentry.svc/REST/MemberLogIN_New';
const INSERT_DEVICE_IMEI = const INSERT_DEVICE_IMEI =
'Services/Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI'; 'Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI';
const SELECT_DEVICE_IMEI = const SELECT_DEVICE_IMEI =
'Services/Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI'; 'Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI';
const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE =
'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; 'Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType';
const MEMBER_CHECK_ACTIVATION_CODE_NEW ='Services/Sentry.svc/REST/MemberCheckActivationCode_New'; const MEMBER_CHECK_ACTIVATION_CODE_NEW ='Sentry.svc/REST/MemberCheckActivationCode_New';
class AuthProvider with ChangeNotifier { class AuthProvider with ChangeNotifier {
Future<Map> login(UserModel userInfo) async { Future<Map> login(UserModel userInfo) async {
const url = LOGIN_URL; const url = LOGIN_URL;

@ -1,9 +1,9 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:flutter/services.dart';
import '../../config/size_config.dart'; import '../../config/size_config.dart';
import '../../util/text_validator.dart';
import '../../widgets/shared/app_buttons_widget.dart'; import '../../widgets/shared/app_buttons_widget.dart';
import '../../widgets/shared/app_scaffold_widget.dart'; import '../../widgets/shared/app_scaffold_widget.dart';
import '../../widgets/shared/app_text_form_field.dart'; import '../../widgets/shared/app_text_form_field.dart';
@ -15,6 +15,7 @@ import 'package:flutter/rendering.dart';
import '../../lookups/patient_lookup.dart'; import '../../lookups/patient_lookup.dart';
import '../../models/patient_model.dart'; import '../../models/patient_model.dart';
import '../../widgets/patients/dynamic_elements.dart'; import '../../widgets/patients/dynamic_elements.dart';
import '../../config/config.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -57,12 +58,12 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
PatientOutSA: false); PatientOutSA: false);
void _validateInputs() { void _validateInputs() {
print({_patientSearchFormValues.ProjectID}); print("####IBRAHIM TEST#####"+_patientSearchFormValues.From);
// _patientSearchFormValues.TokenID = // _patientSearchFormValues.TokenID =
if (_formKey.currentState.validate()) { if (_formKey.currentState.validate()) {
// If all data are correct then save data to out variables // If all data are correct then save data to out variables
// _formKey.currentState.save(); _formKey.currentState.save();
sharedPref.getString(TOKEN).then((token) { sharedPref.getString(TOKEN).then((token) {
print(token+"EEEEEE"); print(token+"EEEEEE");
@ -173,9 +174,10 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
onSaved: (value) { onSaved: (value) {
_patientSearchFormValues.FirstName = value; _patientSearchFormValues.FirstName = value;
}, },
validator: (value) { // validator: (value) {
return TextValidator().validateName(value); // return TextValidator().validateName(value);
}, // },
inputFormatter: ONLY_LETTERS
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -185,9 +187,10 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
onSaved: (value) { onSaved: (value) {
_patientSearchFormValues.MiddleName = value; _patientSearchFormValues.MiddleName = value;
}, },
validator: (value) { // validator: (value) {
return TextValidator().validateName(value); // return TextValidator().validateName(value);
}, // },
inputFormatter: ONLY_LETTERS
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -197,9 +200,10 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
onSaved: (value) { onSaved: (value) {
_patientSearchFormValues.LastName = value; _patientSearchFormValues.LastName = value;
}, },
validator: (value) { // validator: (value) {
return TextValidator().validateName(value); // return TextValidator().validateName(value);
}, // },
inputFormatter: ONLY_LETTERS
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -207,9 +211,10 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
AppTextFormField( AppTextFormField(
textInputType: TextInputType.number, textInputType: TextInputType.number,
hintText: 'Phone Number', hintText: 'Phone Number',
validator: (value) { // validator: (value) {
return TextValidator().validateMobile(value); // return TextValidator().validateMobile(value);
}, // },
inputFormatter: ONLY_NUMBERS,
onSaved: (value) { onSaved: (value) {
_patientSearchFormValues.PatientMobileNumber = _patientSearchFormValues.PatientMobileNumber =
value; value;
@ -221,9 +226,8 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
AppTextFormField( AppTextFormField(
textInputType: TextInputType.number, textInputType: TextInputType.number,
hintText: 'Patiant ID', hintText: 'Patiant ID',
validator: (value) { //
return TextValidator().validateIdNumber(value); inputFormatter: ONLY_NUMBERS,
},
onSaved: (value) { onSaved: (value) {
_patientSearchFormValues.PatientID = 89000; _patientSearchFormValues.PatientID = 89000;
}), }),
@ -233,9 +237,10 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
AppTextFormField( AppTextFormField(
textInputType: TextInputType.number, textInputType: TextInputType.number,
hintText: 'Patiant File', hintText: 'Patiant File',
validator: (value) { // validator: (value) {
return TextValidator().validateIdNumber(value); // return TextValidator().validateIdNumber(value);
}, // },
inputFormatter: ONLY_NUMBERS,
onSaved: (value) { onSaved: (value) {
//_patientSearchFormValues. = value; //_patientSearchFormValues. = value;
}, },

@ -1,7 +1,7 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/models/patient_model.dart'; import 'package:doctor_app_flutter/models/patient_model.dart';
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../util/text_validator.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
class DynamicElements extends StatefulWidget { class DynamicElements extends StatefulWidget {
@ -51,14 +51,15 @@ class _DynamicElementsState extends State<DynamicElements> {
textInputType: TextInputType.number, textInputType: TextInputType.number,
hintText: 'From', hintText: 'From',
controller: _fromDateController, controller: _fromDateController,
validator: (value) { // validator: (value) {
return TextValidator().validateDate(_fromDateController.text); // return TextValidator().validateDate(_fromDateController.text);
}, // },
inputFormatter: ONLY_DATE,
onTap: () { onTap: () {
_presentDatePicker('_selectedFromDate'); _presentDatePicker('_selectedFromDate');
}, },
onSaved: (value) { onSaved: (value) {
widget._patientSearchFormValues.From = value; widget._patientSearchFormValues.From = _fromDateController.text;
}, },
), ),
@ -72,11 +73,12 @@ class _DynamicElementsState extends State<DynamicElements> {
onTap: () { onTap: () {
_presentDatePicker('_selectedToDate'); _presentDatePicker('_selectedToDate');
}, },
validator: (value) { // validator: (value) {
return TextValidator().validateDate(_toDateController.text); // return TextValidator().validateDate(_toDateController.text);
}, // },
inputFormatter: ONLY_DATE,
onSaved: (value) { onSaved: (value) {
widget._patientSearchFormValues.To = value; widget._patientSearchFormValues.To = _toDateController.text;
}, },
), ),
], ],

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
// OWNER : Ibrahim albitar // OWNER : Ibrahim albitar
// DATE : 19-04-2020 // DATE : 19-04-2020
@ -10,6 +11,7 @@ class AppTextFormField extends FormField<String> {
AppTextFormField({ AppTextFormField({
FormFieldSetter<String> onSaved, FormFieldSetter<String> onSaved,
String inputFormatter,
FormFieldValidator<String> validator, FormFieldValidator<String> validator,
ValueChanged<String> onChanged, ValueChanged<String> onChanged,
GestureTapCallback onTap, GestureTapCallback onTap,
@ -26,6 +28,7 @@ class AppTextFormField extends FormField<String> {
children: <Widget>[ children: <Widget>[
TextFormField( TextFormField(
keyboardType: textInputType, keyboardType: textInputType,
inputFormatters: [WhitelistingTextInputFormatter(RegExp(inputFormatter)),],
onChanged: onChanged?? (value){ onChanged: onChanged?? (value){
state.didChange(value); state.didChange(value);
}, },

Loading…
Cancel
Save