Merge branch 'elham' into 'development'

Elham

See merge request Cloud_Solution/doctor_app_flutter!120
merge-requests/121/merge
Elham 6 years ago
commit 69b02e29c5

@ -41,7 +41,7 @@ class BaseAppClient {
body['DoctorID'] = doctorProfile?.doctorID;
body['EditedBy'] = doctorProfile?.doctorID;
body['ProjectID'] = doctorProfile?.projectID;
// if (!body.containsKey('ClinicID'))
if (body['ClinicID'] == null)
body['ClinicID'] = doctorProfile?.clinicID;
}
body['TokenID'] = token ?? '';

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/models/clinic_model.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:flutter/cupertino.dart';
@ -21,7 +22,7 @@ enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED }
class AuthProvider with ChangeNotifier {
List <ClinicModel>doctorsClinicList=[];
bool isLogin= false;
bool isLoading = true;
AuthProvider(){
@ -134,6 +135,11 @@ class AuthProvider with ChangeNotifier {
await BaseAppClient.post(MEMBER_CHECK_ACTIVATION_CODE_NEW,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
response['List_DoctorsClinic'].forEach((v) {
doctorsClinicList.add(new ClinicModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
throw error;
}, body: activationCodeModel);

@ -9,6 +9,7 @@ class ChangePasswordScreen extends StatelessWidget {
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: false,
body: SafeArea(
child: ListView(children: <Widget>[
Container(

@ -12,8 +12,8 @@ import '../../widgets/auth/login_form.dart';
import '../../widgets/shared/app_scaffold_widget.dart';
import '../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class Loginsreen extends StatefulWidget {
@override
_LoginsreenState createState() => _LoginsreenState();
@ -56,10 +56,10 @@ class _LoginsreenState extends State<Loginsreen> {
@override
Widget build(BuildContext context) {
getSharedPref();
return AppScaffold(
isLoading: _isLoading,
isShowAppBar: false,
body: SafeArea(
child: ListView(children: <Widget>[
FutureBuilder(
@ -80,24 +80,24 @@ class _LoginsreenState extends State<Loginsreen> {
children: <Widget>[
(platformImei == null)
? Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AuthHeader(loginType.knownUser),
LoginForm(
changeLoadingStata:
changeLoadingStata,
),
],
)
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AuthHeader(loginType.knownUser),
LoginForm(
changeLoadingStata:
changeLoadingStata,
),
],
)
: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AuthHeader(loginType.unknownUser),
KnownUserLogin(),
],
),
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AuthHeader(loginType.unknownUser),
KnownUserLogin(),
],
),
]));
}
}

@ -38,6 +38,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
Widget build(BuildContext context) {
return AppScaffold(
isLoading: _isLoading,
isShowAppBar: false,
body: ListView(children: <Widget>[
Container(
margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),

@ -30,6 +30,7 @@ class _VerifyAccountScreenState extends State<VerifyAccountScreen> {
Widget build(BuildContext context) {
return AppScaffold(
isLoading: _isLoading,
isShowAppBar: false,
body: SafeArea(
child: ListView(children: <Widget>[
Container(

@ -1,28 +1,36 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/clinic_model.dart';
import 'package:doctor_app_flutter/models/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/profile_req_Model.dart';
import 'package:doctor_app_flutter/providers/auth_provider.dart';
import 'package:doctor_app_flutter/providers/doctor_reply_provider.dart';
import 'package:doctor_app_flutter/providers/medicine_provider.dart';
import 'package:doctor_app_flutter/providers/hospital_provider.dart';
import 'package:doctor_app_flutter/providers/medicine_provider.dart';
import 'package:doctor_app_flutter/providers/referral_patient_provider.dart';
import 'package:doctor_app_flutter/providers/referred_patient_provider.dart';
import 'package:doctor_app_flutter/screens/QR_reader_screen.dart';
import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:provider/provider.dart';
import '../routes.dart';
import '../widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:percent_indicator/circular_percent_indicator.dart';
import 'package:provider/provider.dart';
import '../presentation/doctor_app_icons.dart';
import '../routes.dart';
import '../widgets/dashboard/dashboard_item_icons_texts.dart';
import '../widgets/dashboard/dashboard_item_texts_widget.dart';
import '../widgets/shared/app_texts_widget.dart';
import '../widgets/shared/rounded_container_widget.dart';
import 'doctor/doctor_reply_screen.dart';
import 'doctor/my_referral_patient_screen.dart';
import 'doctor/my_referred_patient_screen.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Helpers helpers = Helpers();
class DashboardScreen extends StatefulWidget {
DashboardScreen({Key key, this.title}) : super(key: key);
@ -33,19 +41,23 @@ class DashboardScreen extends StatefulWidget {
}
class _DashboardScreenState extends State<DashboardScreen> {
HospitalProvider projectsProvider;
HospitalProvider hospitalProvider;
AuthProvider authProvider;
bool isLoading = false;
@override
Widget build(BuildContext context) {
hospitalProvider = Provider.of(context);
authProvider = Provider.of(context);
print(authProvider.doctorsClinicList);
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
projectsProvider = Provider.of(context);
return SafeArea(
bottom: true,
child: Scaffold(
child: AppScaffold(
isShowAppBar: false,
isLoading: isLoading,
body: SingleChildScrollView(
child: SizedBox(
height: MediaQuery.of(context).size.height * 1.09,
@ -65,12 +77,20 @@ class _DashboardScreenState extends State<DashboardScreen> {
),
alignment: Alignment.centerLeft,
),
Container(
margin: EdgeInsets.only(left: 10, top: 10, right: 10),
child: Icon(
Icons.settings,
size: SizeConfig.textMultiplier * 2.5,
))
InkWell(
onTap: () {
showCupertinoPicker(
context: context,
actionList: authProvider.doctorsClinicList);
},
child: Container(
margin:
EdgeInsets.only(left: 10, top: 10, right: 10),
child: Icon(
Icons.settings,
size: SizeConfig.textMultiplier * 2.5,
)),
)
]),
Container(
margin: EdgeInsets.only(left: 10, top: 5),
@ -413,17 +433,103 @@ class _DashboardScreenState extends State<DashboardScreen> {
)),
],
),
//)
// ,
//constraints: new BoxConstraints(),
),
),
),
);
}
// Container(
showCupertinoPicker(
{context, List<ClinicModel> actionList, decKey, onSelectFun}) {
showModalBottomSheet(
isDismissible: false,
isScrollControlled: true,
context: context,
builder: (BuildContext builder) {
return Container(
// height: 500,
height: SizeConfig.realScreenHeight * 0.4,
color: Color(0xfff7f7f7),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Container(
color: Color(0xfff7f7f7),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
CupertinoButton(
child: Text(
'Cancel'.toUpperCase(),
// style: TextStyle(context)
),
onPressed: () {
Navigator.pop(context);
},
),
CupertinoButton(
child: Text(
'Done'.toUpperCase(),
// style: textStyle(context),
),
onPressed: () {
Navigator.pop(context);
// onSelectFun(cupertinoPickerIndex);
},
)
],
),
),
Container(
height: SizeConfig.realScreenHeight * 0.3,
color: Color(0xfff7f7f7),
child: Column(
children: actionList
.map((e) => Container(
child: InkWell(
onTap: () =>
changeClinic(e.clinicID, context),
child: Text(
e.clinicName,
style: TextStyle(fontSize: 15),
)),
))
.toList(),
))
],
),
);
});
}
changeClinic(clinicId, BuildContext context) async {
Navigator.pop(context);
changeIsLoading(true);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile);
ProfileReqModel docInfo = new ProfileReqModel(
doctorID: doctorProfile.doctorID,
clinicID: clinicId,
license: true,
projectID: doctorProfile.projectID,
tokenID: '',
languageID: 2);
// authProvider.getDocProfiles(docInfo)
authProvider.getDocProfiles(docInfo.toJson()).then((res) async {
changeIsLoading(false);
sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]);
}).catchError((err) {
changeIsLoading(false);
helpers.showErrorToast(err);
});
}
// );
changeIsLoading(bool val) {
setState(() {
this.isLoading = val;
});
}
}

@ -1,11 +1,11 @@
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
class MessagesScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
return AppScaffold(
isShowAppBar: false,
body: Center(
child: Text('Messages heeer'),
),

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/providers/schedule_provider.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/doctor/my_schedule_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:flutter/material.dart';
@ -13,7 +14,8 @@ class MyScheduleScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
scheduleProvider = Provider.of(context);
return Scaffold(
return AppScaffold(
isShowAppBar: false,
body: scheduleProvider.isLoading
? DrAppCircularProgressIndeicator()
: scheduleProvider.isError

@ -4,7 +4,8 @@ import 'package:flutter/material.dart';
class ServicesScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
return AppScaffold(
isShowAppBar: false,
body: Center(
child: Text('Services heeer'),
),

@ -98,7 +98,8 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
});
}
} catch (err) {
handelCatchErrorCase(err);
error = err;
// handelCatchErrorCase(err);
}
}

@ -106,7 +106,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
setState(() {
_isError = true;
_isLoading = false;
this.error = helpers.generateContactAdminMsg(error);
this.error = error;
});
});
}

@ -359,13 +359,9 @@ class _VerifyAccountState extends State<VerifyAccount> {
loginProcessCompleted(
res['List_DoctorProfile'][0], changeLoadingStata);
} else {
_asyncSimpleDialog(context, res['List_DoctorsClinic'], 'ClinicName',
'Please Select Clinic')
.then((clinicInfo) {
ClinicModel clinic = ClinicModel.fromJson(clinicInfo);
print(clinicInfo);
getDocProfiles(clinic, changeLoadingStata);
});
ClinicModel clinic =
ClinicModel.fromJson(res['List_DoctorsClinic'][0]);
getDocProfiles(clinic, changeLoadingStata);
}
} else {
changeLoadingStata(false);
@ -373,9 +369,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
}
}).catchError((err) {
changeLoadingStata(false);
print('$err');
helpers.showErrorToast();
helpers.showErrorToast(err);
});
} else {
// changeLoadingStata(false);
@ -435,18 +429,14 @@ class _VerifyAccountState extends State<VerifyAccount> {
languageID: 2);
authProv.getDocProfiles(docInfo.toJson()).then((res) {
if (res['MessageStatus'] == 1) {
print("DoctorProfileList ${res['DoctorProfileList'][0]}");
loginProcessCompleted(res['DoctorProfileList'][0], changeLoadingStata);
} else {
changeLoadingStata(false);
helpers.showErrorToast(res['ErrorEndUserMessage']);
}
}).catchError((err) {
print('$err');
changeLoadingStata(false);
print('$err');
helpers.showErrorToast();
helpers.showErrorToast(err);
});
}
}

@ -9,15 +9,16 @@ class AppScaffold extends StatelessWidget {
String appBarTitle;
Widget body;
bool isLoading;
bool isShowAppBar;
AppScaffold({this.appBarTitle ='', this.body, this.isLoading = false});
AppScaffold({this.appBarTitle ='', this.body, this.isLoading = false, this.isShowAppBar = true});
@override
Widget build(BuildContext context) {
AppGlobal.CONTEX = context;
return Scaffold(
backgroundColor: Hexcolor('#F5F5F5'),
appBar: appBarTitle != ''
appBar: isShowAppBar
? AppBar(
elevation: 0,
backgroundColor: Hexcolor('#515B5D'),

Loading…
Cancel
Save