fix issues

merge-requests/469/head
Fatimah Alshammari 4 years ago
parent 2c30b5a494
commit e6378b7ada

@ -759,6 +759,8 @@ const Map localizedValues = {
"location-permission": {"en": "Location", "ar": "تحديد المواقع"},
"needPrescription": {"en": "This product requires a prescription", "ar": " هذا المنتج يتطلب وصفة طبية"},
"outOfStockMsg": {"en": "You have added product which is out of stock now, Please remove that!", "ar": "لقد قمت بإضافة المنتج الذي نفذ من المخزون الآن. يرجى إزالة ذلك"},
"noArabicLetters": {"en": "It Is Not Allow to Use Arabic Letters", "ar": "غير مسموح باستخدام الحروف العربيه"},
"noOffersAvailable": {"en": "No Offers Available!", "ar": "لايوجد عروض حاليا"},
"accessibility": {"en": "Accessibility Mode", "ar": "وضع امكانية الوصول"},
"orderStatus": {"en": "Order Status", "ar": "حالة الطلب"},
"CancelOrder": {"en": "Cancel Order", "ar": "الغاء الطلب"},

@ -198,7 +198,8 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
),
margin: EdgeInsets.symmetric(
horizontal: 8,
vertical: 4,
vertical: 1,
// vertical: 2,
),
child: Container(
decoration: BoxDecoration(
@ -210,11 +211,17 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
color: Colors.white,
),
padding: EdgeInsets.symmetric(
horizontal: 0),
width: MediaQuery.of(context)
.size
.width /
3,
horizontal: 4,
),
width: MediaQuery.of(context).size.width / 3,
// width: MediaQuery.of(context)
// .size
// .width /
// 1,
// height: MediaQuery.of(context)
// .size
// .width /
// 1,
child: Column(
crossAxisAlignment:
CrossAxisAlignment
@ -224,7 +231,7 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
children: [
Container(
margin: EdgeInsets
.fromLTRB(0, 16,
.fromLTRB(0, 1,
0, 0),
alignment: Alignment
.center,
@ -242,10 +249,68 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.cover,
height: 80,
height: 70,
),
),
Container(
// Container(
// width: model
// .finalProducts[
// index]
// .rxMessage !=
// null
// ? MediaQuery.of(
// context)
// .size
// .width /
// 2.8
// : 0,
// padding:
// EdgeInsets.all(
// 4),
// decoration:
// BoxDecoration(
// color: Color(
// 0xffb23838),
// borderRadius: BorderRadius.only(
// topLeft: Radius
// .circular(
// 6)),
// ),
// child: model
// .finalProducts[
// index]
// .rxMessage !=
// null
// ? Texts(
// languageID ==
// 'ar'
// ? model
// .finalProducts[
// index]
// .rxMessagen
// : model
// .finalProducts[index]
// .rxMessage,
// color: Colors
// .white,
// regular:
// true,
// fontSize:
// 10,
// fontWeight:
// FontWeight
// .w600,
// )
// : Texts(""),
// ),
],
),
Container(
margin: EdgeInsets
.symmetric(
horizontal: 0,
vertical: 2,
),
width: model
.finalProducts[
index]
@ -255,19 +320,18 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
context)
.size
.width /
2.8
2.0
: 0,
padding:
EdgeInsets.all(
4),
EdgeInsets.fromLTRB(8,4,8,4),
decoration:
BoxDecoration(
color: Color(
0xffb23838),
borderRadius: BorderRadius.only(
topLeft: Radius
.circular(
6)),
// borderRadius: BorderRadius.only(
// topLeft: Radius
// .circular(
// 6)),
),
child: model
.finalProducts[
@ -296,8 +360,6 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
)
: Texts(""),
),
],
),
Container(
margin: EdgeInsets
.symmetric(
@ -439,205 +501,268 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
(BuildContext context, int index) {
return InkWell(
child: Card(
child: Row(
children: [
Stack(
children: [
Column(
children: [
Container(
decoration:
BoxDecoration(),
child: Padding(
padding:
EdgeInsets
.only(
left: 9.0,
top: 8.0,
right: 10.0,
child: Padding(
padding: const EdgeInsets.all(4.0),
child: Row(
children: [
Stack(
children: [
Column(
children: [
Container(
decoration:
BoxDecoration(),
child: Padding(
padding:
EdgeInsets
.only(
left: 2.0,
top: 2.0,
right: 2.0,
),
),
),
),
Container(
margin: EdgeInsets
.fromLTRB(
0, 0, 0, 0),
alignment: Alignment
.center,
child:
Image.network(
model
.finalProducts[
index]
.images
.isNotEmpty
? model
.finalProducts[
index]
.images[0]
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit
.contain,
height: 80,
Container(
// margin: EdgeInsets
// .fromLTRB(
// 8, 0, 8, 0),
alignment: Alignment
.center,
child:
Image.network(
model
.finalProducts[
index]
.images
.isNotEmpty
? model
.finalProducts[
index]
.images[0]
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit
.contain,
height: 70,
),
),
),
],
],
),
// Column(
// children: [
// Container(
// width: model
// .finalProducts[
// index]
// .rxMessage !=
// null
// ? MediaQuery.of(
// context)
// .size
// .width /
// 5.3
// : 0,
// padding:
// EdgeInsets.all(
// 4),
// decoration:
// BoxDecoration(
// color: Color(
// 0xffb23838),
// borderRadius: BorderRadius.only(
// topLeft: Radius
// .circular(
// 6)),
// ),
// child: Texts(
// model
// .finalProducts[
// index]
// .rxMessage !=
// null
// ? model
// .finalProducts[
// index]
// .rxMessage
// : "",
// color:
// Colors.white,
// regular: true,
// fontSize: 10,
// fontWeight:
// FontWeight
// .w600,
// ),
// ),
// ],
// ),
],
),
Container(
height: 130.0,
margin:
EdgeInsets.symmetric(
horizontal: 0,
vertical: 6,
),
Column(
child: Column(
mainAxisAlignment:
MainAxisAlignment
.spaceAround,
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
Container(
margin: EdgeInsets
.symmetric(
horizontal: 4,
vertical: 0,
),
width: model
.finalProducts[
index]
.rxMessage !=
null
.finalProducts[
index]
.rxMessage !=
null
? MediaQuery.of(
context)
.size
.width /
5.3
context)
.size
.width /
2.0
: 0,
padding:
EdgeInsets.all(
4),
EdgeInsets.all(
4),
decoration:
BoxDecoration(
BoxDecoration(
color: Color(
0xffb23838),
borderRadius: BorderRadius.only(
topLeft: Radius
.circular(
6)),
// borderRadius: BorderRadius.only(
// topLeft: Radius
// .circular(
// 6)),
),
child: model
.finalProducts[
index]
.rxMessage !=
null
? Texts(
languageID ==
'ar'
? model
.finalProducts[
index]
.rxMessagen
: model
.finalProducts[index]
.rxMessage,
color: Colors
.white,
regular:
true,
fontSize:
10,
fontWeight:
FontWeight
.w600,
)
: Texts(""),
),
SizedBox(
height: 4.0,
),
Container(
width: MediaQuery.of(
context)
.size
.width *
0.65,
child: Texts(
model
.finalProducts[
index]
.rxMessage !=
null
? model
.finalProducts[
index]
.rxMessage
: "",
color:
Colors.white,
.finalProducts[
index]
.name,
regular: true,
fontSize: 10,
fontSize: 13.2,
fontWeight:
FontWeight
.w600,
FontWeight.w500,
maxLines: 5,
),
),
],
),
],
),
Container(
height: 100.0,
margin:
EdgeInsets.symmetric(
horizontal: 6,
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(
model
.finalProducts[
index]
.name,
regular: true,
fontSize: 13.2,
fontWeight:
FontWeight.w500,
maxLines: 5,
SizedBox(
height: 8.0,
),
),
SizedBox(
height: 8.0,
),
Padding(
padding:
const EdgeInsets
.only(
top: 4,
bottom: 4),
child: Texts(
"SAR ${model.finalProducts[index].price}",
bold: true,
fontSize: 14,
Padding(
padding:
const EdgeInsets
.only(
top: 4,
bottom: 4),
child: Texts(
"SAR ${model.finalProducts[index].price}",
bold: true,
fontSize: 14,
),
),
),
Row(
children: [
StarRating(
totalAverage: model
.finalProducts[
index]
.approvedRatingSum >
0
? (model.finalProducts[index].approvedRatingSum.toDouble() /
model.finalProducts[index].approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars:
true),
Texts(
"(${model.finalProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight
.w400,
)
],
),
],
Row(
children: [
StarRating(
totalAverage: model
.finalProducts[
index]
.approvedRatingSum >
0
? (model.finalProducts[index].approvedRatingSum.toDouble() /
model.finalProducts[index].approvedRatingSum
.toDouble())
.toDouble()
: 0,
forceStars:
true),
Texts(
"(${model.finalProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight
.w400,
)
],
),
],
),
),
),
widget.authenticatedUserObject.isLogin
? Container(
child: IconButton(
icon: Icon(Icons.shopping_cart,
size: 18,
color: Colors.blue,),
onPressed: () async {
if(model.finalProducts[index].rxMessage == null){
GifLoaderDialogUtils.showMyDialog(context);
await addToCartFunction(1, model.finalProducts[index].id);
GifLoaderDialogUtils.hideDialog(context);
Navigator.push(
context,
FadePage(page: CartOrderPage()));
widget.authenticatedUserObject.isLogin
? Container(
child: IconButton(
icon: Icon(Icons.shopping_cart,
size: 18,
color: Colors.blue,),
onPressed: () async {
if(model.finalProducts[index].rxMessage == null){
GifLoaderDialogUtils.showMyDialog(context);
await addToCartFunction(1, model.finalProducts[index].id);
GifLoaderDialogUtils.hideDialog(context);
Navigator.push(
context,
FadePage(page: CartOrderPage()));
}
else{
AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription);
}
else{
AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription);
}
//
}
}
),
):Container(),
],
),
):Container(),
],
),
),
),
onTap: () => {

@ -713,7 +713,7 @@ class _OffersCategorisePageState extends State<OffersCategorisePage> {
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(TranslationBase.of(context).noData,
child: Text(TranslationBase.of(context).noOffersAvailable,
// 'There is no data',
style: TextStyle(fontSize: 30),
),

@ -1031,7 +1031,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.contain,
height: 80,
height: 70,
),
),
],
@ -1086,7 +1086,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
),
Container(
margin: EdgeInsets.symmetric(
horizontal: 6,
horizontal: 0,
vertical: 0,
),
child: Column(

@ -421,7 +421,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
fontSize: 14),
),
color: Color(0xFF4CAF50),
disabledColor:Colors.grey[700],
disabledColor:Color(0xFF848484),
// disabledColor: Color(0xff005aff),
)
// RaisedButton(

@ -128,92 +128,104 @@ class _FooterWidgetState extends State<FooterWidget> {
: Container(
height: 20,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 70,
height: 50,
child: FlatButton(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 4,
child: Text(
widget.quantity.toString(),
style: TextStyle(fontSize: 20),
Container(
height: 58,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 90,
height: 60,
child: FlatButton(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 4,
child: Text(
widget.quantity.toString(),
style: TextStyle(fontSize: 20),
),
),
),
Expanded(
flex: 5,
child: Text(
TranslationBase.of(context).quantityShortcut,
style: TextStyle(fontSize: 16),
Expanded(
flex: 5,
child: Text(
TranslationBase.of(context).quantityShortcut,
style: TextStyle(fontSize: 16),
),
),
),
],
],
),
onPressed: () {
setState(() {
if (showUI) {
quantityUI = 80;
showUI = false;
} else {
quantityUI = 160;
showUI = true;
}
});
},
),
onPressed: () {
setState(() {
if (showUI) {
quantityUI = 80;
showUI = false;
} else {
quantityUI = 160;
showUI = true;
}
});
},
),
),
Container(
width: MediaQuery.of(context).size.width * 0.45,
child: SecondaryButton(
label: TranslationBase.of(context).addToCart.toUpperCase(),
disabled: (!widget.isAvailable && widget.quantity > 0) || widget.quantity > widget.quantityLimit || widget.item.isRx,
onTap: () async {
if (!authenticatedUserObject.isLogin) {
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
} else
await widget.addToCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model);
},
fontWeight: FontWeight.w600,
borderColor: Color(0xFF4CAF50),
borderRadius: 3,
color: Color(0xFF4CAF50),
SizedBox(
width: 10,
),
),
SizedBox(
width: 5,
),
Container(
width: MediaQuery.of(context).size.width * 0.35,
child: SecondaryButton(
label: TranslationBase.of(context).buyNow.toUpperCase(),
disabled: (!widget.isAvailable && widget.quantity > 0) || (widget.quantity > widget.quantityLimit) || widget.item.isRx,
onTap: () async {
await widget.addToShoppingCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model);
Navigator.push(
context,
FadePage(page: CartOrderPage()),
);
},
fontWeight: FontWeight.w600,
borderColor: Colors.grey[800],
borderRadius: 3,
disableColor: Colors.grey[700],
color: !widget.isAvailable && widget.quantity > 0 || widget.quantity > widget.quantityLimit || widget.item.rxMessage != null ? Colors.grey : Colors.grey[800],
Container(
width: MediaQuery.of(context).size.width * 0.35,
child: SecondaryButton(
label: TranslationBase.of(context).addToCart.toUpperCase(),
disabled: (!widget.isAvailable && widget.quantity > 0) || widget.quantity > widget.quantityLimit || widget.item.isRx,
onTap: () async {
if (!authenticatedUserObject.isLogin) {
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
} else
await widget.addToCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model);
},
fontWeight: FontWeight.w600,
borderColor: Color(0xFF4CAF50),
borderRadius: 3,
color: Color(0xFF4CAF50),
),
),
SizedBox(
width: 5,
),
Container(
width: MediaQuery.of(context).size.width * 0.35,
child: SecondaryButton(
label: TranslationBase.of(context).buyNow.toUpperCase(),
disabled: (!widget.isAvailable && widget.quantity > 0) || (widget.quantity > widget.quantityLimit) || widget.item.isRx,
onTap: () async {
if (!authenticatedUserObject.isLogin) {
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
} else {
await widget.addToShoppingCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model);
Navigator.push(
context,
FadePage(page: CartOrderPage()),
);}
},
fontWeight: FontWeight.w600,
borderColor: Colors.grey[800],
borderRadius: 3,
disableColor: Colors.grey[700],
color: !widget.isAvailable && widget.quantity > 0 || widget.quantity > widget.quantityLimit || widget.item.rxMessage != null ? Colors.grey : Colors.grey[800],
),
),
),
],
],
),
),
],
),
);
}

