|
|
|
@ -19,35 +19,33 @@ import 'package:diplomaticquarterapp/widgets/others/entity_checkbox_list.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:pull_to_refresh/pull_to_refresh.dart';
|
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
|
|
|
import 'package:rating_bar/rating_bar.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart' as utils;
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart' as utils ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import 'base/base_view.dart';
|
|
|
|
import 'base/base_view.dart';
|
|
|
|
import 'final_products_page.dart';
|
|
|
|
import 'final_products_page.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class SubCategorisePage extends StatefulWidget {
|
|
|
|
class SubCategorisePage extends StatefulWidget {
|
|
|
|
String id;
|
|
|
|
String? id;
|
|
|
|
String title;
|
|
|
|
String? title;
|
|
|
|
String parentId;
|
|
|
|
String? parentId;
|
|
|
|
|
|
|
|
|
|
|
|
AuthenticatedUserObject authenticatedUserObject =
|
|
|
|
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
|
|
|
|
locator<AuthenticatedUserObject>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SubCategorisePage({this.id, this.parentId, this.title});
|
|
|
|
SubCategorisePage({this.id, this.parentId, this.title});
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
_SubCategorisePageState createState() =>
|
|
|
|
_SubCategorisePageState createState() => _SubCategorisePageState(id: id, title: title, parentId: parentId);
|
|
|
|
_SubCategorisePageState(id: id, title: title, parentId: parentId);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
bool checkedBrands = false;
|
|
|
|
bool checkedBrands = false;
|
|
|
|
bool checkedCategorise = false;
|
|
|
|
bool checkedCategorise = false;
|
|
|
|
String id;
|
|
|
|
String? id;
|
|
|
|
String title;
|
|
|
|
String? title;
|
|
|
|
String parentId;
|
|
|
|
String? parentId;
|
|
|
|
|
|
|
|
|
|
|
|
_SubCategorisePageState({this.title, this.parentId, this.id});
|
|
|
|
_SubCategorisePageState({this.title, this.parentId, this.id});
|
|
|
|
|
|
|
|
|
|
|
|
@ -63,8 +61,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
int pageIndex = 1;
|
|
|
|
int pageIndex = 1;
|
|
|
|
|
|
|
|
|
|
|
|
RefreshController controller = RefreshController();
|
|
|
|
RefreshController controller = RefreshController();
|
|
|
|
List<CategoriseParentModel> entityList =[];
|
|
|
|
List<CategoriseParentModel> entityList = [];
|
|
|
|
List<CategoriseParentModel> entityListBrands =[];
|
|
|
|
List<CategoriseParentModel> entityListBrands = [];
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
@ -73,14 +71,11 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
ProjectViewModel projectProvider = Provider.of(context);
|
|
|
|
ProjectViewModel projectProvider = Provider.of(context);
|
|
|
|
return BaseView<PharmacyCategoriseViewModel>(
|
|
|
|
return BaseView<PharmacyCategoriseViewModel>(
|
|
|
|
onModelReady: (model) => model.getSubCategorise(
|
|
|
|
onModelReady: (model) => model.getSubCategorise(i: id, pageIndex: pageIndex, isLoading: false, context: context),
|
|
|
|
i: id, pageIndex: pageIndex, isLoading: false, context: context),
|
|
|
|
|
|
|
|
allowAny: true,
|
|
|
|
allowAny: true,
|
|
|
|
builder: (BuildContext context, PharmacyCategoriseViewModel model,
|
|
|
|
builder: (BuildContext context, PharmacyCategoriseViewModel model, Widget? child) => AppScaffold(
|
|
|
|
Widget child) =>
|
|
|
|
|
|
|
|
AppScaffold(
|
|
|
|
|
|
|
|
isPharmacy: true,
|
|
|
|
isPharmacy: true,
|
|
|
|
appBarTitle: title,
|
|
|
|
appBarTitle: title!,
|
|
|
|
isBottomBar: true,
|
|
|
|
isBottomBar: true,
|
|
|
|
isShowAppBar: true,
|
|
|
|
isShowAppBar: true,
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
@ -96,11 +91,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
++pageIndex;
|
|
|
|
++pageIndex;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
await model.getSubProducts(
|
|
|
|
await model.getSubProducts(pageIndex: pageIndex, i: id, isLoading: true, context: context);
|
|
|
|
pageIndex: pageIndex,
|
|
|
|
|
|
|
|
i: id,
|
|
|
|
|
|
|
|
isLoading: true,
|
|
|
|
|
|
|
|
context: context);
|
|
|
|
|
|
|
|
if (model.state != ViewState.BusyLocal && pageIndex < 5) {
|
|
|
|
if (model.state != ViewState.BusyLocal && pageIndex < 5) {
|
|
|
|
controller.loadComplete();
|
|
|
|
controller.loadComplete();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -132,8 +123,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089195_diet-nutrition_2.png'
|
|
|
|
? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089195_diet-nutrition_2.png'
|
|
|
|
: parentId == '9'
|
|
|
|
: parentId == '9'
|
|
|
|
? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089196_household_2.png'
|
|
|
|
? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089196_household_2.png'
|
|
|
|
: parentId ==
|
|
|
|
: parentId == '10'
|
|
|
|
'10'
|
|
|
|
|
|
|
|
? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089197_home-care-appliances_2.png'
|
|
|
|
? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089197_home-care-appliances_2.png'
|
|
|
|
: '',
|
|
|
|
: '',
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
@ -145,14 +135,12 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
InkWell(
|
|
|
|
InkWell(
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.all(10.0),
|
|
|
|
padding: EdgeInsets.all(10.0),
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
child: Texts(TranslationBase.of(context)
|
|
|
|
child: Texts(TranslationBase.of(context).viewSubCategorise),
|
|
|
|
.viewSubCategorise),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Icon(Icons.arrow_forward)
|
|
|
|
Icon(Icons.arrow_forward)
|
|
|
|
@ -164,45 +152,27 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
height:
|
|
|
|
height: MediaQuery.of(context).size.height * 0.89,
|
|
|
|
MediaQuery.of(context).size.height *
|
|
|
|
|
|
|
|
0.89,
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
child: Center(
|
|
|
|
child: Center(
|
|
|
|
child: ListView.builder(
|
|
|
|
child: ListView.builder(
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
itemCount:
|
|
|
|
itemCount: model.subCategorise.length,
|
|
|
|
model.subCategorise.length,
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
itemBuilder:
|
|
|
|
|
|
|
|
(BuildContext context,
|
|
|
|
|
|
|
|
int index) {
|
|
|
|
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding:
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
EdgeInsets.all(8.0),
|
|
|
|
|
|
|
|
child: InkWell(
|
|
|
|
child: InkWell(
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment:
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
|
|
|
.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
projectViewModel
|
|
|
|
projectViewModel.isArabic ? model.subCategorise[index].namen : model.subCategorise[index].name,
|
|
|
|
.isArabic
|
|
|
|
|
|
|
|
? model
|
|
|
|
|
|
|
|
.subCategorise[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.namen
|
|
|
|
|
|
|
|
: model
|
|
|
|
|
|
|
|
.subCategorise[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.name,
|
|
|
|
|
|
|
|
// model.subCategorise[index].name
|
|
|
|
// model.subCategorise[index].name
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Divider(
|
|
|
|
Divider(
|
|
|
|
thickness: 0.6,
|
|
|
|
thickness: 0.6,
|
|
|
|
color:
|
|
|
|
color: Colors.black12,
|
|
|
|
Colors.black12,
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -210,12 +180,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
Navigator.push(
|
|
|
|
Navigator.push(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
FadePage(
|
|
|
|
FadePage(
|
|
|
|
page:
|
|
|
|
page: FinalProductsPage(
|
|
|
|
FinalProductsPage(
|
|
|
|
id: model.subCategorise[index].id!,
|
|
|
|
id: model
|
|
|
|
|
|
|
|
.subCategorise[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.id,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -246,26 +212,21 @@ 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:
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
(BuildContext context, int index) {
|
|
|
|
|
|
|
|
return Padding(
|
|
|
|
return Padding(
|
|
|
|
padding:
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 8.0),
|
|
|
|
EdgeInsets.symmetric(horizontal: 8.0),
|
|
|
|
|
|
|
|
child: InkWell(
|
|
|
|
child: InkWell(
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment:
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
CrossAxisAlignment.center,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 13.0),
|
|
|
|
horizontal: 13.0),
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
height: 60.0,
|
|
|
|
height: 60.0,
|
|
|
|
width: 65.0,
|
|
|
|
width: 65.0,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
color: Colors.orange.shade200
|
|
|
|
color: Colors.orange.shade200.withOpacity(0.45),
|
|
|
|
.withOpacity(0.45),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Center(
|
|
|
|
child: Center(
|
|
|
|
child: Icon(
|
|
|
|
child: Icon(
|
|
|
|
@ -276,23 +237,11 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width: MediaQuery.of(context)
|
|
|
|
width: MediaQuery.of(context).size.width * 0.17,
|
|
|
|
.size
|
|
|
|
height: MediaQuery.of(context).size.height * 0.10,
|
|
|
|
.width *
|
|
|
|
|
|
|
|
0.17,
|
|
|
|
|
|
|
|
height: MediaQuery.of(context)
|
|
|
|
|
|
|
|
.size
|
|
|
|
|
|
|
|
.height *
|
|
|
|
|
|
|
|
0.10,
|
|
|
|
|
|
|
|
child: Center(
|
|
|
|
child: Center(
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
projectViewModel.isArabic
|
|
|
|
projectViewModel.isArabic ? model.subCategorise[index].namen : model.subCategorise[index].name,
|
|
|
|
? model
|
|
|
|
|
|
|
|
.subCategorise[index]
|
|
|
|
|
|
|
|
.namen
|
|
|
|
|
|
|
|
: model
|
|
|
|
|
|
|
|
.subCategorise[index]
|
|
|
|
|
|
|
|
.name,
|
|
|
|
|
|
|
|
// model.subCategorise[index].name,
|
|
|
|
// model.subCategorise[index].name,
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
@ -307,8 +256,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
FadePage(
|
|
|
|
FadePage(
|
|
|
|
page: FinalProductsPage(
|
|
|
|
page: FinalProductsPage(
|
|
|
|
id: model
|
|
|
|
id: model.subCategorise[index].id!,
|
|
|
|
.subCategorise[index].id,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -352,22 +300,16 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
initialChildSize: 0.95,
|
|
|
|
initialChildSize: 0.95,
|
|
|
|
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(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
height: MediaQuery.of(context)
|
|
|
|
height: MediaQuery.of(context).size.height * 1.95,
|
|
|
|
.size
|
|
|
|
|
|
|
|
.height *
|
|
|
|
|
|
|
|
1.95,
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding:
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
EdgeInsets.all(8.0),
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Icon(
|
|
|
|
Icon(
|
|
|
|
@ -377,31 +319,23 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
width: 10.0,
|
|
|
|
width: 10.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
TranslationBase.of(
|
|
|
|
TranslationBase.of(context).refine,
|
|
|
|
context)
|
|
|
|
|
|
|
|
.refine,
|
|
|
|
|
|
|
|
// 'Refine',
|
|
|
|
// 'Refine',
|
|
|
|
fontWeight:
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
FontWeight.w600,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
width: 250.0,
|
|
|
|
width: 250.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
InkWell(
|
|
|
|
InkWell(
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
TranslationBase.of(
|
|
|
|
TranslationBase.of(context).closeIt,
|
|
|
|
context)
|
|
|
|
|
|
|
|
.closeIt,
|
|
|
|
|
|
|
|
// 'Close',
|
|
|
|
// 'Close',
|
|
|
|
color: Colors.red,
|
|
|
|
color: Colors.red,
|
|
|
|
fontWeight:
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
FontWeight
|
|
|
|
|
|
|
|
.w600,
|
|
|
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
fontSize: 15.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
Navigator.pop(
|
|
|
|
Navigator.pop(context);
|
|
|
|
context);
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -414,39 +348,22 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
ExpansionTile(
|
|
|
|
ExpansionTile(
|
|
|
|
title: Texts(
|
|
|
|
title: Texts(TranslationBase.of(context).subGroup),
|
|
|
|
TranslationBase.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.subGroup),
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
ProcedureListWidget(
|
|
|
|
ProcedureListWidget(
|
|
|
|
model: model,
|
|
|
|
model: model,
|
|
|
|
masterList: model
|
|
|
|
masterList: model.subCategorise,
|
|
|
|
.subCategorise,
|
|
|
|
removeHistory: (item) {
|
|
|
|
removeHistory:
|
|
|
|
|
|
|
|
(item) {
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
entityList
|
|
|
|
entityList.remove(item);
|
|
|
|
.remove(
|
|
|
|
|
|
|
|
item);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
addHistory:
|
|
|
|
addHistory: (history) {
|
|
|
|
(history) {
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
entityList.add(
|
|
|
|
entityList.add(history);
|
|
|
|
history);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
addSelectedHistories:
|
|
|
|
isEntityListSelected: (master) => isEntityListSelected(master),
|
|
|
|
() {
|
|
|
|
|
|
|
|
//TODO build your fun herr
|
|
|
|
|
|
|
|
// widget.addSelectedHistories();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
isEntityListSelected:
|
|
|
|
|
|
|
|
(master) =>
|
|
|
|
|
|
|
|
isEntityListSelected(
|
|
|
|
|
|
|
|
master),
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -455,40 +372,22 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
color: Colors.black12,
|
|
|
|
color: Colors.black12,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
ExpansionTile(
|
|
|
|
ExpansionTile(
|
|
|
|
title: Texts(
|
|
|
|
title: Texts(TranslationBase.of(context).brands),
|
|
|
|
TranslationBase.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.brands),
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
ProcedureListWidget(
|
|
|
|
ProcedureListWidget(
|
|
|
|
model: model,
|
|
|
|
model: model,
|
|
|
|
masterList: model
|
|
|
|
masterList: model.brandsList,
|
|
|
|
.brandsList,
|
|
|
|
removeHistory: (item) {
|
|
|
|
removeHistory:
|
|
|
|
|
|
|
|
(item) {
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
entityListBrands
|
|
|
|
entityListBrands.remove(item);
|
|
|
|
.remove(
|
|
|
|
|
|
|
|
item);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
addHistory:
|
|
|
|
addHistory: (history) {
|
|
|
|
(history) {
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
entityListBrands
|
|
|
|
entityListBrands.add(history);
|
|
|
|
.add(
|
|
|
|
|
|
|
|
history);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
addSelectedHistories:
|
|
|
|
isEntityListSelected: (master) => isEntityListSelectedBrands(master),
|
|
|
|
() {
|
|
|
|
|
|
|
|
//TODO build your fun herr
|
|
|
|
|
|
|
|
// widget.addSelectedHistories();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
isEntityListSelected:
|
|
|
|
|
|
|
|
(master) =>
|
|
|
|
|
|
|
|
isEntityListSelectedBrands(
|
|
|
|
|
|
|
|
master),
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -497,71 +396,43 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
color: Colors.black12,
|
|
|
|
color: Colors.black12,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
ExpansionTile(
|
|
|
|
ExpansionTile(
|
|
|
|
title: Texts(
|
|
|
|
title: Texts(TranslationBase.of(context).price),
|
|
|
|
TranslationBase.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.price),
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
color: Color(
|
|
|
|
color: Color(0xffEEEEEE),
|
|
|
|
0xffEEEEEE),
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
|
MainAxisAlignment
|
|
|
|
|
|
|
|
.spaceAround,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
mainAxisAlignment:
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
MainAxisAlignment
|
|
|
|
|
|
|
|
.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Texts(TranslationBase.of(
|
|
|
|
Texts(TranslationBase.of(context).min),
|
|
|
|
context)
|
|
|
|
|
|
|
|
.min),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
color: Colors
|
|
|
|
color: Colors.white,
|
|
|
|
.white,
|
|
|
|
width: 200,
|
|
|
|
width:
|
|
|
|
height: 40,
|
|
|
|
200,
|
|
|
|
child: TextFormField(
|
|
|
|
height:
|
|
|
|
decoration: InputDecoration(
|
|
|
|
40,
|
|
|
|
border: OutlineInputBorder(),
|
|
|
|
child:
|
|
|
|
),
|
|
|
|
TextFormField(
|
|
|
|
controller: minField,
|
|
|
|
decoration:
|
|
|
|
|
|
|
|
InputDecoration(
|
|
|
|
|
|
|
|
border:
|
|
|
|
|
|
|
|
OutlineInputBorder(),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
controller:
|
|
|
|
|
|
|
|
minField,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
mainAxisAlignment:
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
MainAxisAlignment
|
|
|
|
|
|
|
|
.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Texts(TranslationBase.of(
|
|
|
|
Texts(TranslationBase.of(context).max),
|
|
|
|
context)
|
|
|
|
|
|
|
|
.max),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
color: Colors
|
|
|
|
color: Colors.white,
|
|
|
|
.white,
|
|
|
|
width: 200,
|
|
|
|
width:
|
|
|
|
height: 40,
|
|
|
|
200,
|
|
|
|
child: TextFormField(
|
|
|
|
height:
|
|
|
|
decoration: InputDecoration(
|
|
|
|
40,
|
|
|
|
border: OutlineInputBorder(),
|
|
|
|
child:
|
|
|
|
),
|
|
|
|
TextFormField(
|
|
|
|
controller: maxField,
|
|
|
|
decoration:
|
|
|
|
|
|
|
|
InputDecoration(
|
|
|
|
|
|
|
|
border:
|
|
|
|
|
|
|
|
OutlineInputBorder(),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
controller:
|
|
|
|
|
|
|
|
maxField,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -576,33 +447,20 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
color: Colors.black12,
|
|
|
|
color: Colors.black12,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: MediaQuery.of(
|
|
|
|
height: MediaQuery.of(context).size.height * 0.4,
|
|
|
|
context)
|
|
|
|
|
|
|
|
.size
|
|
|
|
|
|
|
|
.height *
|
|
|
|
|
|
|
|
0.4,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding:
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
EdgeInsets.all(
|
|
|
|
|
|
|
|
8.0),
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
MainAxisAlignment
|
|
|
|
|
|
|
|
.spaceEvenly,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child:
|
|
|
|
child: Container(
|
|
|
|
Container(
|
|
|
|
|
|
|
|
width: 100,
|
|
|
|
width: 100,
|
|
|
|
child: Button(
|
|
|
|
child: Button(
|
|
|
|
label: TranslationBase.of(
|
|
|
|
label: TranslationBase.of(context).reset,
|
|
|
|
context)
|
|
|
|
|
|
|
|
.reset,
|
|
|
|
|
|
|
|
// 'Reset',
|
|
|
|
// 'Reset',
|
|
|
|
backgroundColor:
|
|
|
|
backgroundColor: Colors.red,
|
|
|
|
Colors
|
|
|
|
|
|
|
|
.red,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -612,69 +470,37 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width: 200,
|
|
|
|
width: 200,
|
|
|
|
child: Button(
|
|
|
|
child: Button(
|
|
|
|
onTap:
|
|
|
|
onTap: () async {
|
|
|
|
() async {
|
|
|
|
String categoriesId = "";
|
|
|
|
String
|
|
|
|
for (CategoriseParentModel category in entityList) {
|
|
|
|
categoriesId =
|
|
|
|
if (categoriesId == "") {
|
|
|
|
"";
|
|
|
|
categoriesId = category.id!;
|
|
|
|
for (CategoriseParentModel category
|
|
|
|
|
|
|
|
in entityList) {
|
|
|
|
|
|
|
|
if (categoriesId ==
|
|
|
|
|
|
|
|
"") {
|
|
|
|
|
|
|
|
categoriesId =
|
|
|
|
|
|
|
|
category.id;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
categoriesId =
|
|
|
|
categoriesId = "$categoriesId,${category.id}";
|
|
|
|
"$categoriesId,${category.id}";
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String
|
|
|
|
String brandIds = "";
|
|
|
|
brandIds =
|
|
|
|
|
|
|
|
"";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (CategoriseParentModel brand
|
|
|
|
for (CategoriseParentModel brand in entityListBrands) {
|
|
|
|
in entityListBrands) {
|
|
|
|
if (brandIds == "") {
|
|
|
|
if (brandIds ==
|
|
|
|
brandIds = brand.id!;
|
|
|
|
"") {
|
|
|
|
|
|
|
|
brandIds =
|
|
|
|
|
|
|
|
brand.id;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
brandIds =
|
|
|
|
brandIds = "$brandIds,${brand.id}";
|
|
|
|
"$brandIds,${brand.id}";
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GifLoaderDialogUtils
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
.showMyDialog(
|
|
|
|
|
|
|
|
context);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await model.getFilteredSubProducts(
|
|
|
|
await model.getFilteredSubProducts(
|
|
|
|
min: minField.text.isEmpty
|
|
|
|
min: minField.text.isEmpty ? "" : minField.text.toString(),
|
|
|
|
? ""
|
|
|
|
max: maxField.text.isEmpty ? "" : maxField.text.toString(),
|
|
|
|
: minField.text
|
|
|
|
categoryId: categoriesId,
|
|
|
|
.toString(),
|
|
|
|
brandId: brandIds.isEmpty ? "" : "&manufacturerids=" + brandIds);
|
|
|
|
max: maxField.text.isEmpty
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
? ""
|
|
|
|
Navigator.pop(context);
|
|
|
|
: maxField.text
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
|
|
|
|
categoryId:
|
|
|
|
|
|
|
|
categoriesId,
|
|
|
|
|
|
|
|
brandId: brandIds.isEmpty
|
|
|
|
|
|
|
|
? ""
|
|
|
|
|
|
|
|
: "&manufacturerids=" +
|
|
|
|
|
|
|
|
brandIds);
|
|
|
|
|
|
|
|
GifLoaderDialogUtils
|
|
|
|
|
|
|
|
.hideDialog(
|
|
|
|
|
|
|
|
context);
|
|
|
|
|
|
|
|
Navigator.pop(
|
|
|
|
|
|
|
|
context);
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
label: TranslationBase.of(
|
|
|
|
label: TranslationBase.of(context).apply,
|
|
|
|
context)
|
|
|
|
|
|
|
|
.apply,
|
|
|
|
|
|
|
|
// 'Apply',
|
|
|
|
// 'Apply',
|
|
|
|
backgroundColor:
|
|
|
|
backgroundColor: Colors.green,
|
|
|
|
Colors
|
|
|
|
|
|
|
|
.green,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -741,28 +567,20 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
model.subProducts.isNotEmpty
|
|
|
|
model.subProducts.isNotEmpty
|
|
|
|
? styleOne == true
|
|
|
|
? styleOne == true
|
|
|
|
? Container(
|
|
|
|
? Container(
|
|
|
|
height: model.subProducts.length *
|
|
|
|
height: model.subProducts.length * MediaQuery.of(context).size.height * 0.15,
|
|
|
|
MediaQuery.of(context).size.height *
|
|
|
|
|
|
|
|
0.15,
|
|
|
|
|
|
|
|
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,
|
|
|
|
childAspectRatio: 0.9,
|
|
|
|
childAspectRatio: 0.9,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
itemCount: model.subProducts.length,
|
|
|
|
itemCount: model.subProducts.length,
|
|
|
|
itemBuilder:
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
(BuildContext context, int index) {
|
|
|
|
|
|
|
|
return InkWell(
|
|
|
|
return InkWell(
|
|
|
|
child: Card(
|
|
|
|
child: Card(
|
|
|
|
color: model.subProducts[index]
|
|
|
|
color: model.subProducts[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(
|
|
|
|
@ -789,92 +607,42 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
topLeft:
|
|
|
|
topLeft: Radius.circular(110.0),
|
|
|
|
Radius.circular(110.0),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 0),
|
|
|
|
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:
|
|
|
|
margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
|
|
|
|
EdgeInsets.fromLTRB(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
0, 16, 0, 0),
|
|
|
|
|
|
|
|
alignment:
|
|
|
|
|
|
|
|
Alignment.center,
|
|
|
|
|
|
|
|
child: Image.network(
|
|
|
|
child: Image.network(
|
|
|
|
model
|
|
|
|
model.subProducts[index].images!.isNotEmpty
|
|
|
|
.subProducts[
|
|
|
|
? model.subProducts[index].images![0].thumb!
|
|
|
|
index]
|
|
|
|
|
|
|
|
.images
|
|
|
|
|
|
|
|
.isNotEmpty
|
|
|
|
|
|
|
|
? model
|
|
|
|
|
|
|
|
.subProducts[
|
|
|
|
|
|
|
|
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
|
|
|
|
width: model.subProducts[index].rxMessage != null ? MediaQuery.of(context).size.width / 3 : 0,
|
|
|
|
.subProducts[
|
|
|
|
padding: EdgeInsets.all(4),
|
|
|
|
index]
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
.rxMessage !=
|
|
|
|
color: Color(0xffb23838),
|
|
|
|
null
|
|
|
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(6)),
|
|
|
|
? MediaQuery.of(
|
|
|
|
),
|
|
|
|
context)
|
|
|
|
child: model.subProducts[index].rxMessage != null
|
|
|
|
.size
|
|
|
|
|
|
|
|
.width /
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
: 0,
|
|
|
|
|
|
|
|
padding:
|
|
|
|
|
|
|
|
EdgeInsets.all(4),
|
|
|
|
|
|
|
|
decoration:
|
|
|
|
|
|
|
|
BoxDecoration(
|
|
|
|
|
|
|
|
color:
|
|
|
|
|
|
|
|
Color(0xffb23838),
|
|
|
|
|
|
|
|
borderRadius:
|
|
|
|
|
|
|
|
BorderRadius.only(
|
|
|
|
|
|
|
|
topLeft: Radius
|
|
|
|
|
|
|
|
.circular(
|
|
|
|
|
|
|
|
6)),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: model
|
|
|
|
|
|
|
|
.subProducts[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.rxMessage !=
|
|
|
|
|
|
|
|
null
|
|
|
|
|
|
|
|
? Texts(
|
|
|
|
? Texts(
|
|
|
|
projectProvider
|
|
|
|
projectProvider.isArabic ? model.subProducts[index].rxMessagen : model.subProducts[index].rxMessage,
|
|
|
|
.isArabic
|
|
|
|
color: Colors.white,
|
|
|
|
? model
|
|
|
|
|
|
|
|
.subProducts[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.rxMessagen
|
|
|
|
|
|
|
|
: model
|
|
|
|
|
|
|
|
.subProducts[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.rxMessage,
|
|
|
|
|
|
|
|
color: Colors
|
|
|
|
|
|
|
|
.white,
|
|
|
|
|
|
|
|
regular: true,
|
|
|
|
regular: true,
|
|
|
|
fontSize: 10,
|
|
|
|
fontSize: 10,
|
|
|
|
fontWeight:
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
FontWeight
|
|
|
|
|
|
|
|
.w400,
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: Texts(""),
|
|
|
|
: Texts(""),
|
|
|
|
// Texts(
|
|
|
|
// Texts(
|
|
|
|
@ -888,39 +656,22 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin:
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
EdgeInsets.symmetric(
|
|
|
|
|
|
|
|
horizontal: 6,
|
|
|
|
horizontal: 6,
|
|
|
|
vertical: 0,
|
|
|
|
vertical: 0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment:
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
|
|
|
.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
projectViewModel
|
|
|
|
projectViewModel.isArabic ? model.subProducts[index].namen : model.subProducts[index].name,
|
|
|
|
.isArabic
|
|
|
|
|
|
|
|
? model
|
|
|
|
|
|
|
|
.subProducts[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.namen
|
|
|
|
|
|
|
|
: model
|
|
|
|
|
|
|
|
.subProducts[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.name,
|
|
|
|
|
|
|
|
// model.subProducts[index].name,
|
|
|
|
// model.subProducts[index].name,
|
|
|
|
regular: true,
|
|
|
|
regular: true,
|
|
|
|
fontSize: 12,
|
|
|
|
fontSize: 12,
|
|
|
|
fontWeight:
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
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.subProducts[index].price}",
|
|
|
|
"SAR ${model.subProducts[index].price}",
|
|
|
|
bold: true,
|
|
|
|
bold: true,
|
|
|
|
@ -934,35 +685,32 @@ 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.readOnly(
|
|
|
|
RatingBar(
|
|
|
|
initialRating: model
|
|
|
|
initialRating: model.subProducts[index].approvedRatingSum!.toDouble(),
|
|
|
|
.subProducts[
|
|
|
|
ratingWidget: RatingWidget(
|
|
|
|
index]
|
|
|
|
full: Icon(
|
|
|
|
.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,
|
|
|
|
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(
|
|
|
|
Texts(
|
|
|
|
"(${model.subProducts[index].approvedTotalReviews})",
|
|
|
|
"(${model.subProducts[index].approvedTotalReviews})",
|
|
|
|
regular: true,
|
|
|
|
regular: true,
|
|
|
|
fontSize: 10,
|
|
|
|
fontSize: 10,
|
|
|
|
fontWeight:
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
FontWeight
|
|
|
|
|
|
|
|
.w400,
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -977,8 +725,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
Navigator.push(
|
|
|
|
Navigator.push(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
FadePage(
|
|
|
|
FadePage(
|
|
|
|
page: ProductDetailPage(
|
|
|
|
page: ProductDetailPage(model.subProducts[index]),
|
|
|
|
model.subProducts[index]),
|
|
|
|
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -986,14 +733,11 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: Container(
|
|
|
|
: Container(
|
|
|
|
height: model.subProducts.length *
|
|
|
|
height: model.subProducts.length * MediaQuery.of(context).size.height * 0.122,
|
|
|
|
MediaQuery.of(context).size.height *
|
|
|
|
|
|
|
|
0.122,
|
|
|
|
|
|
|
|
child: ListView.builder(
|
|
|
|
child: ListView.builder(
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
itemCount: model.subProducts.length,
|
|
|
|
itemCount: model.subProducts.length,
|
|
|
|
itemBuilder:
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
(BuildContext context, int index) {
|
|
|
|
|
|
|
|
return InkWell(
|
|
|
|
return InkWell(
|
|
|
|
child: Card(
|
|
|
|
child: Card(
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
@ -1015,14 +759,12 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.fromLTRB(0, 0, 0, 8),
|
|
|
|
margin: EdgeInsets.fromLTRB(0, 0, 0, 8),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child:(model.subProducts[index].images != null &&
|
|
|
|
child: (model.subProducts[index].images != null && model.subProducts[index].images!.length > 0)
|
|
|
|
model.subProducts[index].images.length > 0)
|
|
|
|
|
|
|
|
? Image.network(
|
|
|
|
? Image.network(
|
|
|
|
model.subProducts[index].images[0].src,
|
|
|
|
model.subProducts[index].images![0].src!,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
height: 80,
|
|
|
|
height: 80,
|
|
|
|
width: 80,
|
|
|
|
width: 80,
|
|
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: Image.asset(
|
|
|
|
: Image.asset(
|
|
|
|
"assets/images/no_image.png",
|
|
|
|
"assets/images/no_image.png",
|
|
|
|
@ -1042,7 +784,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
color: Color(0xffb23838),
|
|
|
|
color: Color(0xffb23838),
|
|
|
|
//borderRadius: BorderRadius.only(topLeft: Radius.circular(5)),
|
|
|
|
//borderRadius: BorderRadius.only(topLeft: Radius.circular(5)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child:model.subProducts[index].rxMessage != null
|
|
|
|
child: model.subProducts[index].rxMessage != null
|
|
|
|
? Texts(
|
|
|
|
? Texts(
|
|
|
|
projectProvider.isArabic ? model.subProducts[index].rxMessagen : model.subProducts[index].rxMessage,
|
|
|
|
projectProvider.isArabic ? model.subProducts[index].rxMessagen : model.subProducts[index].rxMessage,
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
@ -1071,7 +813,8 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width: MediaQuery.of(context).size.width * 0.55,
|
|
|
|
width: MediaQuery.of(context).size.width * 0.55,
|
|
|
|
child: Texts(projectViewModel.isArabic ? model.subProducts[index].namen : model.subProducts[index].name,
|
|
|
|
child: Texts(
|
|
|
|
|
|
|
|
projectViewModel.isArabic ? model.subProducts[index].namen : model.subProducts[index].name,
|
|
|
|
regular: true,
|
|
|
|
regular: true,
|
|
|
|
fontSize: 13.2,
|
|
|
|
fontSize: 13.2,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
@ -1091,15 +834,26 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
RatingBar.readOnly(
|
|
|
|
RatingBar(
|
|
|
|
initialRating: model.subProducts[index].approvedRatingSum.toDouble(),
|
|
|
|
initialRating: model.subProducts[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.subProducts[index].approvedTotalReviews})",
|
|
|
|
"(${model.subProducts[index].approvedTotalReviews})",
|
|
|
|
@ -1126,8 +880,6 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
await addToCartFunction(1, model.subProducts[index].id);
|
|
|
|
await addToCartFunction(1, model.subProducts[index].id);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
utils.Utils.navigateToCartPage();
|
|
|
|
utils.Utils.navigateToCartPage();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription);
|
|
|
|
AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1420,8 +1172,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
child: Center(
|
|
|
|
child: Center(
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment:
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
MainAxisAlignment.center,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
@ -1453,8 +1204,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool isEntityListSelected(CategoriseParentModel masterKey) {
|
|
|
|
bool isEntityListSelected(CategoriseParentModel masterKey) {
|
|
|
|
Iterable<CategoriseParentModel> history =
|
|
|
|
Iterable<CategoriseParentModel> history = entityList.where((element) => masterKey.id == element.id);
|
|
|
|
entityList.where((element) => masterKey.id == element.id);
|
|
|
|
|
|
|
|
if (history.length > 0) {
|
|
|
|
if (history.length > 0) {
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1462,8 +1212,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool isEntityListSelectedBrands(CategoriseParentModel masterKey) {
|
|
|
|
bool isEntityListSelectedBrands(CategoriseParentModel masterKey) {
|
|
|
|
Iterable<CategoriseParentModel> history =
|
|
|
|
Iterable<CategoriseParentModel> history = entityListBrands.where((element) => masterKey.id == element.id);
|
|
|
|
entityListBrands.where((element) => masterKey.id == element.id);
|
|
|
|
|
|
|
|
if (history.length > 0) {
|
|
|
|
if (history.length > 0) {
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|