Merge branch 'development' into 'master'

Development

See merge request Cloud_Solution/doctor_app_flutter!156
merge-requests/157/head
Mohammad Aljammal 6 years ago
commit 0ec443c588

@ -2,7 +2,7 @@ const MAX_SMALL_SCREEN = 660;
const ONLY_NUMBERS = "[0-9]"; const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]"; const ONLY_DATE = "[0-9/]";
//const BASE_URL = 'https://hmgwebservices.com/Services/'; //const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region"; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
@ -123,7 +123,7 @@ const TRANSACTION_NO = 0;
const LANGUAGE_ID = 2; const LANGUAGE_ID = 2;
const STAMP = '2020-04-27T12:17:17.721Z'; const STAMP = '2020-04-27T12:17:17.721Z';
const IP_ADDRESS = '11.11.11.11'; const IP_ADDRESS = '11.11.11.11';
const VERSION_ID = 1.2; const VERSION_ID = 5.3;
const CHANNEL = 9; const CHANNEL = 9;
const SESSION_ID = 'BlUSkYymTt'; const SESSION_ID = 'BlUSkYymTt';
const IS_LOGIN_FOR_DOCTOR_APP = true; const IS_LOGIN_FOR_DOCTOR_APP = true;

@ -1,4 +1,3 @@
/* /*
*@author: Ibrahim Albitar *@author: Ibrahim Albitar
*@Date:27/4/2020 *@Date:27/4/2020
@ -8,8 +7,6 @@
*/ */
class PharmaciesListRequestModel { class PharmaciesListRequestModel {
int itemID; int itemID;
int languageID; int languageID;
String stamp; String stamp;
@ -23,13 +20,13 @@ class PharmaciesListRequestModel {
int channel; int channel;
PharmaciesListRequestModel( PharmaciesListRequestModel(
{this.itemID , {this.itemID,
this.patientTypeID = 1, this.patientTypeID = 1,
this.languageID = 2, this.languageID = 2,
this.stamp = '2020-04-23T21:01:21.492Z', this.stamp = '2020-04-23T21:01:21.492Z',
this.ipAdress = '11.11.11.11', this.ipAdress = '11.11.11.11',
this.versionID = 1.2, this.versionID = 1.2,
this.tokenID , this.tokenID,
this.sessionID = 'e29zoooEJ4', this.sessionID = 'e29zoooEJ4',
this.isLoginForDoctorApp = true, this.isLoginForDoctorApp = true,
this.channel = 9, this.channel = 9,
@ -64,4 +61,4 @@ class PharmaciesListRequestModel {
data['Channel'] = this.channel; data['Channel'] = this.channel;
return data; return data;
} }
} }

@ -6,7 +6,6 @@
*@desc: *@desc:
*/ */
class PharmaciesItemsRequestModel { class PharmaciesItemsRequestModel {
String pHRItemName; String pHRItemName;
int pageIndex = 0; int pageIndex = 0;
@ -66,4 +65,4 @@ class PharmaciesItemsRequestModel {
data['DeviceTypeID'] = this.deviceTypeID; data['DeviceTypeID'] = this.deviceTypeID;
return data; return data;
} }
} }

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/models/doctor/clinic_model.dart';
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/models/doctor/doctor_profile_model.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/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
@ -14,6 +15,8 @@ class AuthProvider with ChangeNotifier {
String selectedClinicName; String selectedClinicName;
bool isLogin = false; bool isLogin = false;
bool isLoading = true; bool isLoading = true;
DoctorProfileModel doctorProfile;
AuthProvider() { AuthProvider() {
getUserAuthentication(); getUserAuthentication();
} }
@ -21,6 +24,7 @@ class AuthProvider with ChangeNotifier {
void getUserAuthentication() async { void getUserAuthentication() async {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) { if (profile != null) {
doctorProfile = new DoctorProfileModel.fromJson(profile);
isLoading = false; isLoading = false;
isLogin = true; isLogin = true;
} else { } else {
@ -117,7 +121,7 @@ class AuthProvider with ChangeNotifier {
localRes = response; localRes = response;
selectedClinicName = selectedClinicName =
ClinicModel.fromJson(response['List_DoctorsClinic'][0]).clinicName; ClinicModel.fromJson(response['List_DoctorsClinic'][0]).clinicName;
notifyListeners();
response['List_DoctorsClinic'].forEach((v) { response['List_DoctorsClinic'].forEach((v) {
doctorsClinicList.add(new ClinicModel.fromJson(v)); doctorsClinicList.add(new ClinicModel.fromJson(v));
}); });

@ -55,8 +55,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
bool isLoading = false; bool isLoading = false;
ProjectProvider projectsProvider; ProjectProvider projectsProvider;
var _isInit = true; var _isInit = true;
DoctorProfileModel profile;
void didChangeDependencies() { void didChangeDependencies() async {
super.didChangeDependencies(); super.didChangeDependencies();
if (_isInit) { if (_isInit) {
projectsProvider = Provider.of<ProjectProvider>(context); projectsProvider = Provider.of<ProjectProvider>(context);
@ -76,6 +77,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
authProvider = Provider.of(context); authProvider = Provider.of(context);
projectsProvider = Provider.of(context); projectsProvider = Provider.of(context);
FocusScopeNode currentFocus = FocusScope.of(context); FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) { if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus(); currentFocus.unfocus();
} }
@ -101,7 +103,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: AppText( child: AppText(
authProvider.selectedClinicName != null authProvider.selectedClinicName != null
? authProvider.selectedClinicName ? authProvider.selectedClinicName
: '', : authProvider.doctorProfile.clinicDescription,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 2.5,
), ),

@ -60,8 +60,8 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
hintText: TranslationBase.of(context).searchMedicineNameHere, hintText: TranslationBase.of(context).searchMedicineNameHere,
controller: myController, controller: myController,
onSaved: (value) {}, onSaved: (value) {},
onFieldSubmitted: (value){ onFieldSubmitted: (value) {
searchMedicine(context); searchMedicine(context);
}, },
textInputAction: TextInputAction.search, textInputAction: TextInputAction.search,
inputFormatter: ONLY_LETTERS), inputFormatter: ONLY_LETTERS),
@ -92,7 +92,10 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
children: <Widget>[ children: <Widget>[
AppText( AppText(
TranslationBase.of(context).youCanFind + TranslationBase.of(context).youCanFind +
(_medicineProvider.pharmacyItemsList == null ? "0" : _medicineProvider.pharmacyItemsList.length.toString()) + (_medicineProvider.pharmacyItemsList == null
? "0"
: _medicineProvider.pharmacyItemsList.length
.toString()) +
TranslationBase.of(context).itemsInSearch, TranslationBase.of(context).itemsInSearch,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
margin: 5, margin: 5,
@ -116,12 +119,19 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
: ListView.builder( : ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: _medicineProvider.pharmacyItemsList == null ? 0 : _medicineProvider.pharmacyItemsList.length, itemCount: _medicineProvider.pharmacyItemsList ==
null
? 0
: _medicineProvider.pharmacyItemsList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return InkWell( return InkWell(
child: MedicineItemWidget( child: MedicineItemWidget(
label: _medicineProvider.pharmacyItemsList[index]["ItemDescription"], label:
url: _medicineProvider.pharmacyItemsList[index]["ProductImageBase64"], _medicineProvider.pharmacyItemsList[index]
["ItemDescription"],
url:
_medicineProvider.pharmacyItemsList[index]
["ProductImageBase64"],
), ),
onTap: () { onTap: () {
Navigator.push( Navigator.push(
@ -129,9 +139,12 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) =>
PharmaciesListScreen( PharmaciesListScreen(
itemID: _medicineProvider.pharmacyItemsList[index]["ItemID"], itemID: _medicineProvider
url: _medicineProvider.pharmacyItemsList[index] .pharmacyItemsList[index]
["ProductImageBase64"]), ["ItemID"],
url: _medicineProvider
.pharmacyItemsList[index]
["ProductImageBase64"]),
), ),
); );
}, },

@ -42,6 +42,10 @@ class _VerifyAccountState extends State<VerifyAccount> {
AuthProvider authProv; AuthProvider authProv;
bool _isInit = true; bool _isInit = true;
var model; var model;
TextEditingController digit1 = TextEditingController(text: "");
TextEditingController digit2 = TextEditingController(text: "");
TextEditingController digit3 = TextEditingController(text: "");
TextEditingController digit4 = TextEditingController(text: "");
@override @override
void initState() { void initState() {
@ -103,6 +107,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
style: buildTextStyle(), style: buildTextStyle(),
autofocus: true, autofocus: true,
maxLength: 1, maxLength: 1,
controller: digit1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
decoration: buildInputDecoration(context), decoration: buildInputDecoration(context),
@ -126,6 +131,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
width: SizeConfig.realScreenWidth * 0.20, width: SizeConfig.realScreenWidth * 0.20,
child: TextFormField( child: TextFormField(
focusNode: focusD2, focusNode: focusD2,
controller: digit2,
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
maxLength: 1, maxLength: 1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
@ -153,6 +159,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
width: SizeConfig.realScreenWidth * 0.20, width: SizeConfig.realScreenWidth * 0.20,
child: TextFormField( child: TextFormField(
focusNode: focusD3, focusNode: focusD3,
controller: digit3,
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
maxLength: 1, maxLength: 1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
@ -179,6 +186,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
width: SizeConfig.realScreenWidth * 0.20, width: SizeConfig.realScreenWidth * 0.20,
child: TextFormField( child: TextFormField(
focusNode: focusD4, focusNode: focusD4,
controller: digit4,
maxLength: 1, maxLength: 1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: buildTextStyle(), style: buildTextStyle(),
@ -246,6 +254,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
if (value.isEmpty) { if (value.isEmpty) {
return 'Please enter your Password'; return 'Please enter your Password';
} }
return null; return null;
} }
@ -334,8 +343,9 @@ class _VerifyAccountState extends State<VerifyAccount> {
verifyAccountFormValue['digit2'] + verifyAccountFormValue['digit2'] +
verifyAccountFormValue['digit3'] + verifyAccountFormValue['digit3'] +
verifyAccountFormValue['digit4']; verifyAccountFormValue['digit4'];
print(activationCode);
int projectID = await sharedPref.getInt(PROJECT_ID); int projectID = await sharedPref.getInt(PROJECT_ID);
Map<String, dynamic> model = { Map<String, dynamic> model = {
"activationCode": activationCode, "activationCode": activationCode,
"DoctorID": _loggedUser['DoctorID'], "DoctorID": _loggedUser['DoctorID'],
@ -353,7 +363,6 @@ class _VerifyAccountState extends State<VerifyAccount> {
}; };
authProv.memberCheckActivationCodeNew(model).then((res) { authProv.memberCheckActivationCodeNew(model).then((res) {
// changeLoadingStata(false);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
sharedPref.setString(TOKEN, res['AuthenticationTokenID']); sharedPref.setString(TOKEN, res['AuthenticationTokenID']);
if (res['List_DoctorProfile'] != null) { if (res['List_DoctorProfile'] != null) {

Loading…
Cancel
Save