Merge branch 'development_new_design_2.0' into Fatima-New-Design

merge-requests/560/head
Fatimah Alshammari 3 years ago
commit a1b4e1c8a3

@ -3,7 +3,7 @@ class PatientLabSpecialResult {
String moduleID;
String resultData;
String resultDataHTML;
Null resultDataTxt;
dynamic resultDataTxt;
PatientLabSpecialResult(
{this.invoiceNo,

@ -90,7 +90,6 @@ class _BookConfirmState extends State<BookConfirm> {
null,
widget.doctor.noOfPatientsRate,
"",
),
isNeedToShowButton: false,
),
@ -201,7 +200,7 @@ class _BookConfirmState extends State<BookConfirm> {
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () async {
if (!await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) {
if (await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) != null && !await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) {
insertAppointment(context, widget.doctor);
} else {
insertLiveCareScheduledAppointment(context, widget.doctor);

@ -77,9 +77,9 @@ class InsuranceApprovalDetail extends StatelessWidget {
MyRichText(TranslationBase.of(context).unusedCount, insuranceApprovalModel?.unUsedCount.toString() ?? "", projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).companyName, insuranceApprovalModel?.companyName ?? "", projectViewModel.isArabic),
SizedBox(height: 6),
MyRichText(TranslationBase.of(context).receiptOn, DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDateTime(insuranceApprovalModel.receiptOn)) ?? "",
MyRichText(TranslationBase.of(context).receiptOn, DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(insuranceApprovalModel.receiptOn)) ?? "",
projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).expiryOn, DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDateTime(insuranceApprovalModel.expiryDate)) ?? "",
MyRichText(TranslationBase.of(context).expiryOn, DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(insuranceApprovalModel.expiryDate)) ?? "",
projectViewModel.isArabic),
],
),

@ -140,7 +140,7 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
MyRichText(TranslationBase.of(context).clinic + ":", model.insuranceApproval[index]?.clinicName.toLowerCase().capitalizeFirstofEach ?? "",
MyRichText(TranslationBase.of(context).clinic + ":", model.insuranceApproval[index]?.clinicName != null ? model.insuranceApproval[index]?.clinicName.toLowerCase().capitalizeFirstofEach : "",
projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).approvalNo, model.insuranceApproval[index]?.approvalNo.toString() ?? "", projectViewModel.isArabic),
],

@ -412,7 +412,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
if (widget.model.isCartItemsOutOfStock())
{AppToast.showErrorToast(message: TranslationBase.of(context).outOfStockMsg)}
else
{_navigateToAddressPage(widget.model.user.patientIdentificationNo)}
{_navigateToAddressPage(projectProvider.user.patientIdentificationNo)}
}
: null,
child: new Text(

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/payment-method-select-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/AddAddress.dart';
@ -15,6 +16,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
///TODO Elham* split this to tow files
class PharmacyAddressesPage extends StatefulWidget {
@ -44,6 +46,7 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context);
final height = mediaQuery.size.height - 60 - mediaQuery.padding.top;
ProjectViewModel projectProvider = Provider.of(context);
return BaseView<PharmacyAddressesViewModel>(
onModelReady: (model) => model.getAddressesList(),
@ -127,7 +130,7 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
GifLoaderDialogUtils.showMyDialog(context);
await widget.orderPreviewViewModel.getInformationsByAddress(widget.orderPreviewViewModel.user.patientIdentificationNo);
await widget.orderPreviewViewModel.getInformationsByAddress(projectProvider.user.patientIdentificationNo);
if (widget.orderPreviewViewModel.error == "") {
await widget.orderPreviewViewModel.getShoppingCart();
GifLoaderDialogUtils.hideDialog(context);

@ -76,38 +76,37 @@ class _MyVaccinesState extends State<MyVaccines> {
bottomSheet: Container(
color: Colors.white,
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: DefaultButton(
TranslationBase.of(context).availability,
() {
// Navigator.push(context, FadePage(page: MyVaccinesItemPage()));
},
color: Color(0xffEAEAEA),
textColor: Color(0xff000000),
),
),
SizedBox(width: 8),
Expanded(
child: DefaultButton(
TranslationBase.of(context).sendEmail,
() {
showDialog(
context: context,
child: ConfirmSendEmailDialog(
email: projectViewModel.user.emailAddress,
onTapSendEmail: () {
model.sendEmail(message: TranslationBase.of(context).emailSentSuccessfully);
},
),
);
},
),
child:
// Row(
// mainAxisSize: MainAxisSize.min,
// children: [
// Expanded(
// child: DefaultButton(
// TranslationBase.of(context).availability,
// () {
// // Navigator.push(context, FadePage(page: MyVaccinesItemPage()));
// },
// color: Color(0xffEAEAEA),
// textColor: Color(0xff000000),
// ),
// ),
// SizedBox(width: 8),
DefaultButton(
TranslationBase.of(context).sendEmail,
() {
showDialog(
context: context,
child: ConfirmSendEmailDialog(
email: projectViewModel.user.emailAddress,
onTapSendEmail: () {
model.sendEmail(message: TranslationBase.of(context).emailSentSuccessfully);
},
),
);
},
),
],
),
// ],
// ),
),
),
);

