merge-update-with-lab-changes
devamirsaleemahmad 2 years ago
parent d8836d5e89
commit 47801ecb36

@ -26,7 +26,7 @@ class TestPageState extends State<TestPage>{
} }
void location(){ void location(){
LocationUtils().getCurrentLocation(callBack: (latLng){ LocationUtils(context: context,isShowConfirmDialog: false).getCurrentLocation(callBack: (latLng){
print(latLng.toString()); print(latLng.toString());
}); });
} }

@ -17,8 +17,8 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
import 'base/base_view.dart'; import 'base/base_view.dart';
@ -26,7 +26,7 @@ import 'base/base_view.dart';
dynamic languageID; dynamic languageID;
class FinalProductsPage extends StatefulWidget { class FinalProductsPage extends StatefulWidget {
final String id; final String? id;
final int productType; // 1 : default, 2 : manufacturer , 3 : recently viewed final int productType; // 1 : default, 2 : manufacturer , 3 : recently viewed
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
@ -37,7 +37,7 @@ class FinalProductsPage extends StatefulWidget {
} }
class _FinalProductsPageState extends State<FinalProductsPage> { class _FinalProductsPageState extends State<FinalProductsPage> {
String id; String? id;
_FinalProductsPageState({this.id}); _FinalProductsPageState({this.id});
@ -70,7 +70,7 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
model.getFinalProducts(i: id); model.getFinalProducts(i: id);
appBarTitle = TranslationBase.of(context).products; appBarTitle = TranslationBase.of(context).products;
} else if (widget.productType == 2) { } else if (widget.productType == 2) {
model.getManufacturerProducts(id); model.getManufacturerProducts(id!);
} else if (widget.productType == 3) { } else if (widget.productType == 3) {
model.getLastVisitedProducts(); model.getLastVisitedProducts();
appBarTitle = TranslationBase.of(context).recentlyViewed; appBarTitle = TranslationBase.of(context).recentlyViewed;
@ -86,7 +86,7 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
} }
}, },
allowAny: true, allowAny: true,
builder: (BuildContext context, PharmacyCategoriseViewModel model, Widget child) => AppScaffold( builder: (BuildContext context, PharmacyCategoriseViewModel model, Widget? child) => AppScaffold(
isPharmacy: true, isPharmacy: true,
appBarTitle: appBarTitle, appBarTitle: appBarTitle,
isBottomBar: true, isBottomBar: true,
@ -217,9 +217,9 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
margin: EdgeInsets.fromLTRB(0, 16, 0, 0), margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
alignment: Alignment.center, alignment: Alignment.center,
child: (model.finalProducts[index].images != null && child: (model.finalProducts[index].images != null &&
model.finalProducts[index].images.length > 0) model.finalProducts[index].images!.length > 0)
? Image.network( ? Image.network(
model.finalProducts[index].images[0].src, model.finalProducts[index].images![0].src!,
fit: BoxFit.cover, fit: BoxFit.cover,
height: 80, height: 80,
width: 80, width: 80,
@ -305,16 +305,30 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
// ? (model.finalProducts[index].approvedRatingSum.toDouble() / model.finalProducts[index].approvedRatingSum.toDouble()).toDouble() // ? (model.finalProducts[index].approvedRatingSum.toDouble() / model.finalProducts[index].approvedRatingSum.toDouble()).toDouble()
// : 0, // : 0,
// forceStars: true), // forceStars: true),
RatingBar.readOnly(
initialRating: model.finalProducts[index].approvedRatingSum.toDouble(), RatingBar(
size: 15.0, initialRating: model.finalProducts[index].approvedRatingSum!.toDouble(),
filledColor: Colors.yellow[700], ratingWidget: RatingWidget(
emptyColor: Colors.grey[500], full: Icon(
isHalfAllowed: true, Icons.star,
halfFilledIcon: Icons.star_half, color: Colors.yellow[700],
filledIcon: Icons.star, ),
emptyIcon: Icons.star, half: Icon(
Icons.star_half,
color: Colors.yellow[700],
),
empty: Icon(
Icons.star_border,
color: Colors.grey[500],
),
),
onRatingUpdate: (double value) {},
unratedColor: Colors.grey[500],
updateOnDrag: false,
tapOnlyMode: false,
), ),
Texts( Texts(
"(${model.finalProducts[index].approvedTotalReviews})", "(${model.finalProducts[index].approvedTotalReviews})",
regular: true, regular: true,
@ -394,9 +408,9 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
margin: EdgeInsets.fromLTRB(0, 0, 0, 8), margin: EdgeInsets.fromLTRB(0, 0, 0, 8),
alignment: Alignment.center, alignment: Alignment.center,
child:(model.finalProducts[index].images != null && child:(model.finalProducts[index].images != null &&
model.finalProducts[index].images.length > 0) model.finalProducts[index].images!.length > 0)
? Image.network( ? Image.network(
model.finalProducts[index].images[0].src, model.finalProducts[index].images![0].src!,
fit: BoxFit.cover, fit: BoxFit.cover,
height: 80, height: 80,
width: 80, width: 80,
@ -489,16 +503,30 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
// ? (model.finalProducts[index].approvedRatingSum.toDouble() / model.finalProducts[index].approvedRatingSum.toDouble()).toDouble() // ? (model.finalProducts[index].approvedRatingSum.toDouble() / model.finalProducts[index].approvedRatingSum.toDouble()).toDouble()
// : 0, // : 0,
// forceStars: true), // forceStars: true),
RatingBar.readOnly( RatingBar(
initialRating: model.finalProducts[index].approvedRatingSum.toDouble(), initialRating: model.finalProducts[index].approvedRatingSum!.toDouble(),
size: 15.0, ratingWidget: RatingWidget(
filledColor: Colors.yellow[700], full: Icon(
emptyColor: Colors.grey[500], Icons.star,
isHalfAllowed: true, color: Colors.yellow[700],
halfFilledIcon: Icons.star_half, ),
filledIcon: Icons.star, half: Icon(
emptyIcon: Icons.star, Icons.star_half,
color: Colors.yellow[700],
),
empty: Icon(
Icons.star_border,
color: Colors.grey[500],
),
),
onRatingUpdate: (double value) {},
unratedColor: Colors.grey[500],
updateOnDrag: false,
tapOnlyMode: false,
), ),
Texts( Texts(
"(${model.finalProducts[index].approvedTotalReviews})", "(${model.finalProducts[index].approvedTotalReviews})",
regular: true, regular: true,

@ -18,9 +18,9 @@ import '../../config/config.dart';
class IncomingCall extends StatefulWidget { class IncomingCall extends StatefulWidget {
IncomingCallData incomingCallData; IncomingCallData? incomingCallData;
IncomingCall({required this.incomingCallData}); IncomingCall({ this.incomingCallData});
@override @override
_IncomingCallState createState() => _IncomingCallState(); _IncomingCallState createState() => _IncomingCallState();

File diff suppressed because it is too large Load Diff

@ -21,15 +21,15 @@ import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.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 'base/base_view.dart'; import 'base/base_view.dart';
class ParentCategorisePage extends StatefulWidget { class ParentCategorisePage extends StatefulWidget {
String id; String? id;
String titleName; String? titleName;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
@ -40,8 +40,8 @@ class ParentCategorisePage extends StatefulWidget {
} }
class _ParentCategorisePageState extends State<ParentCategorisePage> { class _ParentCategorisePageState extends State<ParentCategorisePage> {
String id; String? id;
String titleName; String? titleName;
final dynamic productID; final dynamic productID;
_ParentCategorisePageState({ _ParentCategorisePageState({
@ -63,8 +63,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
int pageIndex = 1; int pageIndex = 1;
List<CategoriseParentModel> entityList =[]; List<CategoriseParentModel> entityList = [];
List<CategoriseParentModel> entityListBrands =[]; List<CategoriseParentModel> entityListBrands = [];
RefreshController controller = RefreshController(); RefreshController controller = RefreshController();
@ -77,9 +77,9 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
return BaseView<PharmacyCategoriseViewModel>( return BaseView<PharmacyCategoriseViewModel>(
onModelReady: (model) => model.getCategoriseParent(i: id, pageIndex: pageIndex, isLoading: false, context: context), onModelReady: (model) => model.getCategoriseParent(i: id, pageIndex: pageIndex, isLoading: false, context: context),
allowAny: true, allowAny: true,
builder: (BuildContext context, PharmacyCategoriseViewModel model, Widget child) => AppScaffold( builder: (BuildContext context, PharmacyCategoriseViewModel model, Widget? child) => AppScaffold(
isPharmacy: true, isPharmacy: true,
appBarTitle: titleName, appBarTitle: titleName!,
isBottomBar: true, isBottomBar: true,
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.white, backgroundColor: Colors.white,
@ -338,10 +338,6 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
entityList.add(history); entityList.add(history);
}); });
}, },
addSelectedHistories: () {
//TODO build your fun herr
// widget.addSelectedHistories();
},
isEntityListSelected: (master) => isEntityListSelected(master), isEntityListSelected: (master) => isEntityListSelected(master),
) )
], ],
@ -366,10 +362,6 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
entityListBrands.add(history); entityListBrands.add(history);
}); });
}, },
addSelectedHistories: () {
//TODO build your fun herr
// widget.addSelectedHistories();
},
isEntityListSelected: (master) => isEntityListSelectedBrands(master), isEntityListSelected: (master) => isEntityListSelectedBrands(master),
) )
], ],
@ -462,7 +454,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
String categoriesId = ""; String categoriesId = "";
for (CategoriseParentModel category in entityList) { for (CategoriseParentModel category in entityList) {
if (categoriesId == "") { if (categoriesId == "") {
categoriesId = category.id; categoriesId = category.id!;
} else { } else {
categoriesId = "$categoriesId,${category.id}"; categoriesId = "$categoriesId,${category.id}";
} }
@ -470,7 +462,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
String brandIds = ""; String brandIds = "";
for (CategoriseParentModel brand in entityListBrands) { for (CategoriseParentModel brand in entityListBrands) {
if (brandIds == "") { if (brandIds == "") {
brandIds = brand.id; brandIds = brand.id!;
} else { } else {
brandIds = "$brandIds,${brand.id}"; brandIds = "$brandIds,${brand.id}";
} }
@ -633,8 +625,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
margin: EdgeInsets.fromLTRB(0, 16, 0, 0), margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
alignment: Alignment.center, alignment: Alignment.center,
child: Image.network( child: Image.network(
model.parentProducts[index].images.isNotEmpty model.parentProducts[index].images!.isNotEmpty
? model.parentProducts[index].images[0].thumb ? model.parentProducts[index].images![0].thumb!
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.cover, fit: BoxFit.cover,
height: 80, height: 80,
@ -736,16 +728,29 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
// ? (model.parentProducts[index].approvedRatingSum.toDouble() / model.parentProducts[index].approvedRatingSum.toDouble()).toDouble() // ? (model.parentProducts[index].approvedRatingSum.toDouble() / model.parentProducts[index].approvedRatingSum.toDouble()).toDouble()
// : 0, // : 0,
// forceStars: true), // forceStars: true),
RatingBar.readOnly(
initialRating: model.parentProducts[index].approvedRatingSum.toDouble(), RatingBar(
size: 15.0, initialRating: model.parentProducts[index].approvedRatingSum!.toDouble(),
filledColor: Colors.yellow[700], ratingWidget: RatingWidget(
emptyColor: Colors.grey[500], full: Icon(
isHalfAllowed: true, Icons.star,
halfFilledIcon: Icons.star_half, color: Colors.yellow[700],
filledIcon: Icons.star, ),
emptyIcon: Icons.star, half: Icon(
Icons.star_half,
color: Colors.yellow[700],
),
empty: Icon(
Icons.star_border,
color: Colors.grey[500],
),
),
onRatingUpdate: (double value) {},
unratedColor: Colors.grey[500],
updateOnDrag: false,
tapOnlyMode: false,
), ),
Texts( Texts(
"(${model.parentProducts[index].approvedTotalReviews})", "(${model.parentProducts[index].approvedTotalReviews})",
regular: true, regular: true,
@ -799,9 +804,9 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Container( Container(
margin: EdgeInsets.fromLTRB(0, 0, 0, 0), margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
alignment: Alignment.center, alignment: Alignment.center,
child: model.parentProducts[index].images.isNotEmpty child: model.parentProducts[index].images!.isNotEmpty
? Image.network( ? Image.network(
model.parentProducts[index].images[0].thumb, model.parentProducts[index].images![0].thumb!,
fit: BoxFit.contain, fit: BoxFit.contain,
height: 70, height: 70,
) )
@ -879,16 +884,29 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
// ? (model.parentProducts[index].approvedRatingSum.toDouble() / model.parentProducts[index].approvedRatingSum.toDouble()).toDouble() // ? (model.parentProducts[index].approvedRatingSum.toDouble() / model.parentProducts[index].approvedRatingSum.toDouble()).toDouble()
// : 0, // : 0,
// forceStars: true), // forceStars: true),
RatingBar.readOnly(
initialRating: model.parentProducts[index].approvedRatingSum.toDouble(), RatingBar(
size: 15.0, initialRating: model.parentProducts[index].approvedRatingSum!.toDouble(),
filledColor: Colors.yellow[700], ratingWidget: RatingWidget(
emptyColor: Colors.grey[500], full: Icon(
isHalfAllowed: true, Icons.star,
halfFilledIcon: Icons.star_half, color: Colors.yellow[700],
filledIcon: Icons.star, ),
emptyIcon: Icons.star, half: Icon(
Icons.star_half,
color: Colors.yellow[700],
),
empty: Icon(
Icons.star_border,
color: Colors.grey[500],
),
),
onRatingUpdate: (double value) {},
unratedColor: Colors.grey[500],
updateOnDrag: false,
tapOnlyMode: false,
), ),
Texts( Texts(
"(${model.parentProducts[index].approvedTotalReviews})", "(${model.parentProducts[index].approvedTotalReviews})",
regular: true, regular: true,

@ -23,7 +23,7 @@ class PharmacyCategorisePage extends StatefulWidget {
} }
class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> { class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
String idCategorise; String? idCategorise;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -31,9 +31,7 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
return BaseView<PharmacyCategoriseViewModel>( return BaseView<PharmacyCategoriseViewModel>(
onModelReady: (model) => model.getCategorise(), onModelReady: (model) => model.getCategorise(),
allowAny: true, allowAny: true,
builder: (BuildContext context, PharmacyCategoriseViewModel model, builder: (BuildContext context, PharmacyCategoriseViewModel model, Widget? child) => AppScaffold(
Widget child) =>
AppScaffold(
isShowDecPage: false, isShowDecPage: false,
isShowAppBar: false, isShowAppBar: false,
isMainPharmacyPages: true, isMainPharmacyPages: true,
@ -66,9 +64,7 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 10.0), padding: EdgeInsets.symmetric(horizontal: 10.0),
child: Texts( child: Texts(
projectViewModel.isArabic projectViewModel.isArabic ? model.categorise[index].namen : model.categorise[index].name,
? model.categorise[index].namen
: model.categorise[index].name,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -80,8 +76,8 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
page: model.categorise[index].id != '12' page: model.categorise[index].id != '12'
? ParentCategorisePage( ? ParentCategorisePage(
id: model.categorise[index].id, id: model.categorise[index].id,
titleName: projectViewModel.isArabic ? model.categorise[index].namen : model.categorise[index].name, titleName: projectViewModel.isArabic ? model.categorise[index].namen : model.categorise[index].name,
// titleName: model.categorise[index].name, // titleName: model.categorise[index].name,
) )
: FinalProductsPage( : FinalProductsPage(
id: model.categorise[index].id, id: model.categorise[index].id,
@ -99,10 +95,7 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
height: 140, height: 140,
child: Column( child: Column(
children: [ children: [
Divider( Divider(height: 2.0, thickness: 1.0, color: Colors.black12.withOpacity(0.14)),
height: 2.0,
thickness: 1.0,
color: Colors.black12.withOpacity(0.14)),
SizedBox( SizedBox(
height: 10.0, height: 10.0,
), ),
@ -128,16 +121,12 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
width: 55.0, width: 55.0,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0), borderRadius: BorderRadius.circular(5.0),
color: color: Colors.green.shade300.withOpacity(0.34),
Colors.green.shade300.withOpacity(0.34),
), ),
child: Padding( child: Padding(
padding: padding: EdgeInsets.symmetric(horizontal: 10.0),
EdgeInsets.symmetric(horizontal: 10.0),
child: Texts( child: Texts(
projectViewModel.isArabic projectViewModel.isArabic ? 'الاكثر مبيعا' : 'Best Sellers',
? 'الاكثر مبيعا'
: 'Best Sellers',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -164,17 +153,13 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
height: 50.0, height: 50.0,
width: 55.0, width: 55.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.orangeAccent.shade200 color: Colors.orangeAccent.shade200.withOpacity(0.34),
.withOpacity(0.34),
borderRadius: BorderRadius.circular(5.0), borderRadius: BorderRadius.circular(5.0),
), ),
child: Padding( child: Padding(
padding: padding: EdgeInsets.symmetric(horizontal: 10.0),
EdgeInsets.symmetric(horizontal: 10.0),
child: Texts( child: Texts(
projectViewModel.isArabic projectViewModel.isArabic ? 'الاكثر مشاهدة' : 'Most Viewed',
? 'الاكثر مشاهدة'
: 'Most Viewed',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -209,12 +194,9 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
borderRadius: BorderRadius.circular(5.0), borderRadius: BorderRadius.circular(5.0),
), ),
child: Padding( child: Padding(
padding: padding: EdgeInsets.symmetric(horizontal: 10.0),
EdgeInsets.symmetric(horizontal: 10.0),
child: Texts( child: Texts(
projectViewModel.isArabic projectViewModel.isArabic ? 'منتجات جديدة' : 'New Products',
? 'منتجات جديدة'
: 'New Products',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -241,17 +223,13 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
height: 50.0, height: 50.0,
width: 55.0, width: 55.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: color: Colors.purple.shade200.withOpacity(0.34),
Colors.purple.shade200.withOpacity(0.34),
borderRadius: BorderRadius.circular(5.0), borderRadius: BorderRadius.circular(5.0),
), ),
child: Padding( child: Padding(
padding: padding: EdgeInsets.symmetric(horizontal: 10.0),
EdgeInsets.symmetric(horizontal: 10.0),
child: Texts( child: Texts(
projectViewModel.isArabic projectViewModel.isArabic ? 'شوهد مؤخرا' : 'Recently Viewed',
? 'شوهد مؤخرا'
: 'Recently Viewed',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
@ -277,7 +255,9 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
/// When give qr we will change this method to get data /// When give qr we will change this method to get data
/// var result = await BarcodeScanner.scan(); /// var result = await BarcodeScanner.scan();
/// int patientID = get from qr result /// int patientID = get from qr result
String result = (await BarcodeScanner.scan())?.rawContent; String result = await BarcodeScanner.scan().then((value) {
return value.rawContent;
});
var data = json.decode(result); var data = json.decode(result);
if (data != null) { if (data != null) {
var qRParkingID = data['QRParkingID']; var qRParkingID = data['QRParkingID'];
@ -285,7 +265,7 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else { } else {
AppToast.showSuccessToast(message: model.scanList[0].id); AppToast.showSuccessToast(message: model.scanList[0].id!);
{ {
Navigator.push( Navigator.push(
context, context,

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
// import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart'; // import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -37,9 +38,7 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
ProjectViewModel projectProvider = Provider.of(context); ProjectViewModel projectProvider = Provider.of(context);
return BaseView<PharmacyCategoriseViewModel>( return BaseView<PharmacyCategoriseViewModel>(
onModelReady: (model) => model.clearSearchList(), onModelReady: (model) => model.clearSearchList(),
builder: (BuildContext context, PharmacyCategoriseViewModel model, builder: (BuildContext context, PharmacyCategoriseViewModel model, Widget? child) => PharmacyAppScaffold(
Widget child) =>
PharmacyAppScaffold(
appBarTitle: TranslationBase.of(context).search, appBarTitle: TranslationBase.of(context).search,
isBottomBar: false, isBottomBar: false,
isShowAppBar: true, isShowAppBar: true,
@ -122,8 +121,7 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
height: MediaQuery.of(context).size.height * 0.80, height: MediaQuery.of(context).size.height * 0.80,
child: GridView.builder( child: GridView.builder(
//physics: NeverScrollableScrollPhysics(), //physics: NeverScrollableScrollPhysics(),
gridDelegate: gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, crossAxisCount: 2,
crossAxisSpacing: 0.5, crossAxisSpacing: 0.5,
mainAxisSpacing: 2.0, mainAxisSpacing: 2.0,
@ -133,11 +131,7 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return InkWell( return InkWell(
child: Card( child: Card(
color: model.searchList[index] color: model.searchList[index].discountName != null ? Color(0xffFFFF00) : Colors.white,
.discountName !=
null
? Color(0xffFFFF00)
: Colors.white,
elevation: 0, elevation: 0,
shape: Border( shape: Border(
right: BorderSide( right: BorderSide(
@ -168,70 +162,38 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
), ),
color: Colors.white, color: Colors.white,
), ),
padding: padding: EdgeInsets.symmetric(horizontal: 0),
EdgeInsets.symmetric(horizontal: 0), width: MediaQuery.of(context).size.width / 3,
width:
MediaQuery.of(context).size.width /
3,
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Stack( Stack(
children: [ children: [
Container( Container(
margin: EdgeInsets.fromLTRB( margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
0, 16, 0, 0),
alignment: Alignment.center, alignment: Alignment.center,
child: Image.network( child: Image.network(
model.searchList[index] model.searchList[index].images!.isNotEmpty
.images.isNotEmpty ? model.searchList[index].images![0].thumb!
? model
.searchList[index]
.images[0]
.thumb
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
fit: BoxFit.cover, fit: BoxFit.cover,
height: 80, height: 80,
), ),
), ),
Container( Container(
width: model.searchList[index] width: model.searchList[index].rxMessage != null ? MediaQuery.of(context).size.width / 3 : 0,
.rxMessage !=
null
? MediaQuery.of(context)
.size
.width /
3
: 0,
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xffb23838), color: Color(0xffb23838),
borderRadius: borderRadius: BorderRadius.only(topLeft: Radius.circular(6)),
BorderRadius.only(
topLeft:
Radius.circular(
6)),
), ),
child: model.searchList[index] child: model.searchList[index].rxMessage != null
.rxMessage !=
null
? Texts( ? Texts(
projectProvider projectProvider.isArabic ? model.searchList[index].rxMessagen : model.searchList[index].rxMessage,
.isArabic
? model
.searchList[
index]
.rxMessagen
: model
.searchList[
index]
.rxMessage,
color: Colors.white, color: Colors.white,
regular: true, regular: true,
fontSize: 10, fontSize: 10,
fontWeight: fontWeight: FontWeight.w400,
FontWeight.w400,
) )
: Texts(""), : Texts(""),
// Texts( // Texts(
@ -256,17 +218,10 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
vertical: 0, vertical: 0,
), ),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
projectProvider.isArabic projectProvider.isArabic ? model.searchList[index].namen : model.searchList[index].name,
? model
.searchList[index]
.namen
: model
.searchList[index]
.name,
// model.searchList[index].name, // model.searchList[index].name,
regular: true, regular: true,
@ -274,9 +229,7 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
), ),
Padding( Padding(
padding: padding: const EdgeInsets.only(top: 4, bottom: 4),
const EdgeInsets.only(
top: 4, bottom: 4),
child: Texts( child: Texts(
"SAR ${model.searchList[index].price}", "SAR ${model.searchList[index].price}",
bold: true, bold: true,
@ -286,30 +239,15 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
Row( Row(
children: [ children: [
StarRating( StarRating(
totalAverage: model totalAverage: model.searchList[index].approvedRatingSum! > 0
.searchList[ ? (model.searchList[index].approvedRatingSum!.toDouble() / model.searchList[index].approvedRatingSum!.toDouble()).toDouble()
index]
.approvedRatingSum >
0
? (model
.searchList[
index]
.approvedRatingSum
.toDouble() /
model
.searchList[
index]
.approvedRatingSum
.toDouble())
.toDouble()
: 0, : 0,
forceStars: true), forceStars: true),
Texts( Texts(
"(${model.searchList[index].approvedTotalReviews})", "(${model.searchList[index].approvedTotalReviews})",
regular: true, regular: true,
fontSize: 10, fontSize: 10,
fontWeight: fontWeight: FontWeight.w400,
FontWeight.w400,
) )
], ],
), ),
@ -324,8 +262,7 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: ProductDetailPage( page: ProductDetailPage(model.searchList[index]),
model.searchList[index]),
)), )),
}, },
); );
@ -350,7 +287,6 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
searchMedicine(PharmacyCategoriseViewModel model, BuildContext context) { searchMedicine(PharmacyCategoriseViewModel model, BuildContext context) {
Utils.hideKeyboard(context); Utils.hideKeyboard(context);
if (_formKey.currentState.validate()) if (_formKey.currentState!.validate()) model.searchProducts(productName: textController.text);
model.searchProducts(productName: textController.text);
} }
} }

@ -17,8 +17,8 @@ import 'package:provider/provider.dart';
class SubCategoriseModalsheet extends StatefulWidget { class SubCategoriseModalsheet extends StatefulWidget {
String id; String? id;
String titleName; String? titleName;
SubCategoriseModalsheet({this.id, this.titleName}); SubCategoriseModalsheet({this.id, this.titleName});
@override @override
@ -27,8 +27,8 @@ class SubCategoriseModalsheet extends StatefulWidget {
} }
class _SubCategoriseModalsheetState extends State<SubCategoriseModalsheet> { class _SubCategoriseModalsheetState extends State<SubCategoriseModalsheet> {
String id; String? id;
String titleName; String? titleName;
// List<CategoriseParentModel> categoriesList = []; // List<CategoriseParentModel> categoriesList = [];
_SubCategoriseModalsheetState({this.id, this.titleName}); _SubCategoriseModalsheetState({this.id, this.titleName});

File diff suppressed because it is too large Load Diff

@ -38,9 +38,6 @@ class CalendarUtils {
else else
_currentLocation = getLocation('Asia/Riyadh'); _currentLocation = getLocation('Asia/Riyadh');
scheduleDateTime!.forEach((element) {
Future createOrUpdateEvents({List<DateTime>? scheduleList, String? title, String? description, List<DateTime>? scheduleDateTime, List<DayOfWeek>? daysOfWeek}) async {
List<Event> events =[];
scheduleDateTime!.forEach((element) { scheduleDateTime!.forEach((element) {
RecurrenceRule recurrenceRule = RecurrenceRule( RecurrenceRule recurrenceRule = RecurrenceRule(
RecurrenceFrequency.Daily, RecurrenceFrequency.Daily,

@ -29,6 +29,7 @@ import 'package:diplomaticquarterapp/widgets/pharmacy/bottom_nav_pharmacy_bar.da
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.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:provider/provider.dart'; import 'package:provider/provider.dart';
@ -75,7 +76,7 @@ class AppScaffold extends StatefulWidget {
final int? dropdownIndexValue; final int? dropdownIndexValue;
List<String>? dropDownList; List<String>? dropDownList;
final void Function(int?)? dropDownIndexChange; final void Function(int?)? dropDownIndexChange;
VoidCallbackAction()? onTap; VoidCallbackAction? onTap;
final bool isMainPharmacyPages; final bool isMainPharmacyPages;
final bool extendBody; final bool extendBody;
final ValueChanged<int>? changeCurrentTab; final ValueChanged<int>? changeCurrentTab;

Loading…
Cancel
Save