Merge branch 'fatima-new' into 'development'

Fatima new

See merge request Cloud_Solution/diplomatic-quarter!379
merge-update-with-lab-changes
Mohammad Aljammal 5 years ago
commit 55f9bbcba4

@ -791,6 +791,7 @@ const Map localizedValues = {
"itemsNo": {"en": "items(s)", "ar": "عناصر"}, "itemsNo": {"en": "items(s)", "ar": "عناصر"},
"noOrder": {"en": "You Don't have any orders.", "ar": "ليس لديك طلبات"}, "noOrder": {"en": "You Don't have any orders.", "ar": "ليس لديك طلبات"},
"noResult": {"en": "No Result.", "ar": "لايوجد نتئج"}, "noResult": {"en": "No Result.", "ar": "لايوجد نتئج"},
"nonRecommended": {"en": "No Recommended Products.", "ar": "لا يوجد منتجات"},
"TermsService": {"en": "Terms of Service", "ar": "شروط الخدمه"}, "TermsService": {"en": "Terms of Service", "ar": "شروط الخدمه"},
"Beforeusing": { "Beforeusing": {

@ -18,7 +18,7 @@ class RecommendedProductModel {
int notApprovedRatingSum; int notApprovedRatingSum;
int approvedTotalReviews; int approvedTotalReviews;
int notApprovedTotalReviews; int notApprovedTotalReviews;
String sku; dynamic sku;
bool isRx; bool isRx;
bool prescriptionRequired; bool prescriptionRequired;
// dynamic rxMessage; // dynamic rxMessage;

@ -665,7 +665,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
itemCount: model.recommendedProductList.length, itemCount: model.recommendedProductList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return InkWell( return InkWell(
onTap: () { onTap: ()
{
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -911,7 +912,15 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
}), }),
) )
: Container( : Container(
child: Text("There is no product"), // color: Colors.white,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
Texts(TranslationBase.of(context).nonRecommended,
color: Colors.black,),
],
),
), ),
)), )),
), ),

@ -22,12 +22,16 @@ class CartOrderPage extends StatelessWidget {
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
final height = mediaQuery.size.height - 60 - mediaQuery.padding.top; final height = mediaQuery.size.height - 60 - mediaQuery.padding.top;
AppScaffold appScaffold;
return BaseView<OrderPreviewViewModel>( return BaseView<OrderPreviewViewModel>(
onModelReady: (model) => model.getOrderPreviewData(), onModelReady: (model){
model.getShoppingCart().then((value){
appScaffold.appBar.badgeUpdater('${model.cartResponse.itemCount ?? 0}');
});
},
builder: (_, model, wi) => ChangeNotifierProvider.value( builder: (_, model, wi) => ChangeNotifierProvider.value(
value: model.cartResponse, value: model.cartResponse,
child: AppScaffold( child: appScaffold = AppScaffold(
appBarTitle: TranslationBase.of(context).shoppingCart, appBarTitle: TranslationBase.of(context).shoppingCart,
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,

@ -869,6 +869,8 @@ class TranslationBase {
localizedValues['beneficiaryName'][locale.languageCode]; localizedValues['beneficiaryName'][locale.languageCode];
String get accountActivation => String get accountActivation =>
localizedValues['accountActivation'][locale.languageCode]; localizedValues['accountActivation'][locale.languageCode];
String get nonRecommended =>
localizedValues['nonRecommended'][locale.languageCode];
String get lakumTransfer => String get lakumTransfer =>
localizedValues['lakumTransfer'][locale.languageCode]; localizedValues['lakumTransfer'][locale.languageCode];

@ -176,8 +176,8 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget {
Size get preferredSize => Size(double.maxFinite, 60); Size get preferredSize => Size(double.maxFinite, 60);
} }
String _badgeText = "0";
class AppBarWidgetState extends State<AppBarWidget> { class AppBarWidgetState extends State<AppBarWidget> {
String badgeText = "0";
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
widget.badgeUpdater = badgeUpdateBlock; widget.badgeUpdater = badgeUpdateBlock;
@ -186,7 +186,7 @@ class AppBarWidgetState extends State<AppBarWidget> {
badgeUpdateBlock(String value) { badgeUpdateBlock(String value) {
setState(() { setState(() {
badgeText = value; _badgeText = value;
}); });
} }
@ -220,7 +220,8 @@ class AppBarWidgetState extends State<AppBarWidget> {
(widget.isPharmacy && widget.showPharmacyCart) (widget.isPharmacy && widget.showPharmacyCart)
? IconButton( ? IconButton(
icon: Badge( icon: Badge(
badgeContent: Text(badgeText), shape: BadgeShape.circle,
badgeContent: Text(_badgeText, style: TextStyle(color: Colors.white)),
child: Icon(Icons.shopping_cart)), child: Icon(Icons.shopping_cart)),
color: Colors.white, color: Colors.white,
onPressed: () { onPressed: () {
@ -232,7 +233,7 @@ class AppBarWidgetState extends State<AppBarWidget> {
icon: Badge( icon: Badge(
position: BadgePosition.topStart(top: -15, start: -10), position: BadgePosition.topStart(top: -15, start: -10),
badgeContent: Text( badgeContent: Text(
badgeText, _badgeText,
style: TextStyle( style: TextStyle(
fontSize: 9, fontSize: 9,
color: Colors.white, color: Colors.white,

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
class productTile extends StatelessWidget { class productTile extends StatelessWidget {
final String productName; final String productName;
@ -135,8 +136,10 @@ class productTile extends StatelessWidget {
children: [ children: [
IconButton( IconButton(
icon: Icon(FontAwesomeIcons.trashAlt, size: 15), icon: Icon(FontAwesomeIcons.trashAlt, size: 15),
onPressed: () { onPressed: (){
deleteFromWishlistFunction(productID); GifLoaderDialogUtils.showMyDialog(context);
deleteFromWishlistFunction(productID);
GifLoaderDialogUtils.hideDialog(context);
}, },
), ),
SizedBox( SizedBox(
@ -145,11 +148,14 @@ class productTile extends StatelessWidget {
IconButton( IconButton(
icon: Icon(FontAwesomeIcons.shoppingCart, size: 15), icon: Icon(FontAwesomeIcons.shoppingCart, size: 15),
onPressed: () async { onPressed: () async {
GifLoaderDialogUtils.showMyDialog(context);
await addToCartFunction(1, productID); await addToCartFunction(1, productID);
GifLoaderDialogUtils.hideDialog(context);
Navigator.push( Navigator.push(
context, context,
FadePage(page: CartOrderPage()), FadePage(page: CartOrderPage()),
); );
}, },
), ),
], ],

Loading…
Cancel
Save