@ -78,7 +78,7 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
borderRadius: BorderRadius.circular(15),
),
padding: EdgeInsets.only(left: 5, right: 4.5),
height: 18,
height: 19,
child: Center(
child: Texts(
Provider.of<OrderPreviewViewModel>(context, listen: false).cartResponse.quantityCount.toString(),

@ -1,11 +1,14 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/brand_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class SearchBrandsPage extends StatefulWidget {
@override
@ -23,7 +26,7 @@ class _SearchBrandsPageState extends State<SearchBrandsPage> {
onModelReady: (model) => model.searchProducts(),
builder: (BuildContext context, model, Widget child) =>
PharmacyAppScaffold(
appBarTitle: 'Search',
appBarTitle: TranslationBase.of(context).search,
isBottomBar: false,
isShowAppBar: true,
backgroundColor: Colors.white,
@ -44,24 +47,36 @@ class _SearchBrandsPageState extends State<SearchBrandsPage> {
key: _formKey,
child: TextFields(
autoFocus: true,
hintText: 'Search',
hintText: TranslationBase.of(context).search,
fontSize: 19.0,
prefixIcon: Icon(Icons.search),
inputAction: TextInputAction.search,
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.deny(RegExp("[\u0621-\u064a-\ ]"))
],
validator: (value) {
RegExp regExp = RegExp('[\u0621-\u064a-\ ]');
if (value.isEmpty) {
TranslationBase.of(context).pleaseEnterProductName;
}else if (regExp.hasMatch(value)){
AppToast.showErrorToast(message: TranslationBase.of(context).noArabicLetters);
}
return null;
},
onSaved: (value) {
//searchMedicine(model, context);
},
onSubmit: (value) {
searchMedicine(model, context);
msg = 'No Result Found';
msg = TranslationBase.of(context).noResultFound;
},
controller: textController,
validator: (value) {
if (value.isEmpty) {
return 'please Enter Product Name';
}
return null;
},
// validator: (value) {
// if (value.isEmpty) {
// return 'please Enter Product Name';
// }
// return null;
// },
),
),
),
@ -70,7 +85,7 @@ class _SearchBrandsPageState extends State<SearchBrandsPage> {
),
InkWell(
child: Texts(
'Cancel',
TranslationBase.of(context).cancel,
fontSize: 17.0,
fontWeight: FontWeight.w500,
),

@ -88,7 +88,7 @@ class ProductTileItem extends StatelessWidget {
Stack(
children: [
Container(
margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
alignment: Alignment.center,
child: (item.images != null && item.images.length > 0)
? Image.network(
@ -102,17 +102,42 @@ class ProductTileItem extends StatelessWidget {
height: itemHeight / 2,
),
),
Container(
width: item.rxMessage != null
? MediaQuery.of(context).size.width / 5
: 0,
padding: EdgeInsets.all(4),
// Container(
// width: item.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: item.rxMessage != null
// ? Texts(
// projectProvider.isArabic
// ? item.rxMessagen
// : item.rxMessage,
// color: Colors.white,
// regular: true,
// fontSize: 10,
// fontWeight: FontWeight.w400,
// )
// : Texts(""),
// )
],
),
Padding(
padding: EdgeInsets.fromLTRB(4,2,4,2),
child: Container(
// width: item.rxMessage != null
// ? MediaQuery.of(context).size.width / 5
// : 0,
// padding: EdgeInsets.fromLTRB(6,4,6,4),
decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius:
BorderRadius.only(topLeft: Radius.circular(6)),
),
child: item.rxMessage != null
child: item.rxMessage != null
? Texts(
projectProvider.isArabic
? item.rxMessagen
@ -123,12 +148,11 @@ class ProductTileItem extends StatelessWidget {
fontWeight: FontWeight.w400,
)
: Texts(""),
)
],
),
SizedBox(height: 8,),
),
),
// SizedBox(height: 4,),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 6.0),
padding: const EdgeInsets.symmetric(horizontal: 4.0),
child: Texts(
projectProvider.isArabic ? item.namen : item.name,
regular: true,
@ -139,7 +163,7 @@ class ProductTileItem extends StatelessWidget {
Expanded(
child: Container(
margin: EdgeInsets.symmetric(
horizontal: 6,
horizontal: 4,
vertical: 0,
),
child: Column(
@ -147,7 +171,7 @@ class ProductTileItem extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.end,
children: [
Padding(
padding: const EdgeInsets.only(top: 4, bottom: 4),
padding: const EdgeInsets.only(top: 2, bottom: 2),
child: Texts(
"SAR ${item.price}",
fontWeight: FontWeight.w600,

@ -36,7 +36,7 @@ class PrescriptionsWidget extends StatelessWidget {
ViewAllHomeWidget(TranslationBase.of(context).myPrescription, HomePrescriptionsPage()),
Container(
margin: EdgeInsets.only(right: 10.0, left: 10.0),
height: MediaQuery.of(context).size.height * 0.20,
height: MediaQuery.of(context).size.height * 0.28,
child: ListView.builder(
scrollDirection: Axis.horizontal,
shrinkWrap: true,
@ -63,7 +63,7 @@ class PrescriptionsWidget extends StatelessWidget {
top: 10.0,
left: 10.0,
right: 10.0,
bottom: 15.0,
bottom: 10.0,
),
child: CircleAvatar(
radius: 30,
@ -85,7 +85,7 @@ class PrescriptionsWidget extends StatelessWidget {
border: Border.all(
color: Colors.green,
style: BorderStyle.solid,
width: 4.0,
width: 3.0,
),
color: Colors.green,
borderRadius: BorderRadius.circular(30.0)),

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_mo
import 'package:diplomaticquarterapp/pages/pharmacies/product-brands.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -12,6 +13,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'base/base_view.dart';
@ -25,6 +27,7 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
final _formKey = GlobalKey<FormState>();
String msg = '';
@override
Widget build(BuildContext context) {
return BaseView<PharmacyCategoriseViewModel>(
@ -57,6 +60,18 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
fontSize: 14.5,
prefixIcon: Icon(Icons.search),
inputAction: TextInputAction.search,
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.deny(RegExp("[\u0621-\u064a-\ ]"))
],
validator: (value) {
RegExp regExp = RegExp('[\u0621-\u064a-\ ]');
if (value.isEmpty) {
TranslationBase.of(context).pleaseEnterProductName;
}else if (regExp.hasMatch(value)){
AppToast.showErrorToast(message: TranslationBase.of(context).noArabicLetters);
}
return null;
},
onSaved: (value) {
//searchMedicine(model, context);
},
@ -66,13 +81,13 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
msg = TranslationBase.of(context).noResultFound;
},
controller: textController,
validator: (value) {
if (value.isEmpty) {
// return 'please Enter Product Name';
return TranslationBase.of(context).pleaseEnterProductName;
}
return null;
},
// validator: (value) {
// if (value.isEmpty) {
//// return 'please Enter Product Name';
// return TranslationBase.of(context).pleaseEnterProductName;
// }
// return null;
// },
),
),
),

@ -987,9 +987,9 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
],
),
Container(
height: 100.0,
height: 130.0,
margin: EdgeInsets.symmetric(
horizontal: 6,
horizontal: 0,
vertical: 0,
),
child: Column(

@ -1765,6 +1765,10 @@ class TranslationBase {
String get outOfStockMsg => localizedValues['outOfStockMsg'][locale.languageCode];
String get noArabicLetters => localizedValues['noArabicLetters'][locale.languageCode];
String get noOffersAvailable => localizedValues['noOffersAvailable'][locale.languageCode];
String get requestID => localizedValues['requestID'][locale.languageCode];
String get OrderStatus => localizedValues['OrderStatus'][locale.languageCode];

Loading…
Cancel
Save