fixed subCategories

merge-requests/425/head
Fatimah Alshammari 4 years ago
parent b3285f4528
commit 4309952b17

@ -13,16 +13,16 @@ const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders';
const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
//const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs
const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
//const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
// const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
// Pharmacy Production URLs
// const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/';
// const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/';
const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity';

@ -16,7 +16,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/pages/sub_categories_modalsheet.dart';
import 'base/base_view.dart';
class ParentCategorisePage extends StatefulWidget {
@ -114,56 +114,65 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
),
),
onTap: () {
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,
)),
);
},
),
),
);
}),
),
);
},
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,
// )),
// );
// },
// ),
// ),
// );
// }),
// ),
// );
// },
// );
},
),
),
@ -300,7 +309,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
width: 10.0,
),
Texts(
'Refine',
TranslationBase.of(context).refine,
// 'Refine',
fontWeight: FontWeight.w600,
),
SizedBox(
@ -308,7 +318,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
),
InkWell(
child: Texts(
'Close',
// 'Close',
TranslationBase.of(context).closeIt,
color: Colors.red,
fontWeight: FontWeight.w600,
fontSize: 15.0,
@ -327,7 +338,9 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Column(
children: [
ExpansionTile(
title: Texts('Categorise'),
title: Texts( TranslationBase.of(
context)
.categorise),
children: [
ProcedureListWidget(
model: model,
@ -356,7 +369,9 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
color: Colors.black12,
),
ExpansionTile(
title: Texts('Brands'),
title: Texts( TranslationBase.of(
context)
.brands),
children: [
ProcedureListWidget(
model: model,
@ -385,7 +400,9 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
color: Colors.black12,
),
ExpansionTile(
title: Texts('Price'),
title: Texts( TranslationBase.of(
context)
.price),
children: [
Container(
color: Color(0xffEEEEEE),
@ -446,7 +463,9 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Container(
width: 100,
child: Button(
label: 'Reset',
label: TranslationBase.of(
context)
.reset,
backgroundColor: Colors.red,
),
),
@ -486,7 +505,9 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
Navigator.pop(context);
},
label: 'Apply',
label: TranslationBase.of(
context)
.apply,
backgroundColor: Colors.green,
),
),

@ -121,7 +121,7 @@ reviewDetails(data, rate, myRate) {
: data.product.name,
style: TextStyle(
color: Colors.black54,
fontSize: languageID == 'ar' ? 7 : 13,
fontSize: languageID == 'ar' ? 12 : 13,
fontWeight: FontWeight.bold),
),
),
@ -187,7 +187,7 @@ reviewDetails(data, rate, myRate) {
padding: languageID == 'ar'
? EdgeInsets.only(right: 10)
: EdgeInsets.only(left: 10),
child: Text(data.createdOnUtc.toString())),
child: Text(data.createdOnUtc.toString().substring(0 , 11))),
],
),
),

@ -42,7 +42,8 @@ class _WishlistPageState extends State<WishlistPage> {
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'There is no data',
TranslationBase.of(context).noData,
// 'There is no data',
style: TextStyle(fontSize: 30),
),
)

@ -0,0 +1,108 @@
import 'package:diplomaticquarterapp/core/model/pharmacy/categorise_parent_model.dart';
import 'package:diplomaticquarterapp/core/model/pharmacy/pharmacy_categorise.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/sub_categorise_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'base/base_view.dart';
import 'package:provider/provider.dart';
class SubCategoriseModalsheet extends StatefulWidget {
String id;
String titleName;
SubCategoriseModalsheet({this.id, this.titleName});
@override
_SubCategoriseModalsheetState createState() => _SubCategoriseModalsheetState(id: id, titleName: titleName);
}
class _SubCategoriseModalsheetState extends State<SubCategoriseModalsheet> {
String id;
String titleName;
// List<CategoriseParentModel> categoriesList = [];
_SubCategoriseModalsheetState({this.id, this.titleName});
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PharmacyCategoriseViewModel>(
onModelReady: (model) => model.getCategoriseParent(i: id),
builder: (_, model, wi) => AppScaffold(
// appBarTitle: titleName,
appBarTitle: TranslationBase.of(context).categorise,
isBottomBar: false,
isShowAppBar: true,
backgroundColor: Colors.white,
isShowDecPage: false,
baseViewModel: model,
body: Container(
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),
SizedBox(
height: 10,
),
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,
)),
);
},
),
),
);
}),
),
),
),
);
}
// getCatName() {
//
// if (widget.id == '1' )
// return Texts("text1");
// else if (widget.id == '2' )
// return Texts("text2");
// else if (widget.id == '3')
// return Texts("text3");
// else if (widget.id == '4' )
// return Texts("text4");
// }
}

@ -28,6 +28,8 @@ class ReviewService extends BaseService {
_reviewList.clear();
response['reviews'].forEach((item) {
_reviewList.add(Review.fromJson(item));
print (response);
print (item['reviewText']);
});
}, onFailure: (String error, int statusCode) {
hasError = true;

Loading…
Cancel
Save