Merge branch 'fatima_v2' into 'development_v2.5'

Fatima v2

See merge request Cloud_Solution/diplomatic-quarter!580
merge-update-with-lab-changes
haroon amjad 4 years ago
commit eb6b0aefc0

@ -642,6 +642,7 @@ const Map localizedValues = {
"years-old": {"en": "years old", "ar": "سنة"}, "years-old": {"en": "years old", "ar": "سنة"},
"drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"}, "drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"},
"refine": {"en": "Refine", "ar": "تصفية"}, "refine": {"en": "Refine", "ar": "تصفية"},
"subGroup": {"en": "Subgroup", "ar": "مجموعة فرعيه"},
"max": {"en": "Max", "ar": "اعلى"}, "max": {"en": "Max", "ar": "اعلى"},
"compeleteOrderMsg": {"en": "Order has been placed successfully!!", "ar": "تم اتمام الطلب بنجاح"}, "compeleteOrderMsg": {"en": "Order has been placed successfully!!", "ar": "تم اتمام الطلب بنجاح"},
"addToCompareMsg": {"en": "You have added a product to the Compare list", "ar": "تمت الاضافه لقائمة المقارنه"}, "addToCompareMsg": {"en": "You have added a product to the Compare list", "ar": "تمت الاضافه لقائمة المقارنه"},

