Merge branch 'development' into 'master'

Development

See merge request Cloud_Solution/doctor_app_flutter!164
pull/169/head
Elham 4 years ago
commit ff849c9a48

@ -17,11 +17,17 @@ class AuthProvider with ChangeNotifier {
bool isLoading = true;
DoctorProfileModel doctorProfile;
setDoctorProfile(DoctorProfileModel profileModel){
doctorProfile = profileModel;
notifyListeners();
}
AuthProvider() {
getUserAuthentication();
}
void getUserAuthentication() async {
getUserAuthentication() async {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) {
doctorProfile = new DoctorProfileModel.fromJson(profile);
@ -148,7 +154,7 @@ class AuthProvider with ChangeNotifier {
await BaseAppClient.post(GET_DOC_PROFILES,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
//ClinicDescription
doctorProfile = DoctorProfileModel.fromJson(response['DoctorProfileList'][0]);
selectedClinicName =
response['DoctorProfileList'][0]['ClinicDescription'];
}, onFailure: (String error, int statusCode) {

@ -2,6 +2,7 @@ import 'dart:async';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart';
import 'package:doctor_app_flutter/widgets/auth/show_timer_text.dart';
import 'package:flutter/material.dart';
@ -362,7 +363,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
"IsSilentLogIN": false
};
authProv.memberCheckActivationCodeNew(model).then((res) {
authProv.memberCheckActivationCodeNew(model).then((res) async{
if (res['MessageStatus'] == 1) {
sharedPref.setString(TOKEN, res['AuthenticationTokenID']);
if (res['List_DoctorProfile'] != null) {
@ -393,6 +394,9 @@ class _VerifyAccountState extends State<VerifyAccount> {
*/
loginProcessCompleted(
Map<String, dynamic> profile, Function changeLoadingStata) {
var doctor = DoctorProfileModel.fromJson(profile);
authProv.setDoctorProfile(doctor);
changeLoadingStata(false);
sharedPref.setObj(DOCTOR_PROFILE, profile);
Navigator.of(context).pushReplacementNamed(HOME);

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/providers/auth_provider.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@ -28,30 +29,22 @@ class AppDrawer extends StatefulWidget {
class _AppDrawerState extends State<AppDrawer> {
bool _isInit = true;
DoctorProfileModel doctorProfile;
Helpers helpers = new Helpers();
@override
void didChangeDependencies() {
super.didChangeDependencies();
// if (_isInit) {
getDocProfile(); // TODO: Refactor this code to prevent errors in the cosole.
// }
_isInit = false;
}
// @override
// void didChangeDependencies() {
// super.didChangeDependencies();
// // if (_isInit) {
// getDocProfile(); // TODO: Refactor this code to prevent errors in the cosole.
// // }
// _isInit = false;
// }
getDocProfile() async {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
// doctorProfile = DoctorProfileModel.fromJson(profile);
setState(() {
doctorProfile = DoctorProfileModel.fromJson(profile);
});
String token = await sharedPref.getString(TOKEN);
}
@override
Widget build(BuildContext context) {
// var x = getDocProfile();
AuthProvider authProvider = Provider.of(context);
return RoundedContainer(
child: Container(
color: Colors.white,
@ -82,13 +75,13 @@ class _AppDrawerState extends State<AppDrawer> {
CircleAvatar(
radius: SizeConfig.imageSizeMultiplier * 12,
backgroundImage:
NetworkImage(doctorProfile.doctorImageURL),
NetworkImage(authProvider.doctorProfile.doctorImageURL),
backgroundColor: Colors.white,
),
Padding(
padding: EdgeInsets.only(top: 10),
child: AppText(
doctorProfile.doctorName,
authProvider.doctorProfile?.doctorName,
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: SizeConfig.textMultiplier * 2,
@ -116,8 +109,8 @@ class _AppDrawerState extends State<AppDrawer> {
onTap: () {
//Navigator.of(context).pushNamed(PROFILE);
Navigator.of(context).pushNamed(PROFILE, arguments: {
'title': doctorProfile.doctorName,
"doctorProfileall": doctorProfile
'title': authProvider.doctorProfile.doctorName,
"doctorProfileall": authProvider.doctorProfile
});
},
),

@ -35,7 +35,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.1"
version: "2.4.2"
barcode_scan:
dependency: "direct main"
description:
@ -127,6 +127,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "7.1.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
charcode:
dependency: transitive
description:
@ -175,7 +182,7 @@ packages:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.12"
version: "1.14.13"
connectivity:
dependency: "direct main"
description:
@ -253,6 +260,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.1.4"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
fixnum:
dependency: transitive
description:
@ -357,13 +371,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.4"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.12"
imei_plugin:
dependency: "direct main"
description:
@ -426,7 +433,7 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.6"
version: "0.12.8"
meta:
dependency: transitive
description:
@ -475,7 +482,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.4"
version: "1.7.0"
pedantic:
dependency: transitive
description:
@ -504,13 +511,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
platform:
dependency: transitive
description:
@ -655,7 +655,7 @@ packages:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.3"
version: "1.9.5"
stream_channel:
dependency: transitive
description:
@ -690,7 +690,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.15"
version: "0.2.17"
timing:
dependency: transitive
description:
@ -704,7 +704,7 @@ packages:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
version: "1.2.0"
url_launcher:
dependency: "direct main"
description:
@ -754,13 +754,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "3.6.1"
yaml:
dependency: transitive
description:
@ -769,5 +762,5 @@ packages:
source: hosted
version: "2.2.1"
sdks:
dart: ">=2.7.0 <3.0.0"
dart: ">=2.9.0-14.0.dev <3.0.0"
flutter: ">=1.12.13+hotfix.5 <2.0.0"

Loading…
Cancel
Save