Merge branch 'prescription_delivery' into 'development'

add Prescription Delivery Address Page and fix the Authentication Pharmacy

See merge request Cloud_Solution/diplomatic-quarter!266
merge-requests/267/merge
Mohammad Aljammal 4 years ago
commit b8ded38dc2

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

@ -77,9 +77,9 @@ class CustomerAddressesService extends BaseService {
class CustomerInfo {
bool isRegistered;
String userName;
Null password;
dynamic password;
String email;
Null errorMessage;
dynamic errorMessage;
String mobileNumber;
int customerId;
@ -121,19 +121,19 @@ class AddressInfo {
String firstName;
String lastName;
String email;
Null company;
dynamic company;
int countryId;
String country;
Null stateProvinceId;
dynamic stateProvinceId;
String city;
String address1;
String address2;
String zipPostalCode;
String phoneNumber;
Null faxNumber;
dynamic faxNumber;
String customerAttributes;
String createdOnUtc;
Null province;
dynamic province;
String latLong;
AddressInfo(

@ -44,11 +44,13 @@ class BaseAppClient {
}
try {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
var pharmacyToken = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE);
if (!isExternal) {
String token = await sharedPref.getString(TOKEN);
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var user = await sharedPref.getObject(USER_PROFILE);
if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null
@ -109,14 +111,17 @@ class BaseAppClient {
print("URL : $url");
print("Body : ${json.encode(body)}");
var ss = json.encode(body);
if (await Utils.checkConnection()) {
final response = await http.post(url.trim(),
body: json.encode(body),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
'Accept': 'application/json',
'Authorization': pharmacyToken,
'Mobilenumber': user['MobileNumber'].toString(),
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user['PatientID'].toString(),
});
final int statusCode = response.statusCode;
print("statusCode :$statusCode");
@ -268,15 +273,6 @@ class BaseAppClient {
var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE);
Map test = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': token,
'Mobilenumber': user['MobileNumber'].toString(),
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user['PatientID'].toString(),
};
if (await Utils.checkConnection()) {
final response = await http.get(url.trim(), headers: {
'Content-Type': 'application/json',

@ -121,7 +121,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
childAspectRatio: MediaQuery.of(context)
.size
.width /
(MediaQuery.of(context).size.height / 2.40),
(MediaQuery.of(context).size.height / 2.20),
),
itemCount: myMedicalList.length,
itemBuilder: (BuildContext context, int index) {

@ -0,0 +1,99 @@
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart';
class PrescriptionDeliveryAddressPage extends StatelessWidget {
final Prescriptions prescriptions;
const PrescriptionDeliveryAddressPage({Key key, this.prescriptions})
: super(key: key);
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Delivery Address',
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 15,
),
InkWell(
onTap: () {},
child: Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
height: 50,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(7),
color: Colors.white,
shape: BoxShape.rectangle,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
child: Texts(
'Selected Address',
variant: 'bodyText',
),
margin: EdgeInsets.only(left: 10, right: 10),
),
Icon(
Icons.arrow_drop_down,
size: 22,
color: Colors.grey,
)
],
),
),
),
SizedBox(
height: 15,
),
Container(
child: Image.asset(projectViewModel.isArabic
? 'assets/images/pharmacy/shipping_image_ar.png'
: 'assets/images/pharmacy/shipping_image.png',height: 300,),
)
],
),
),
bottomSheet: Container(
width: double.infinity,
height: MediaQuery.of(context).size.height * 0.25,
color: Colors.grey[100],
child: Column(
children: <Widget>[
Divider(),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
label: 'Add New Address'.toUpperCase(),
onTap: () {},
),
),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
label: 'Continue'.toUpperCase(),
backgroundColor: Colors.green[200],
onTap: () {},
))
],
),
));
}
}

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -14,12 +15,13 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../widgets/dialogs/confirm_send_email_dialog.dart';
import 'PrescriptionIDeliveryAddressPage.dart';
class PrescriptionItemsPage extends StatelessWidget {
final Prescriptions prescriptions;
PrescriptionItemsPage({Key key, this.prescriptions});
//TODO
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
@ -181,7 +183,7 @@ class PrescriptionItemsPage extends StatelessWidget {
),
bottomSheet: Container(
width: double.infinity,
height: MediaQuery.of(context).size.height * 0.14,
height: MediaQuery.of(context).size.height * 0.25,
color: Colors.grey[100],
child: Column(
children: <Widget>[
@ -197,12 +199,22 @@ class PrescriptionItemsPage extends StatelessWidget {
loading: model.state == ViewState.BusyLocal,
),
),
if (false)
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
child: SecondaryButton(
label: TranslationBase.of(context).resendOrder,
backgroundColor: Colors.green[200],
color: Colors.green[200],
onTap: (){
var asd="";
Navigator.push(
context,
FadePage(
page: PrescriptionDeliveryAddressPage(
prescriptions: prescriptions,
),
),
);
},
))
],
),

