|
|
|
@ -69,6 +69,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
|
|
|
|
|
TextEditingController minField = TextEditingController();
|
|
|
|
|
TextEditingController maxField = TextEditingController();
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
ProjectViewModel projectProvider = Provider.of(context);
|
|
|
|
|
return BaseView<PharmacyCategoriseViewModel>(
|
|
|
|
|
onModelReady: (model) => model.getCategoriseParent(i: id),
|
|
|
|
|
allowAny: true,
|
|
|
|
@ -116,12 +117,12 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.all(10.0),
|
|
|
|
|
child: InkWell(
|
|
|
|
|
InkWell(
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.all(10.0),
|
|
|
|
|
child: Container(
|
|
|
|
|
child: Texts(
|
|
|
|
|
TranslationBase.of(context).viewCategorise,
|
|
|
|
@ -129,70 +130,19 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
|
|
|
|
|
fontWeight: FontWeight.w300,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: SubCategoriseModalsheet(
|
|
|
|
|
// id: model.categorise[0].id,
|
|
|
|
|
// titleName: model.categorise[0].name,
|
|
|
|
|
)),
|
|
|
|
|
);
|
|
|
|
|
// showModalBottomSheet<void>(
|
|
|
|
|
// isScrollControlled: true,
|
|
|
|
|
// context: context,
|
|
|
|
|
// builder: (BuildContext context) {
|
|
|
|
|
// return Container(
|
|
|
|
|
// // height: MediaQuery.of(context)
|
|
|
|
|
// // .size
|
|
|
|
|
// // .height *
|
|
|
|
|
// // 0.89,
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// child: Center(
|
|
|
|
|
// child: ListView.builder(
|
|
|
|
|
// scrollDirection: Axis.vertical,
|
|
|
|
|
// itemCount: model.categoriseParent.length,
|
|
|
|
|
// itemBuilder: (BuildContext context, int index) {
|
|
|
|
|
// return Container(
|
|
|
|
|
// child: Padding(
|
|
|
|
|
// padding: EdgeInsets.all(4.0),
|
|
|
|
|
// child: InkWell(
|
|
|
|
|
// child: Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// children: [
|
|
|
|
|
// Texts(projectViewModel.isArabic
|
|
|
|
|
// ? model.categoriseParent[index].namen
|
|
|
|
|
// : model.categoriseParent[index].name),
|
|
|
|
|
// Divider(
|
|
|
|
|
// thickness: 0.6,
|
|
|
|
|
// color: Colors.black12,
|
|
|
|
|
// )
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// onTap: () {
|
|
|
|
|
// Navigator.push(
|
|
|
|
|
// context,
|
|
|
|
|
// FadePage(
|
|
|
|
|
// page: SubCategorisePage(
|
|
|
|
|
// title: model.categoriseParent[index].name,
|
|
|
|
|
// id: model.categoriseParent[index].id,
|
|
|
|
|
// parentId: id,
|
|
|
|
|
// )),
|
|
|
|
|
// );
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
// }),
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
// },
|
|
|
|
|
// );
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Icon(Icons.arrow_forward)
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: SubCategoriseModalsheet(
|
|
|
|
|
// id: model.categorise[0].id,
|
|
|
|
|
// titleName: model.categorise[0].name,
|
|
|
|
|
)),
|
|
|
|
|
);}
|
|
|
|
|
),
|
|
|
|
|
Divider(
|
|
|
|
|
thickness: 1.0,
|
|
|
|
@ -256,7 +206,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: SubCategorisePage(
|
|
|
|
|
title: model.categoriseParent[index].name,
|
|
|
|
|
title: projectViewModel.isArabic ? model.categoriseParent[index].namen : model.categoriseParent[index].name,
|
|
|
|
|
// title: model.categoriseParent[index].name,
|
|
|
|
|
id: model.categoriseParent[index].id,
|
|
|
|
|
parentId: id,
|
|
|
|
|
)),
|
|
|
|
@ -289,7 +240,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
|
|
|
|
|
width: 10.0,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
'Refine',
|
|
|
|
|
TranslationBase.of(context).refine,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
@ -418,7 +369,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
|
|
|
|
|
Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Texts('Min'),
|
|
|
|
|
Texts(TranslationBase.of(context).min),
|
|
|
|
|
Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
width: 200,
|
|
|
|
@ -435,7 +386,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
|
|
|
|
|
Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Texts('Max'),
|
|
|
|
|
Texts(TranslationBase.of(context).max),
|
|
|
|
|
Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
width: 200,
|
|
|
|
@ -638,7 +589,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
|
|
|
|
|
bottom: 5.0,
|
|
|
|
|
),
|
|
|
|
|
child: Texts(
|
|
|
|
|
'offer'.toUpperCase(),
|
|
|
|
|
TranslationBase.of(context).offers.toUpperCase(),
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
fontSize: 13.0,
|
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
|
@ -665,13 +616,23 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
|
|
|
|
|
color: Color(0xffb23838),
|
|
|
|
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(6)),
|
|
|
|
|
),
|
|
|
|
|
child: Texts(
|
|
|
|
|
model.parentProducts[index].rxMessage != null ? model.parentProducts[index].rxMessage : "",
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
regular: true,
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
),
|
|
|
|
|
child:model.parentProducts[index].rxMessage != null ?
|
|
|
|
|
Texts(projectProvider.isArabic
|
|
|
|
|
? model.parentProducts[index].rxMessagen
|
|
|
|
|
: model.parentProducts[index].rxMessage,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
regular: true,
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
)
|
|
|
|
|
: Texts(""),
|
|
|
|
|
// Texts(
|
|
|
|
|
// model.parentProducts[index].rxMessage != null ? model.parentProducts[index].rxMessage : "",
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// regular: true,
|
|
|
|
|
// fontSize: 10,
|
|
|
|
|
// fontWeight: FontWeight.w400,
|
|
|
|
|
// ),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
@ -802,13 +763,23 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
|
|
|
|
|
color: Color(0xffb23838),
|
|
|
|
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(6)),
|
|
|
|
|
),
|
|
|
|
|
child: Texts(
|
|
|
|
|
model.parentProducts[index].rxMessage != null ? model.parentProducts[index].rxMessage : "",
|
|
|
|
|
child: model.parentProducts[index].rxMessage != null ?
|
|
|
|
|
Texts(projectProvider.isArabic
|
|
|
|
|
? model.parentProducts[index].rxMessagen
|
|
|
|
|
: model.parentProducts[index].rxMessage,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
regular: true,
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Texts(""),
|
|
|
|
|
// Texts(
|
|
|
|
|
// model.parentProducts[index].rxMessage != null ? model.parentProducts[index].rxMessage : "",
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// regular: true,
|
|
|
|
|
// fontSize: 10,
|
|
|
|
|
// fontWeight: FontWeight.w400,
|
|
|
|
|
// ),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
@ -926,8 +897,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
'There is no data',
|
|
|
|
|
child: Text(TranslationBase.of(context).noData,
|
|
|
|
|
// 'There is no data',
|
|
|
|
|
style: TextStyle(fontSize: 30),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
@ -945,7 +916,7 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
|
|
|
|
|
|
|
|
|
|
addToCartFunction(quantity, itemID) async {
|
|
|
|
|
ProductDetailViewModel x = new ProductDetailViewModel();
|
|
|
|
|
await x.addToCartData(quantity, itemID);
|
|
|
|
|
await x.addToCartData(quantity, itemID, context);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool isEntityListSelected(CategoriseParentModel masterKey) {
|
|
|
|
|