@ -202,7 +202,7 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
? MediaQuery.of(context) ? MediaQuery.of(context)
.size .size
.width / .width /
5 3
: 0, : 0,
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
decoration: BoxDecoration( decoration: BoxDecoration(

@ -22,6 +22,7 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart' as utils ;
import 'base/base_view.dart'; import 'base/base_view.dart';
import 'final_products_page.dart'; import 'final_products_page.dart';
@ -416,7 +417,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
title: Texts( title: Texts(
TranslationBase.of( TranslationBase.of(
context) context)
.categorise), .subGroup),
children: [ children: [
ProcedureListWidget( ProcedureListWidget(
model: model, model: model,
@ -837,7 +838,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
context) context)
.size .size
.width / .width /
5 3
: 0, : 0,
padding: padding:
EdgeInsets.all(4), EdgeInsets.all(4),
@ -993,273 +994,425 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
itemCount: model.subProducts.length, itemCount: model.subProducts.length,
itemBuilder: itemBuilder:
(BuildContext context, int index) { (BuildContext context, int index) {
return InkWell( return InkWell(
child: Card( child: Card(
child: Row( child: Row(
children: [
Stack(
children: [ children: [
Column( Stack(
children: [ children: [
Container( Column(
decoration: children: [
BoxDecoration(), Container(
child: Padding( decoration: BoxDecoration(),
padding: child: Padding(
EdgeInsets padding: EdgeInsets.only(
.only( left: 9.0,
left: 9.0, top: 8.0,
top: 8.0, right: 10.0,
right: 10.0, ),
),
), ),
), Container(
), margin: EdgeInsets.fromLTRB(0, 0, 0, 8),
Container( alignment: Alignment.center,
margin: EdgeInsets child:(model.subProducts[index].images != null &&
.fromLTRB( model.subProducts[index].images.length > 0)
0, 0, 0, 0), ? Image.network(
alignment: Alignment model.subProducts[index].images[0].src,
.center, fit: BoxFit.cover,
child: model height: 80,
.subProducts[ width: 80,
index]
.images )
.isNotEmpty : Image.asset(
? Image.network( "assets/images/no_image.png",
model fit: BoxFit.cover,
.subProducts[ height: 80,
index] width: 80,
.images[ ),
0] ),
.thumb, ],
fit: BoxFit
.contain,
height: 70,
)
: Text(TranslationBase.of(
context)
.noImage),
), ),
], Column(
), children: [
Column( Container(
children: [ width: model.subProducts[index].rxMessage != null ? MediaQuery.of(context).size.width / 3.70 : 0,
Container( padding: EdgeInsets.all(4),
width: model decoration: BoxDecoration(
.subProducts[ color: Color(0xffb23838),
index] //borderRadius: BorderRadius.only(topLeft: Radius.circular(5)),
.rxMessage != ),
null child:model.subProducts[index].rxMessage != null
? MediaQuery.of( ? Texts(
context) projectProvider.isArabic ? model.subProducts[index].rxMessagen : model.subProducts[index].rxMessage,
.size color: Colors.white,
.width / regular: true,
5.3 fontSize: 8,
: 0, fontWeight: FontWeight.w600,
padding: )
EdgeInsets.all( : Texts(""),
4), ),
decoration: ],
BoxDecoration(
color: Color(
0xffb23838),
borderRadius: BorderRadius.only(
topLeft: Radius
.circular(
6)),
),
child: model
.subProducts[
index]
.rxMessage !=
null
? Texts(
projectProvider
.isArabic
? model
.subProducts[
index]
.rxMessagen
: model
.subProducts[index]
.rxMessage,
color: Colors
.white,
regular:
true,
fontSize:
10,
fontWeight:
FontWeight
.w400,
)
: Texts(""),
// Texts(
// model.subProducts[index].rxMessage != null ? model.subProducts[index].rxMessage : "",
// color: Colors.white,
// regular: true,
// fontSize: 10,
// fontWeight: FontWeight.w400,
// ),
), ),
], ],
), ),
], Container(
), height: 100.0,
Container( margin: EdgeInsets.symmetric(
height: 130.0, horizontal: 6,
margin: vertical: 0,
EdgeInsets.symmetric(
horizontal: 0,
vertical: 0,
),
child: Column(
mainAxisAlignment:
MainAxisAlignment
.spaceAround,
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
SizedBox(
height: 4.0,
),
Container(
width: MediaQuery.of(
context)
.size
.width *
0.65,
child: Texts(
projectViewModel
.isArabic
? model
.subProducts[
index]
.namen
: model
.subProducts[
index]
.name,
// model.subProducts[index].name,
regular: true,
fontSize: 13.2,
fontWeight:
FontWeight.w500,
maxLines: 5,
),
),
SizedBox(
height: 8.0,
),
Padding(
padding:
const EdgeInsets
.only(
top: 4,
bottom: 4),
child: Texts(
"SAR ${model.subProducts[index].price}",
bold: true,
fontSize: 14,
),
), ),
Row( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// StarRating( SizedBox(
// totalAverage: model.subProducts[index].approvedRatingSum > 0 height: 4.0,
// ? (model.subProducts[index].approvedRatingSum.toDouble() / model.subProducts[index].approvedRatingSum.toDouble()).toDouble() ),
// : 0, Container(
// forceStars: true), width: MediaQuery.of(context).size.width * 0.55,
RatingBar.readOnly( child: Texts(projectViewModel.isArabic ? model.subProducts[index].namen : model.subProducts[index].name,
initialRating: model regular: true,
.subProducts[ fontSize: 13.2,
index] fontWeight: FontWeight.w500,
.approvedRatingSum maxLines: 5,
.toDouble(), ),
size: 15.0, ),
filledColor: SizedBox(
Colors.yellow[ height: 8.0,
700], ),
emptyColor: Colors Padding(
.grey[500], padding: const EdgeInsets.only(top: 4, bottom: 4),
isHalfAllowed: child: Texts(
true, "SAR ${model.subProducts[index].price}",
halfFilledIcon: bold: true,
Icons fontSize: 14,
.star_half, ),
filledIcon: ),
Icons.star, Row(
emptyIcon: children: [
Icons.star, RatingBar.readOnly(
initialRating: model.subProducts[index].approvedRatingSum.toDouble(),
size: 15.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
Texts(
"(${model.subProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
)
],
), ),
Texts(
"(${model.subProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight
.w400,
)
], ],
), ),
], ),
), widget.authenticatedUserObject.isLogin
? Container(
child: IconButton(
icon: Icon(
Icons.shopping_cart,
size: 18,
color: CustomColors.green,
),
onPressed: () async {
if (model.subProducts[index].isRx == false) {
GifLoaderDialogUtils.showMyDialog(context);
await addToCartFunction(1, model.subProducts[index].id);
GifLoaderDialogUtils.hideDialog(context);
utils.Utils.navigateToCartPage();
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription);
}
//
}),
)
: Container(),
],
), ),
widget.authenticatedUserObject ),
.isLogin onTap: () => {
? Container( Navigator.push(
child: IconButton( context,
icon: Icon( FadePage(
Icons page: ProductDetailPage(model.subProducts[index]),
.shopping_cart, )),
size: 18, },
color: );
CustomColors // return InkWell(
.green, // child: Card(
), // child: Row(
onPressed: // children: [
() async { // Stack(
if (model // children: [
.subProducts[ // Column(
index] // children: [
.isRx == false) { // Container(
GifLoaderDialogUtils // decoration:
.showMyDialog( // BoxDecoration(),
context); // child: Padding(
await addToCartFunction( // padding:
1, // EdgeInsets
model // .only(
.subProducts[ // left: 9.0,
index] // top: 8.0,
.id); // right: 10.0,
GifLoaderDialogUtils // ),
.hideDialog( // ),
context); // ),
Utils // Container(
.navigateToCartPage(); // margin: EdgeInsets
} else { // .fromLTRB(
AppToast.showErrorToast( // 0, 0, 0, 0),
message: TranslationBase.of( // alignment: Alignment
context) // .center,
.needPrescription); // child: model
} // .subProducts[
}), // index]
) // .images
: Container(), // .isNotEmpty
], // ? Image.network(
), // model
), // .subProducts[
onTap: () => { // index]
Navigator.push( // .images[
context, // 0]
FadePage( // .thumb,
page: ProductDetailPage( // fit: BoxFit
model.subProducts[ // .contain,
index]), // height: 70,
)), // )
}, // : Text(TranslationBase.of(
); // context)
// .noImage),
// ),
// ],
// ),
// Column(
// children: [
// Container(
// width: model
// .subProducts[
// index]
// .rxMessage !=
// null
// ? MediaQuery.of(
// context)
// .size
// .width /
// 3.70
// : 0,
// padding:
// EdgeInsets.all(
// 4),
// decoration:
// BoxDecoration(
// color: Color(
// 0xffb23838),
// // borderRadius: BorderRadius.only(
// // topLeft: Radius
// // .circular(
// // 6)),
// ),
// child: model
// .subProducts[
// index]
// .rxMessage !=
// null
// ? Texts(
// projectProvider
// .isArabic
// ? model
// .subProducts[
// index]
// .rxMessagen
// : model
// .subProducts[index]
// .rxMessage,
// color: Colors
// .white,
// regular:
// true,
// fontSize:
// 10,
// fontWeight:
// FontWeight
// .w400,
// )
// : Texts(""),
// // Texts(
// // model.subProducts[index].rxMessage != null ? model.subProducts[index].rxMessage : "",
// // color: Colors.white,
// // regular: true,
// // fontSize: 10,
// // fontWeight: FontWeight.w400,
// // ),
// ),
// ],
// ),
// ],
// ),
// Container(
// height: 130.0,
// margin:
// EdgeInsets.symmetric(
// horizontal: 0,
// vertical: 0,
// ),
// child: Column(
// mainAxisAlignment:
// MainAxisAlignment
// .spaceAround,
// crossAxisAlignment:
// CrossAxisAlignment
// .start,
// children: [
// SizedBox(
// height: 4.0,
// ),
// Container(
// width: MediaQuery.of(
// context)
// .size
// .width *
// 0.65,
// child: Texts(
// projectViewModel
// .isArabic
// ? model
// .subProducts[
// index]
// .namen
// : model
// .subProducts[
// index]
// .name,
// // model.subProducts[index].name,
// regular: true,
// fontSize: 13.2,
// fontWeight:
// FontWeight.w500,
// maxLines: 5,
// ),
// ),
// SizedBox(
// height: 8.0,
// ),
// Padding(
// padding:
// const EdgeInsets
// .only(
// top: 4,
// bottom: 4),
// child: Texts(
// "SAR ${model.subProducts[index].price}",
// bold: true,
// fontSize: 14,
// ),
// ),
// Row(
// children: [
// // StarRating(
// // totalAverage: model.subProducts[index].approvedRatingSum > 0
// // ? (model.subProducts[index].approvedRatingSum.toDouble() / model.subProducts[index].approvedRatingSum.toDouble()).toDouble()
// // : 0,
// // forceStars: true),
// RatingBar.readOnly(
// initialRating: model
// .subProducts[
// index]
// .approvedRatingSum
// .toDouble(),
// size: 15.0,
// filledColor:
// Colors.yellow[
// 700],
// emptyColor: Colors
// .grey[500],
// isHalfAllowed:
// true,
// halfFilledIcon:
// Icons
// .star_half,
// filledIcon:
// Icons.star,
// emptyIcon:
// Icons.star,
// ),
// Texts(
// "(${model.subProducts[index].approvedTotalReviews})",
// regular: true,
// fontSize: 10,
// fontWeight:
// FontWeight
// .w400,
// )
// ],
// ),
// ],
// ),
// ),
// widget.authenticatedUserObject
// .isLogin
// ? Container(
// child: IconButton(
// icon: Icon(
// Icons
// .shopping_cart,
// size: 18,
// color:
// CustomColors
// .green,
// ),
// onPressed:
// () async {
// if (model
// .subProducts[
// index]
// .isRx == false) {
// GifLoaderDialogUtils
// .showMyDialog(
// context);
// await addToCartFunction(
// 1,
// model
// .subProducts[
// index]
// .id);
// GifLoaderDialogUtils
// .hideDialog(
// context);
// Utils
// .navigateToCartPage();
// } else {
// AppToast.showErrorToast(
// message: TranslationBase.of(
// context)
// .needPrescription);
// }
// }),
// )
// : Container(),
// ],
// ),
// ),
// onTap: () => {
// Navigator.push(
// context,
// FadePage(
// page: ProductDetailPage(
// model.subProducts[
// index]),
// )),
// },
// );
}), }),
) )
: Padding( : Padding(

@ -1225,6 +1225,8 @@ class TranslationBase {
String get refine => localizedValues['refine'][locale.languageCode]; String get refine => localizedValues['refine'][locale.languageCode];
String get subGroup => localizedValues['subGroup'][locale.languageCode];
String get max => localizedValues['max'][locale.languageCode]; String get max => localizedValues['max'][locale.languageCode];
String get min => localizedValues['min'][locale.languageCode]; String get min => localizedValues['min'][locale.languageCode];

Loading…
Cancel
Save