sub Categorise fixed

merge-update-with-lab-changes
hussam al-habibeh 4 years ago
parent d7b32df024
commit 300668cc81

@ -5,6 +5,8 @@ import 'package:diplomaticquarterapp/core/model/pharmacy/pharmacy_categorise.dar
import 'package:diplomaticquarterapp/core/model/pharmacy/scan_qr_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacy/scan_qr_model.dart';
import 'package:diplomaticquarterapp/core/service/pharmacy_categorise_service.dart'; import 'package:diplomaticquarterapp/core/service/pharmacy_categorise_service.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';
@ -97,23 +99,29 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getCategoriseParent({String i, int pageIndex, bool isLoading}) async { Future getCategoriseParent(
{String i, int pageIndex, bool isLoading, BuildContext context}) async {
hasError = false; hasError = false;
// _insuranceCardService.clearInsuranceCard(); // _insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
// GifLoaderDialogUtils.showMyDialog(context);
await _pharmacyCategoriseService.getCategoriseParent(id: i); await _pharmacyCategoriseService.getCategoriseParent(id: i);
if (_pharmacyCategoriseService.hasError) { if (_pharmacyCategoriseService.hasError) {
error = _pharmacyCategoriseService.error; error = _pharmacyCategoriseService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else
await getBrands(id: i); await getBrands(id: i);
await getParentProducts(i: i, pageIndex: pageIndex, isLoading: isLoading); await getParentProducts(
i: i, pageIndex: pageIndex, isLoading: isLoading, context: context);
// GifLoaderDialogUtils.showMyDialog(context);
} }
Future getParentProducts({String i, int pageIndex, bool isLoading}) async { Future getParentProducts(
{String i, int pageIndex, bool isLoading, BuildContext context}) async {
hasError = false; hasError = false;
// _insuranceCardService.clearInsuranceCard(); // _insuranceCardService.clearInsuranceCard();
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
//GifLoaderDialogUtils.showMyDialog(context);
await _pharmacyCategoriseService.getParentProducts( await _pharmacyCategoriseService.getParentProducts(
id: i, pageNumber: pageIndex, isLoading: isLoading); id: i, pageNumber: pageIndex, isLoading: isLoading);
if (_pharmacyCategoriseService.hasError) { if (_pharmacyCategoriseService.hasError) {
@ -121,6 +129,7 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
//GifLoaderDialogUtils.hideDialog(context);
} }
Future getSubCategorise({String i}) async { Future getSubCategorise({String i}) async {

@ -14,6 +14,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/Loader/gif_loader_container.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
@ -80,7 +81,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
ProjectViewModel projectProvider = Provider.of(context); ProjectViewModel projectProvider = Provider.of(context);
return BaseView<PharmacyCategoriseViewModel>( return BaseView<PharmacyCategoriseViewModel>(
onModelReady: (model) => model.getCategoriseParent( onModelReady: (model) => model.getCategoriseParent(
i: id, pageIndex: pageIndex, isLoading: false), i: id, pageIndex: pageIndex, isLoading: false, context: context),
allowAny: true, allowAny: true,
builder: builder:
(BuildContext context, PharmacyCategoriseViewModel model, (BuildContext context, PharmacyCategoriseViewModel model,
@ -102,7 +103,10 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
++pageIndex; ++pageIndex;
}); });
await model.getParentProducts( await model.getParentProducts(
pageIndex: pageIndex, i: id, isLoading: true); pageIndex: pageIndex,
i: id,
isLoading: true,
context: context);
if (model.state != ViewState.BusyLocal && if (model.state != ViewState.BusyLocal &&
pageIndex < 5) { pageIndex < 5) {
controller.loadComplete(); controller.loadComplete();
@ -685,8 +689,10 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
), ),
model.parentProducts.isNotEmpty model.parentProducts.isNotEmpty
? styleOne == true ? styleOne == true
? model.state != ViewState.BusyLocal
? Container( ? Container(
height: model.parentProducts.length * height:
model.parentProducts.length *
MediaQuery.of(context) MediaQuery.of(context)
.size .size
.height * .height *
@ -703,7 +709,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
), ),
itemCount: itemCount:
model.parentProducts.length, model.parentProducts.length,
itemBuilder: (BuildContext context, itemBuilder:
(BuildContext context,
int index) { int index) {
return NetworkBaseView( return NetworkBaseView(
baseViewModel: model, baseViewModel: model,
@ -714,33 +721,34 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
index] index]
.discountName != .discountName !=
null null
? Color(0xffFFFF00) ? Color(
0xffFFFF00)
: Colors.white, : Colors.white,
elevation: 0, elevation: 0,
shape: Border( shape: Border(
right: BorderSide( right: BorderSide(
color: Colors color: Colors.grey
.grey.shade300, .shade300,
width: 1, width: 1,
), ),
left: BorderSide( left: BorderSide(
color: Colors color: Colors.grey
.grey.shade300, .shade300,
width: 1, width: 1,
), ),
bottom: BorderSide( bottom: BorderSide(
color: Colors color: Colors.grey
.grey.shade300, .shade300,
width: 1, width: 1,
), ),
top: BorderSide( top: BorderSide(
color: Colors color: Colors.grey
.grey.shade300, .shade300,
width: 1, width: 1,
), ),
), ),
margin: margin: EdgeInsets
EdgeInsets.symmetric( .symmetric(
horizontal: 8, horizontal: 8,
vertical: 4, vertical: 4,
), ),
@ -748,16 +756,19 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
decoration: decoration:
BoxDecoration( BoxDecoration(
borderRadius: borderRadius:
BorderRadius.only( BorderRadius
topLeft: .only(
Radius.circular( topLeft: Radius
.circular(
110.0), 110.0),
), ),
color: Colors.white, color:
Colors.white,
), ),
padding: EdgeInsets padding: EdgeInsets
.symmetric( .symmetric(
horizontal: 0), horizontal:
0),
width: MediaQuery.of( width: MediaQuery.of(
context) context)
.size .size
@ -771,8 +782,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Stack( Stack(
children: [ children: [
if (model if (model
.parentProducts[ .parentProducts[index]
index]
.discountName != .discountName !=
null) null)
RotatedBox( RotatedBox(
@ -786,29 +796,20 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Padding( Padding(
padding: padding:
EdgeInsets.only( EdgeInsets.only(
right: right: 5.0,
5.0, top: 20.0,
top: bottom: 5.0,
20.0,
bottom:
5.0,
), ),
child: child:
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).offers.toUpperCase(),
.offers color: Colors.red,
.toUpperCase(), fontSize: 13.0,
color: fontWeight: FontWeight.w900,
Colors.red,
fontSize:
13.0,
fontWeight:
FontWeight.w900,
), ),
), ),
transform: transform:
new Matrix4.rotationZ( new Matrix4.rotationZ(5.837200),
5.837200),
), ),
), ),
Container( Container(
@ -823,19 +824,13 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
.center, .center,
child: Image child: Image
.network( .network(
model model.parentProducts[index].images.isNotEmpty
.parentProducts[ ? model.parentProducts[index].images[0].thumb
index]
.images
.isNotEmpty
? 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 fit: BoxFit
.cover, .cover,
height: 80, height:
80,
), ),
), ),
// Container( // Container(
@ -892,7 +887,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Container( Container(
margin: EdgeInsets margin: EdgeInsets
.symmetric( .symmetric(
horizontal: 6, horizontal:
6,
vertical: 0, vertical: 0,
), ),
child: Column( child: Column(
@ -901,58 +897,45 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
.start, .start,
children: [ children: [
if (model if (model
.parentProducts[ .parentProducts[index]
index]
.discountName != .discountName !=
null) null)
Container( Container(
width: double width:
.infinity, double.infinity,
height: height:
13.0, 13.0,
decoration: decoration:
BoxDecoration( BoxDecoration(
color: Color( color:
0xff5AB145), Color(0xff5AB145),
), ),
child: child:
Center( Center(
child: child:
Texts( Texts(
model model.parentProducts[index].discountName,
.parentProducts[index] regular: true,
.discountName, color: Colors.white,
regular: fontSize: 10.4,
true,
color:
Colors.white,
fontSize:
10.4,
), ),
), ),
), ),
Texts( Texts(
projectViewModel projectViewModel.isArabic
.isArabic ? model.parentProducts[index].namen
? model : model.parentProducts[index].name,
.parentProducts[
index]
.namen
: model
.parentProducts[index]
.name,
regular: regular:
true, true,
fontSize: fontSize:
12, 12,
fontWeight: fontWeight:
FontWeight FontWeight.w700,
.w700,
), ),
Padding( Padding(
padding: const EdgeInsets padding: const EdgeInsets.only(
.only( top:
top: 4, 4,
bottom: bottom:
4), 4),
child: child:
@ -973,10 +956,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
// forceStars: true), // forceStars: true),
RatingBar RatingBar
.readOnly( .readOnly(
initialRating: model initialRating:
.parentProducts[index] model.parentProducts[index].approvedRatingSum.toDouble(),
.approvedRatingSum
.toDouble(),
size: size:
15.0, 15.0,
filledColor: filledColor:
@ -1024,7 +1005,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
), ),
) )
: Container( : Container(
height: model.parentProducts.length * height:
model.parentProducts.length *
MediaQuery.of(context) MediaQuery.of(context)
.size .size
.height * .height *
@ -1032,8 +1014,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
child: ListView.builder( child: ListView.builder(
physics: physics:
NeverScrollableScrollPhysics(), NeverScrollableScrollPhysics(),
itemCount: itemCount: model
model.parentProducts.length, .parentProducts.length,
itemBuilder: itemBuilder:
(BuildContext context, (BuildContext context,
int index) { int index) {
@ -1051,10 +1033,11 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
child: child:
Padding( Padding(
padding: padding:
EdgeInsets EdgeInsets.only(
.only( left:
left: 9.0, 9.0,
top: 8.0, top:
8.0,
right: right:
10.0, 10.0,
), ),
@ -1077,18 +1060,12 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
.isNotEmpty .isNotEmpty
? Image ? Image
.network( .network(
model model.parentProducts[index].images[0].thumb,
.parentProducts[index] fit: BoxFit.contain,
.images[0] height: 70,
.thumb,
fit: BoxFit
.contain,
height:
70,
) )
: Text(TranslationBase.of( : Text(
context) TranslationBase.of(context).noImage),
.noImage),
), ),
], ],
), ),
@ -1097,41 +1074,30 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Container( Container(
width: model.parentProducts[index].rxMessage != width: model.parentProducts[index].rxMessage !=
null null
? MediaQuery.of(context) ? MediaQuery.of(context).size.width /
.size
.width /
5.3 5.3
: 0, : 0,
padding: padding:
EdgeInsets EdgeInsets.all(
.all(
4), 4),
decoration: decoration:
BoxDecoration( BoxDecoration(
color: Color( color: Color(
0xffb23838), 0xffb23838),
borderRadius: borderRadius:
BorderRadius.only( BorderRadius.only(topLeft: Radius.circular(6)),
topLeft:
Radius.circular(6)),
), ),
child: model.parentProducts[index] child: model.parentProducts[index].rxMessage !=
.rxMessage !=
null null
? Texts( ? Texts(
projectProvider.isArabic projectProvider.isArabic ? model.parentProducts[index].rxMessagen : model.parentProducts[index].rxMessage,
? model.parentProducts[index].rxMessagen color: Colors.white,
: model.parentProducts[index].rxMessage, regular: true,
color: fontSize: 10,
Colors.white, fontWeight: FontWeight.w400,
regular:
true,
fontSize:
10,
fontWeight:
FontWeight.w400,
) )
: Texts(""), : Texts(
""),
// Texts( // Texts(
// model.parentProducts[index].rxMessage != null ? model.parentProducts[index].rxMessage : "", // model.parentProducts[index].rxMessage != null ? model.parentProducts[index].rxMessage : "",
// color: Colors.white, // color: Colors.white,
@ -1162,12 +1128,12 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
height: 4.0, height: 4.0,
), ),
Container( Container(
width: MediaQuery.of( width: MediaQuery.of(context)
context)
.size .size
.width * .width *
0.635, 0.635,
child: Texts( child:
Texts(
projectViewModel projectViewModel
.isArabic .isArabic
? model ? model
@ -1175,32 +1141,35 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
index] index]
.namen .namen
: model : model
.parentProducts[ .parentProducts[index]
index]
.name, .name,
regular: true, regular:
true,
fontSize: fontSize:
13.2, 13.2,
fontWeight: fontWeight:
FontWeight FontWeight
.w500, .w500,
maxLines: 5, maxLines:
5,
), ),
), ),
SizedBox( SizedBox(
height: 8.0, height: 8.0,
), ),
Padding( Padding(
padding: padding: const EdgeInsets
const EdgeInsets
.only( .only(
top: 4, top: 4,
bottom: bottom:
4), 4),
child: Texts( child:
Texts(
"SAR ${model.parentProducts[index].price}", "SAR ${model.parentProducts[index].price}",
bold: true, bold:
fontSize: 14, true,
fontSize:
14,
), ),
), ),
Row( Row(
@ -1213,28 +1182,23 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
RatingBar RatingBar
.readOnly( .readOnly(
initialRating: model initialRating: model
.parentProducts[ .parentProducts[index]
index]
.approvedRatingSum .approvedRatingSum
.toDouble(), .toDouble(),
size: 15.0, size:
15.0,
filledColor: filledColor:
Colors.yellow[ Colors.yellow[700],
700],
emptyColor: emptyColor:
Colors.grey[ Colors.grey[500],
500],
isHalfAllowed: isHalfAllowed:
true, true,
halfFilledIcon: halfFilledIcon:
Icons Icons.star_half,
.star_half,
filledIcon: filledIcon:
Icons Icons.star,
.star,
emptyIcon: emptyIcon:
Icons Icons.star,
.star,
), ),
Texts( Texts(
"(${model.parentProducts[index].approvedTotalReviews})", "(${model.parentProducts[index].approvedTotalReviews})",
@ -1243,8 +1207,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
fontSize: fontSize:
10, 10,
fontWeight: fontWeight:
FontWeight FontWeight.w400,
.w400,
) )
], ],
), ),
@ -1254,10 +1217,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
widget.authenticatedUserObject widget.authenticatedUserObject
.isLogin .isLogin
? Container( ? Container(
child: child: IconButton(
IconButton( icon: Icon(
icon:
Icon(
Icons Icons
.shopping_cart, .shopping_cart,
size: size:
@ -1265,8 +1226,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
color: color:
CustomColors.green, CustomColors.green,
), ),
onPressed: onPressed: () async {
() async {
if (model.parentProducts[index].rxMessage == if (model.parentProducts[index].rxMessage ==
null) { null) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
@ -1305,7 +1265,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
children: [ children: [
Padding( Padding(
padding: padding:
const EdgeInsets.all(8.0), const EdgeInsets.all(
8.0),
child: Image.asset( child: Image.asset(
'assets/images/new-design/empty_box.png', 'assets/images/new-design/empty_box.png',
width: 100, width: 100,
@ -1315,13 +1276,15 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
), ),
Padding( Padding(
padding: padding:
const EdgeInsets.all(8.0), const EdgeInsets.all(
8.0),
child: Text( child: Text(
TranslationBase.of(context) TranslationBase.of(
context)
.noData, .noData,
// 'There is no data', // 'There is no data',
style: style: TextStyle(
TextStyle(fontSize: 30), fontSize: 30),
), ),
) )
], ],
@ -1329,6 +1292,15 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
), ),
), ),
) )
: Center(
child: CircularProgressIndicator(
backgroundColor: Colors.white,
valueColor:
AlwaysStoppedAnimation<Color>(
Colors.grey[500],
),
),
)
], ],
), ),
), ),

@ -77,8 +77,10 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.white, backgroundColor: Colors.white,
isShowDecPage: false, isShowDecPage: false,
//baseViewModel: model,
body: NetworkBaseView(
baseViewModel: model, baseViewModel: model,
body: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -144,11 +146,13 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
itemCount: itemCount:
model.subCategorise.length, model.subCategorise.length,
itemBuilder: (BuildContext context, itemBuilder:
(BuildContext context,
int index) { int index) {
return Container( return Container(
child: Padding( child: Padding(
padding: EdgeInsets.all(8.0), padding:
EdgeInsets.all(8.0),
child: InkWell( child: InkWell(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
@ -170,7 +174,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
), ),
Divider( Divider(
thickness: 0.6, thickness: 0.6,
color: Colors.black12, color:
Colors.black12,
) )
], ],
), ),
@ -214,7 +219,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemCount: model.subCategorise.length, itemCount: model.subCategorise.length,
itemBuilder: (BuildContext context, int index) { itemBuilder:
(BuildContext context, int index) {
return Padding( return Padding(
padding: padding:
EdgeInsets.symmetric(horizontal: 8.0), EdgeInsets.symmetric(horizontal: 8.0),
@ -254,9 +260,11 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
child: Center( child: Center(
child: Texts( child: Texts(
projectViewModel.isArabic projectViewModel.isArabic
? model.subCategorise[index] ? model
.subCategorise[index]
.namen .namen
: model.subCategorise[index] : model
.subCategorise[index]
.name, .name,
// model.subCategorise[index].name, // model.subCategorise[index].name,
fontSize: 14, fontSize: 14,
@ -272,7 +280,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
context, context,
FadePage( FadePage(
page: FinalProductsPage( page: FinalProductsPage(
id: model.subCategorise[index].id, id: model
.subCategorise[index].id,
), ),
), ),
); );
@ -317,7 +326,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
maxChildSize: 0.95, maxChildSize: 0.95,
minChildSize: 0.9, minChildSize: 0.9,
builder: (BuildContext context, builder: (BuildContext context,
ScrollController scrollController) { ScrollController
scrollController) {
return SingleChildScrollView( return SingleChildScrollView(
controller: scrollController, controller: scrollController,
child: Container( child: Container(
@ -358,7 +368,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
// 'Close', // 'Close',
color: Colors.red, color: Colors.red,
fontWeight: fontWeight:
FontWeight.w600, FontWeight
.w600,
fontSize: 15.0, fontSize: 15.0,
), ),
onTap: () { onTap: () {
@ -546,14 +557,16 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
), ),
Padding( Padding(
padding: padding:
EdgeInsets.all(8.0), EdgeInsets.all(
8.0),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment MainAxisAlignment
.spaceEvenly, .spaceEvenly,
children: [ children: [
Expanded( Expanded(
child: Container( child:
Container(
width: 100, width: 100,
child: Button( child: Button(
label: TranslationBase.of( label: TranslationBase.of(
@ -582,8 +595,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
if (categoriesId == if (categoriesId ==
"") { "") {
categoriesId = categoriesId =
category category.id;
.id;
} else { } else {
categoriesId = categoriesId =
"$categoriesId,${category.id}"; "$categoriesId,${category.id}";
@ -597,8 +609,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
if (brandIds == if (brandIds ==
"") { "") {
brandIds = brandIds =
brand brand.id;
.id;
} else { } else {
brandIds = brandIds =
"$brandIds,${brand.id}"; "$brandIds,${brand.id}";
@ -713,9 +724,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
itemCount: model.subProducts.length, itemCount: model.subProducts.length,
itemBuilder: itemBuilder:
(BuildContext context, int index) { (BuildContext context, int index) {
return NetworkBaseView( return InkWell(
baseViewModel: model,
child: InkWell(
child: Card( child: Card(
color: model.subProducts[index] color: model.subProducts[index]
.discountName != .discountName !=
@ -747,8 +756,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
), ),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.only(
BorderRadius.only(
topLeft: topLeft:
Radius.circular(110.0), Radius.circular(110.0),
), ),
@ -767,8 +775,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
Stack( Stack(
children: [ children: [
Container( Container(
margin: EdgeInsets margin:
.fromLTRB( EdgeInsets.fromLTRB(
0, 16, 0, 0), 0, 16, 0, 0),
alignment: alignment:
Alignment.center, Alignment.center,
@ -804,8 +812,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
EdgeInsets.all(4), EdgeInsets.all(4),
decoration: decoration:
BoxDecoration( BoxDecoration(
color: Color( color:
0xffb23838), Color(0xffb23838),
borderRadius: borderRadius:
BorderRadius.only( BorderRadius.only(
topLeft: Radius topLeft: Radius
@ -894,8 +902,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
// ? (model.subProducts[index].approvedRatingSum.toDouble() / model.subProducts[index].approvedRatingSum.toDouble()).toDouble() // ? (model.subProducts[index].approvedRatingSum.toDouble() / model.subProducts[index].approvedRatingSum.toDouble()).toDouble()
// : 0, // : 0,
// forceStars: true), // forceStars: true),
RatingBar RatingBar.readOnly(
.readOnly(
initialRating: model initialRating: model
.subProducts[ .subProducts[
index] index]
@ -905,9 +912,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
filledColor: filledColor:
Colors.yellow[ Colors.yellow[
700], 700],
emptyColor: emptyColor: Colors
Colors.grey[ .grey[500],
500],
isHalfAllowed: isHalfAllowed:
true, true,
halfFilledIcon: halfFilledIcon:
@ -940,11 +946,10 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
context, context,
FadePage( FadePage(
page: ProductDetailPage( page: ProductDetailPage(
model.subProducts[ model.subProducts[index]),
index]),
)), )),
}, },
)); );
}, },
), ),
) )
@ -970,7 +975,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
BoxDecoration(), BoxDecoration(),
child: Padding( child: Padding(
padding: padding:
EdgeInsets.only( EdgeInsets
.only(
left: 9.0, left: 9.0,
top: 8.0, top: 8.0,
right: 10.0, right: 10.0,
@ -981,8 +987,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
margin: EdgeInsets margin: EdgeInsets
.fromLTRB( .fromLTRB(
0, 0, 0, 0), 0, 0, 0, 0),
alignment: alignment: Alignment
Alignment.center, .center,
child: model child: model
.subProducts[ .subProducts[
index] index]
@ -992,14 +998,15 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
model model
.subProducts[ .subProducts[
index] index]
.images[0] .images[
0]
.thumb, .thumb,
fit: BoxFit fit: BoxFit
.contain, .contain,
height: 70, height: 70,
) )
: Text(TranslationBase : Text(TranslationBase.of(
.of(context) context)
.noImage), .noImage),
), ),
], ],
@ -1019,13 +1026,13 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
5.3 5.3
: 0, : 0,
padding: padding:
EdgeInsets.all(4), EdgeInsets.all(
4),
decoration: decoration:
BoxDecoration( BoxDecoration(
color: Color( color: Color(
0xffb23838), 0xffb23838),
borderRadius: borderRadius: BorderRadius.only(
BorderRadius.only(
topLeft: Radius topLeft: Radius
.circular( .circular(
6)), 6)),
@ -1043,13 +1050,14 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
index] index]
.rxMessagen .rxMessagen
: model : model
.subProducts[ .subProducts[index]
index]
.rxMessage, .rxMessage,
color: Colors color: Colors
.white, .white,
regular: true, regular:
fontSize: 10, true,
fontSize:
10,
fontWeight: fontWeight:
FontWeight FontWeight
.w400, .w400,
@ -1069,7 +1077,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
), ),
Container( Container(
height: 130.0, height: 130.0,
margin: EdgeInsets.symmetric( margin:
EdgeInsets.symmetric(
horizontal: 0, horizontal: 0,
vertical: 0, vertical: 0,
), ),
@ -1138,13 +1147,16 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
.approvedRatingSum .approvedRatingSum
.toDouble(), .toDouble(),
size: 15.0, size: 15.0,
filledColor: Colors filledColor:
.yellow[700], Colors.yellow[
700],
emptyColor: Colors emptyColor: Colors
.grey[500], .grey[500],
isHalfAllowed: true, isHalfAllowed:
true,
halfFilledIcon: halfFilledIcon:
Icons.star_half, Icons
.star_half,
filledIcon: filledIcon:
Icons.star, Icons.star,
emptyIcon: emptyIcon:
@ -1155,7 +1167,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
regular: true, regular: true,
fontSize: 10, fontSize: 10,
fontWeight: fontWeight:
FontWeight.w400, FontWeight
.w400,
) )
], ],
), ),
@ -1212,7 +1225,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
context, context,
FadePage( FadePage(
page: ProductDetailPage( page: ProductDetailPage(
model.subProducts[index]), model.subProducts[
index]),
)), )),
}, },
); );
@ -1223,7 +1237,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
child: Container( child: Container(
child: Center( child: Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment:
MainAxisAlignment.center,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
@ -1250,6 +1265,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
), ),
), ),
), ),
),
)); ));
} }

Loading…
Cancel
Save