@ -14,7 +14,6 @@ import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page_pharmcy.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
import 'package:diplomaticquarterapp/pages/search_products_page.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -135,8 +134,7 @@ class AppScaffold extends StatefulWidget {
}
class _AppScaffoldState extends State<AppScaffold> {
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
AppBarWidget appBar;
@override
@ -185,8 +183,7 @@ class _AppScaffoldState extends State<AppScaffold> {
builder: (BuildContext context) {
return InkWell(
onTap: () {
Provider.of<PharmacyPagesViewModel>(context, listen: false)
.changeCurrentTab(0);
Provider.of<PharmacyPagesViewModel>(context, listen: false).changeCurrentTab(0);
},
child: Container(
height: 2.0,
@ -216,12 +213,9 @@ class _AppScaffoldState extends State<AppScaffold> {
AppGlobal.context = context;
PharmacyPagesViewModel pagesViewModel = Provider.of(context);
bool isUserNotLogin =
(!Provider.of<ProjectViewModel>(context, listen: false).isLogin &&
widget.isShowDecPage);
bool isUserNotLogin = (!Provider.of<ProjectViewModel>(context, listen: false).isLogin && widget.isShowDecPage);
return Scaffold(
backgroundColor:
widget.backgroundColor ?? CustomColors.appBackgroudGrey2Color,
backgroundColor: widget.backgroundColor ?? CustomColors.appBackgroudGrey2Color,
// appBar: widget.isShowPharmacyAppbar
// ? pharmacyAppbar()
@ -254,8 +248,7 @@ class _AppScaffoldState extends State<AppScaffold> {
isPharmacy: widget.isPharmacy,
showPharmacyCart: widget.showPharmacyCart,
isOfferPackages: widget.isOfferPackages,
showOfferPackagesCart:
widget.showOfferPackagesCart,
showOfferPackagesCart: widget.showOfferPackagesCart,
isShowDecPage: widget.isShowDecPage,
backButtonTab: widget.backButtonTab,
)
@ -294,10 +287,7 @@ class _AppScaffoldState extends State<AppScaffold> {
widget.changeCurrentTab(value);
} else {
Navigator.pushAndRemoveUntil(
locator<NavigationService>().navigatorKey.currentContext,
MaterialPageRoute(
builder: (context) => LandingPagePharmacy(currentTab: value)),
(Route<dynamic> r) => false);
locator<NavigationService>().navigatorKey.currentContext, MaterialPageRoute(builder: (context) => LandingPagePharmacy(currentTab: value)), (Route<dynamic> r) => false);
}
}
@ -307,9 +297,7 @@ class _AppScaffoldState extends State<AppScaffold> {
try {
String barcode = result;
GifLoaderDialogUtils.showMyDialog(context);
await BaseAppClient()
.getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode",
onSuccess: (dynamic response, int statusCode) {
await BaseAppClient().getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode", onSuccess: (dynamic response, int statusCode) {
print(response);
var product = PharmacyProduct.fromJson(response["products"][0]);
GifLoaderDialogUtils.hideDialog(context);
@ -319,8 +307,7 @@ class _AppScaffoldState extends State<AppScaffold> {
AppToast.showErrorToast(message: "Product not found");
});
} catch (apiEx) {
AppToast.showErrorToast(
message: "Something went wrong, please try again");
AppToast.showErrorToast(message: "Something went wrong, please try again");
}
} catch (barcodeEx) {}
}
@ -330,10 +317,7 @@ class _AppScaffoldState extends State<AppScaffold> {
}
buildBodyWidget(context) {
return Stack(children: <Widget>[
widget.body,
widget.isHelp == true ? RobotIcon() : Container()
]);
return Stack(children: <Widget>[widget.body, widget.isHelp == true ? RobotIcon() : Container()]);
}
}
@ -347,16 +331,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
final List<Widget> appBarIcons;
Function onTap;
NewAppBarWidget(
{Key key,
this.showTitle = false,
this.showDropDown = false,
this.title = "",
this.dropDownList,
this.appBarIcons,
this.dropdownIndexValue,
this.dropDownIndexChange,
this.onTap})
NewAppBarWidget({Key key, this.showTitle = false, this.showDropDown = false, this.title = "", this.dropDownList, this.appBarIcons, this.dropdownIndexValue, this.dropDownIndexChange, this.onTap})
: super(key: key);
@override
@ -381,13 +356,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
title,
maxLines: 1,
style: TextStyle(
fontSize: 24,
fontFamily:
(projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
fontWeight: FontWeight.w700,
color: Color(0xff2B353E),
letterSpacing: -1.44,
height: 35 / 24),
fontSize: 24, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
),
),
if (showDropDown)
@ -399,8 +368,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
alignedDropdown: true,
child: DropdownButton<int>(
iconEnabledColor: CustomColors.grey2,
style: TextStyle(
color: CustomColors.lightGreyColor, fontSize: 12),
style: TextStyle(color: CustomColors.lightGreyColor, fontSize: 12),
dropdownColor: CustomColors.lightGreyColor,
value: dropdownIndexValue,
items: [
@ -411,9 +379,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
dropDownList[i],
style: TextStyle(
fontSize: 12,
fontFamily: (projectViewModel.isArabic
? 'Cairo'
: 'Poppins'),
fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
fontWeight: FontWeight.w600,
color: Color(0xff2B2E31),
letterSpacing: -.48,
@ -455,8 +421,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
}
class AppBarWidget extends StatefulWidget with PreferredSizeWidget {
final AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
final AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
final String appBarTitle;
final bool showHomeAppBarIcon;
@ -509,22 +474,12 @@ class AppBarWidgetState extends State<AppBarWidget> {
return AppBar(
elevation: 0,
backgroundColor: widget.isPharmacy
? Colors.green
: Theme.of(context).appBarTheme.color,
backgroundColor: widget.isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color,
textTheme: TextTheme(
headline6: TextStyle(
color: Theme.of(context).textTheme.headline1.color,
fontWeight: FontWeight.bold),
headline6: TextStyle(color: Theme.of(context).textTheme.headline1.color, fontWeight: FontWeight.bold),
),
title: Text(
widget.authenticatedUserObject.isLogin || !widget.isShowDecPage
? widget.appBarTitle.toUpperCase()
: TranslationBase.of(context).serviceInformationTitle,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Theme.of(context).textTheme.headline1.color,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')),
title: Text(widget.authenticatedUserObject.isLogin || !widget.isShowDecPage ? widget.appBarTitle.toUpperCase() : TranslationBase.of(context).serviceInformationTitle,
style: TextStyle(fontWeight: FontWeight.bold, color: Theme.of(context).textTheme.headline1.color, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')),
leading: Builder(
builder: (BuildContext context) {
return ArrowBack(
@ -538,8 +493,7 @@ class AppBarWidgetState extends State<AppBarWidget> {
? IconButton(
icon: Badge(
badgeContent: Text(
orderPreviewViewModel.cartResponse.quantityCount
.toString(),
orderPreviewViewModel.cartResponse.quantityCount.toString(),
style: TextStyle(color: Colors.white),
),
child: Icon(Icons.shopping_cart)),
@ -554,10 +508,7 @@ class AppBarWidgetState extends State<AppBarWidget> {
position: BadgePosition.topStart(top: -15, start: -10),
badgeContent: Text(
_badgeText,
style: TextStyle(
fontSize: 9,
color: Colors.white,
fontWeight: FontWeight.normal),
style: TextStyle(fontSize: 9, color: Colors.white, fontWeight: FontWeight.normal),
),
child: Icon(Icons.shopping_cart)),
color: Colors.white,
@ -571,10 +522,7 @@ class AppBarWidgetState extends State<AppBarWidget> {
icon: Icon(FontAwesomeIcons.home),
color: Colors.white,
onPressed: () {
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => LandingPage()),
(Route<dynamic> r) => false);
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
// Cart Click Event
if (_onCartClick != null) _onCartClick();

Loading…
Cancel
Save