@ -206,33 +206,30 @@ class Utils {
);
},
child: isLogin
? Container(
height: 120,
child: Stack(children: [
MedicalProfileItem(
title: TranslationBase.of(context).myAppointments,
imagePath: 'my_appointment_icon.png',
subTitle: TranslationBase.of(context).myAppointmentsList,
hasBadge: true,
),
Positioned(
right: 0.0,
child: Badge(
toAnimate: false,
position: BadgePosition.topEnd(),
shape: BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8),
badgeContent: Container(
padding: EdgeInsets.all(2.0),
child: Text(count.toString(),
style:
TextStyle(color: Colors.white, fontSize: 16.0)),
),
? Stack(children: [
MedicalProfileItem(
title: TranslationBase.of(context).myAppointments,
imagePath: 'my_appointment_icon.png',
subTitle: TranslationBase.of(context).myAppointmentsList,
hasBadge: true,
),
Positioned(
right: 0.0,
child: Badge(
toAnimate: false,
position: BadgePosition.topEnd(),
shape: BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8),
badgeContent: Container(
padding: EdgeInsets.all(2.0),
child: Text(count.toString(),
style:
TextStyle(color: Colors.white, fontSize: 16.0)),
),
),
]),
)
),
])
: MedicalProfileItem(
title: TranslationBase.of(context).myAppointments,
imagePath: 'my_appointment_icon.png',

@ -22,31 +22,32 @@ class MedicalProfileItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return RoundedContainer(
showBorder: true,
borderWidth: 0,
margin: 4,
child: Container(
padding: EdgeInsets.all(10),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(title,
fontSize: 1.5 * SizeConfig.textMultiplier,
color: secondaryColor,
fontWeight: FontWeight.bold),
Texts(subTitle,fontSize: 1.4 * SizeConfig.textMultiplier,),
Align(
alignment:projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight,
child: Image.asset(
"assets/images/medical/$imagePath",
height: SizeConfig.heightMultiplier * 5,
width: SizeConfig.heightMultiplier * 5,
),
)
],
),
return Container(
height: 180,
margin: EdgeInsets.all(5),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white
),
padding: EdgeInsets.all(10),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(title,
fontSize: 1.5 * SizeConfig.textMultiplier,
color: secondaryColor,
fontWeight: FontWeight.bold),
Texts(subTitle,fontSize: 1.4 * SizeConfig.textMultiplier,),
Align(
alignment:projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight,
child: Image.asset(
"assets/images/medical/$imagePath",
height: SizeConfig.heightMultiplier * 5,
width: SizeConfig.heightMultiplier * 5,
),
)
],
),
);
}

@ -49,6 +49,7 @@ dependencies:
shared_preferences: ^0.5.8
flutter_flexible_toast: ^0.1.4
firebase_messaging: ^7.0.3
cloud_firestore: ^0.14.3
android_intent: ^0.3.7+7
# Progress bar
progress_hud_v2: ^2.0.0

Loading…
Cancel
Save