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