Merge branch 'fatima-new' into 'development'

Fatima new

See merge request Cloud_Solution/diplomatic-quarter!349
merge-requests/353/merge
Sultan khan 3 years ago
commit 8eb67791ca

@ -22,6 +22,8 @@ int price = 0;
var languageID;
bool isOverQuantity = false;
bool isInWishlit = false;
//int isSelected = 1;
bool isSelected= true;
String itemID;
var customerId;
CompareList compareItems = new CompareList();
@ -642,14 +644,12 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
padding: EdgeInsets.only(bottom: 5),
// margin: EdgeInsets.symmetric(horizontal: 6, vertical: 4),
child: BaseView<PharmacyModuleViewModel>(
onModelReady: (model) =>
model.getRecommendedProducts(
widget.product.id.toString()),
onModelReady: (model) => model.getRecommendedProducts(widget.product.id.toString()),
builder: (_, model, wi) => Container(
child:
// Text(model.recommendedProductList[0].id),
model.recommendedProductList.length !=
null
model.recommendedProductList.length != null
? Expanded(
child: ListView.builder(
scrollDirection:
@ -657,11 +657,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
shrinkWrap: true,
physics: ScrollPhysics(),
// physics: NeverScrollableScrollPhysics(),
itemCount: model
.recommendedProductList
.length,
itemBuilder:
(context, index) {
itemCount: model.recommendedProductList.length,
itemBuilder: (context, index) {
return InkWell(
onTap: () {
Navigator.push(
@ -674,42 +671,22 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
elevation: 2,
shape: RoundedRectangleBorder(
side: BorderSide(
color: Colors
.grey[
300],
color: Colors.grey[300],
width: 2),
borderRadius:
BorderRadius
.circular(
10)),
margin: EdgeInsets
.symmetric(
borderRadius: BorderRadius.circular(10)),
margin: EdgeInsets.symmetric(
horizontal: 8,
vertical: 0,
),
child: Container(
decoration:
BoxDecoration(
borderRadius:
BorderRadius
.all(
Radius.circular(
15),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(15),
),
),
padding: EdgeInsets
.symmetric(
horizontal:
4),
width: MediaQuery.of(
context)
.size
.width /
3,
padding: EdgeInsets.symmetric(horizontal: 4),
width: MediaQuery.of(context).size.width / 3,
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
children: [
@ -717,11 +694,10 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
child: Align(
alignment: Alignment.topRight,
child: IconButton(
icon: Icon(!isInWishlit
? Icons.favorite_border
: Icons.favorite),
icon: Icon(!isInWishlit ? Icons.favorite_border : Icons.favorite),
color: !isInWishlit ? Colors.grey : Colors.red,
onPressed: () async {
if (customerId != null) {
if (!isInWishlit) {
await addToWishlistFunction(model.recommendedProductList[index].id);
@ -734,29 +710,36 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
setState(() {});
},
)),
// itemID.contains(model.recommendedProductList[index].id)
// child: Align(
// alignment: Alignment.topRight,
// child:itemID.contains(model.recommendedProductList[index].id)
// // !isInWishlist
// ? IconButton(
// icon: Icon(Icons.favorite_border),
// color: Colors.red,
// color: Colors.grey,
// iconSize: 30,
// onPressed: () {
// setState(() {
// deleteFromWishlistFunction(itemID);
// });
// if (customerId != null && isInWishlit ) {
// deleteFromWishlistFunction(
// model.recommendedProductList[index].id);
// } });
// },
// )
// : IconButton(
// icon: Icon(Icons.favorite),
// color: Colors.grey,
// color: Colors.red,
// iconSize: 30,
// onPressed: () {
// setState(() {
// addToWishlistFunction(itemID);
// });
// if (customerId != null && !isInWishlit ) {
// addToWishlistFunction(
// model.recommendedProductList[index].id);
// } });
// },
// )
//
// ),
),
Container(

@ -231,37 +231,21 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
Stack(children: [
Container(
child: Align(
alignment:
Alignment
.topRight,
child:
itemID.contains(e.id)
alignment: Alignment.topRight,
child: itemID.contains(e.id)
// !isInWishlist
? IconButton(
icon:
Icon(Icons.favorite_border),
color:
Colors.grey,
iconSize:
30,
? IconButton(icon: Icon(Icons.favorite_border),
color: Colors.grey, iconSize: 30,
onPressed:
() {
setState(() {
addToWishlistFunction(itemID);
setState(() {addToWishlistFunction(itemID);
});
},
)
:
IconButton(
icon:
Icon(Icons.favorite),
color:
Colors.red,
iconSize:
30,
: IconButton(icon: Icon(Icons.favorite),
color: Colors.red, iconSize: 30,
onPressed:
() {
setState(() {
() {setState(() {
deleteFromWishlistFunction(itemID);
});
},
@ -269,149 +253,74 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
//
),
),
Container(
margin: EdgeInsets
.fromLTRB(0, 16,
10, 16),
alignment:
Alignment.center,
Container(margin: EdgeInsets.fromLTRB(0, 16, 10, 16),
alignment: Alignment.center,
// padding: EdgeInsets.only(left: 25, bottom: 20),
child: (e.images !=
null &&
e.images.length >
0)
? Image.network(
e.images[0]
.src
.toString(),
child: (e.images != null && e.images.length > 0)
? Image.network(e.images[0].src.toString(),
// item.images[0].src,
fit: BoxFit
.cover,
height: 60,
)
: Image.asset(
"assets/images/no_image.png",
fit: BoxFit
.cover,
height: 60,
fit: BoxFit.cover, height: 60,)
: Image.asset("assets/images/no_image.png", fit: BoxFit.cover, height: 60,
),
),
Container(
width: e.rxMessage !=
null
? MediaQuery.of(
context)
.size
.width /
5
: 0,
padding:
EdgeInsets.all(4),
decoration:
BoxDecoration(
color: Color(
0xffb23838),
borderRadius:
BorderRadius.only(
topLeft: Radius
.circular(
6)),
Container(width: e.rxMessage != null ? MediaQuery.of(context)
.size.width / 5 : 0,
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius: BorderRadius.only(topLeft: Radius.circular(6)),
),
child: Texts(
e.rxMessage != null
? e.rxMessage
: "",
child: Texts(e.rxMessage != null ? e.rxMessage : "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight:
FontWeight.w400,
fontWeight: FontWeight.w400,
),
),
]),
Container(
margin: EdgeInsets
.symmetric(
horizontal: 6,
vertical: 0,
.symmetric(horizontal: 6, vertical: 0,
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
languageID == "ar"
? e.namen
: e.name,
languageID == "ar" ? e.namen : e.name,
style: TextStyle(
color: Colors
.black,
fontSize: 13.0,
color: Colors.black, fontSize: 13.0,
// fontWeight: FontWeight.bold,
),
),
Padding(
// padding: const EdgeInsets.only(top: 15, bottom: 10),
padding:
const EdgeInsets
.only(
top: 10,
bottom:
5),
child: Texts(
"SAR ${e.price}",
bold: true,
fontSize: 14,
padding: const EdgeInsets.only(top: 10, bottom: 5),
child: Texts("SAR ${e.price}",
bold: true, fontSize: 14,
),
),
],
),
),
Row(
crossAxisAlignment:
CrossAxisAlignment
.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
padding: EdgeInsets
.only(
right:
10),
padding: EdgeInsets.only(right: 10),
// margin: EdgeInsets.only(left: 5),
child: Align(
alignment:
Alignment
.topLeft,
child: RatingBar
.readOnly(
initialRating: e
.approvedRatingSum
.toDouble(),
child: Align(alignment: Alignment.topLeft,
child: RatingBar.readOnly(initialRating: e.approvedRatingSum.toDouble(),
// initialRating: productRate,
size: 13.0,
filledColor:
Colors.yellow[
700],
emptyColor:
Colors.grey[
500],
isHalfAllowed:
true,
halfFilledIcon:
Icons
.star_half,
filledIcon:
Icons
.star,
emptyIcon:
Icons
.star,
size: 13.0, filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
),
),
Texts(
"(${e.approvedTotalReviews.toString()})",
Texts("(${e.approvedTotalReviews.toString()})",
// bold: true,
fontSize: 12,
),
@ -664,8 +573,7 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
return Card(
elevation: 2,
shape: RoundedRectangleBorder(
side:
BorderSide(color: Colors.grey[300], width: 2),
side: BorderSide(color: Colors.grey[300], width: 2),
borderRadius: BorderRadius.circular(10)),
//
margin: EdgeInsets.symmetric(
@ -692,14 +600,12 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
//wishlistVar[index].id.contains(model.recommendedProductList[index].id)
!isInWishlist
? IconButton(
icon: Icon(
Icons.favorite_border),
icon: Icon(Icons.favorite_border),
color: Colors.grey,
iconSize: 30,
onPressed: () {
setState(() {
addToWishlistFunction(
itemID);
addToWishlistFunction(itemID);
});
},
)
@ -709,8 +615,7 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
iconSize: 30,
onPressed: () {
setState(() {
deleteFromWishlistFunction(
itemID);
deleteFromWishlistFunction(itemID);
});
},
)
@ -721,30 +626,20 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
margin: EdgeInsets.fromLTRB(0, 16, 10, 16),
alignment: Alignment.center,
// padding: EdgeInsets.only(left: 25, bottom: 20),
child: (model.recommendedProductList[index]
.images !=
null &&
model.recommendedProductList[index]
.images.length >
0)
? Image.network(
model.recommendedProductList[index]
.images[0].src
.toString(),
child: (model.recommendedProductList[index].images != null &&
model.recommendedProductList[index].images.length > 0)
? Image.network(model.recommendedProductList[index].images[0].src.toString(),
// item.images[0].src,
fit: BoxFit.cover,
height: 60,
)
: Image.asset(
"assets/images/no_image.png",
: Image.asset("assets/images/no_image.png",
fit: BoxFit.cover,
height: 60,
),
),
Container(
width: model.recommendedProductList[index]
.rxMessage !=
null
width: model.recommendedProductList[index].rxMessage != null
? MediaQuery.of(context).size.width / 5
: 0,
padding: EdgeInsets.all(4),
@ -754,11 +649,8 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
topLeft: Radius.circular(6)),
),
child: Texts(
model.recommendedProductList[index]
.rxMessage !=
null
? model.recommendedProductList[index]
.rxMessage
model.recommendedProductList[index].rxMessage != null
? model.recommendedProductList[index].rxMessage
: "",
color: Colors.white,
regular: true,
@ -773,12 +665,9 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
vertical: 2,
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
model
.recommendedProductList[index].name,
Text(model.recommendedProductList[index].name,
style: TextStyle(
color: Colors.black,
fontSize: 13.0,
@ -799,8 +688,7 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
),
),
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
padding: EdgeInsets.only(
@ -809,10 +697,7 @@ class _RecommendedProductPageState extends State<RecommendedProductPage>
child: Align(
alignment: Alignment.topLeft,
child: RatingBar.readOnly(
initialRating: model
.recommendedProductList[index]
.approvedRatingSum
.toDouble(),
initialRating: model.recommendedProductList[index].approvedRatingSum.toDouble(),
// initialRating: productRate,
size: 13.0,
filledColor: Colors.yellow[700],

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/mobile_number.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:provider/provider.dart';
import '../../Constants.dart';
@ -127,7 +128,9 @@ class _MobileNo extends State<MobileNo> {
controller: widget.controller,
keyboardType: TextInputType.number,
maxLength: 10,
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.allow(RegExp("[0-9]")),
],
// maxLengthEnforced: true,
// onChanged: (value) {
// widget.controller.text = countryCode;

Loading…
Cancel
Save