|
|
|
@ -1,4 +1,6 @@
|
|
|
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
|
|
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/BestSellerViewModel.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/BrandViewModel.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/BrandViewModel.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/LastVisitedViewModel.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/LastVisitedViewModel.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PrescriptionViewModel.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PrescriptionViewModel.dart';
|
|
|
|
@ -35,6 +37,7 @@ class PharmacyPage extends StatefulWidget {
|
|
|
|
class _PharmacyPageState extends State<PharmacyPage> {
|
|
|
|
class _PharmacyPageState extends State<PharmacyPage> {
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
|
|
|
|
return BaseView<PharmacyModuleViewModel>(
|
|
|
|
return BaseView<PharmacyModuleViewModel>(
|
|
|
|
onModelReady: (model) async {
|
|
|
|
onModelReady: (model) async {
|
|
|
|
// GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
// GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
@ -49,7 +52,7 @@ class _PharmacyPageState extends State<PharmacyPage> {
|
|
|
|
isShowDecPage: false,
|
|
|
|
isShowDecPage: false,
|
|
|
|
baseViewModel: model,
|
|
|
|
baseViewModel: model,
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
body: Container(
|
|
|
|
body: model.state != ViewState.BusyLocal ? Container(
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
@ -57,54 +60,16 @@ class _PharmacyPageState extends State<PharmacyPage> {
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
BannerPager(model),
|
|
|
|
BannerPager(model),
|
|
|
|
GridViewButtons(model),
|
|
|
|
GridViewButtons(model),
|
|
|
|
//PrescriptionsWidget(),
|
|
|
|
PrescriptionsWidget(),
|
|
|
|
ShopByBrandWidget(),
|
|
|
|
ShopByBrandWidget(),
|
|
|
|
RecentlyViewedWidget(),
|
|
|
|
RecentlyViewedWidget(),
|
|
|
|
// TODO MOUSA
|
|
|
|
BestSellerWidget(),
|
|
|
|
Container(
|
|
|
|
|
|
|
|
margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Texts(
|
|
|
|
|
|
|
|
TranslationBase.of(context).bestSellers,
|
|
|
|
|
|
|
|
bold: true,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
BorderedButton(
|
|
|
|
|
|
|
|
TranslationBase.of(context).viewAll,
|
|
|
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
|
|
|
borderColor: Colors.green,
|
|
|
|
|
|
|
|
textColor: Colors.green,
|
|
|
|
|
|
|
|
vPadding: 6,
|
|
|
|
|
|
|
|
hPadding: 4,
|
|
|
|
|
|
|
|
handler: () => {
|
|
|
|
|
|
|
|
Navigator.push(
|
|
|
|
|
|
|
|
context,
|
|
|
|
|
|
|
|
FadePage(
|
|
|
|
|
|
|
|
page: FinalProductsPage(
|
|
|
|
|
|
|
|
id: "",
|
|
|
|
|
|
|
|
//TODO Elham* handel this to understans form where the number comming
|
|
|
|
|
|
|
|
productType: 20,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
height: MediaQuery.of(context).size.height / 4 + 20,
|
|
|
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
|
|
|
itemBuilder: (ctx, i) =>
|
|
|
|
|
|
|
|
ProductTileItem(model.bestSellerProduct[i]),
|
|
|
|
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
|
|
|
|
itemCount: model.bestSellerProduct.length,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
) : Container(
|
|
|
|
|
|
|
|
height: 200,
|
|
|
|
|
|
|
|
color: Colors.red,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -265,8 +230,11 @@ class PrescriptionsWidget extends StatelessWidget {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
allowAny: true,
|
|
|
|
allowAny: true,
|
|
|
|
builder: (_, model, wi) => model.prescriptionsList.length != 0
|
|
|
|
builder: (_, model, wi) => model.prescriptionsList.length > 0
|
|
|
|
? Container(
|
|
|
|
? NetworkBaseView(
|
|
|
|
|
|
|
|
isLocalLoader: true,
|
|
|
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
height: model.prescriptionsList.length > 0
|
|
|
|
height: model.prescriptionsList.length > 0
|
|
|
|
? MediaQuery.of(context).size.height * 0.28
|
|
|
|
? MediaQuery.of(context).size.height * 0.28
|
|
|
|
: 0,
|
|
|
|
: 0,
|
|
|
|
@ -300,8 +268,8 @@ class PrescriptionsWidget extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
padding:
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
EdgeInsets.symmetric(horizontal: 18.0, vertical: 14.0),
|
|
|
|
horizontal: 18.0, vertical: 14.0),
|
|
|
|
margin: EdgeInsets.only(left: 10),
|
|
|
|
margin: EdgeInsets.only(left: 10),
|
|
|
|
child: ListView.builder(
|
|
|
|
child: ListView.builder(
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
@ -338,7 +306,8 @@ class PrescriptionsWidget extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: CircleAvatar(
|
|
|
|
child: CircleAvatar(
|
|
|
|
radius: 30,
|
|
|
|
radius: 30,
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
backgroundColor:
|
|
|
|
|
|
|
|
Colors.transparent,
|
|
|
|
child: Image.network(
|
|
|
|
child: Image.network(
|
|
|
|
model.prescriptionsList[index]
|
|
|
|
model.prescriptionsList[index]
|
|
|
|
.doctorImageURL,
|
|
|
|
.doctorImageURL,
|
|
|
|
@ -351,7 +320,8 @@ class PrescriptionsWidget extends StatelessWidget {
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(left: 1),
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.only(left: 1),
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: 15.0, right: 15.0),
|
|
|
|
left: 15.0, right: 15.0),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
@ -388,8 +358,10 @@ class PrescriptionsWidget extends StatelessWidget {
|
|
|
|
height: 30,
|
|
|
|
height: 30,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
DateUtil.convertStringToDate(model
|
|
|
|
DateUtil.convertStringToDate(
|
|
|
|
.prescriptionsList[index]
|
|
|
|
model
|
|
|
|
|
|
|
|
.prescriptionsList[
|
|
|
|
|
|
|
|
index]
|
|
|
|
.appointmentDate
|
|
|
|
.appointmentDate
|
|
|
|
.toString())
|
|
|
|
.toString())
|
|
|
|
.toString()
|
|
|
|
.toString()
|
|
|
|
@ -485,6 +457,7 @@ class PrescriptionsWidget extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: Container(),
|
|
|
|
: Container(),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -604,6 +577,65 @@ class RecentlyViewedWidget extends StatelessWidget {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class BestSellerWidget extends StatelessWidget {
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
return BaseView<BestSellerViewModel>(
|
|
|
|
|
|
|
|
onModelReady: (model) => model.getBestSellerProducts(),
|
|
|
|
|
|
|
|
allowAny: true,
|
|
|
|
|
|
|
|
builder: (_, model, wi) => NetworkBaseView(
|
|
|
|
|
|
|
|
isLocalLoader: true,
|
|
|
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Texts(
|
|
|
|
|
|
|
|
TranslationBase.of(context).bestSellers,
|
|
|
|
|
|
|
|
bold: true,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
BorderedButton(
|
|
|
|
|
|
|
|
TranslationBase.of(context).viewAll,
|
|
|
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
|
|
|
borderColor: Colors.green,
|
|
|
|
|
|
|
|
textColor: Colors.green,
|
|
|
|
|
|
|
|
vPadding: 6,
|
|
|
|
|
|
|
|
hPadding: 4,
|
|
|
|
|
|
|
|
handler: () => {
|
|
|
|
|
|
|
|
Navigator.push(
|
|
|
|
|
|
|
|
context,
|
|
|
|
|
|
|
|
FadePage(
|
|
|
|
|
|
|
|
page: FinalProductsPage(
|
|
|
|
|
|
|
|
id: "",
|
|
|
|
|
|
|
|
productType: 20,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
height: MediaQuery.of(context).size.height / 4 + 20,
|
|
|
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
|
|
|
itemBuilder: (ctx, i) =>
|
|
|
|
|
|
|
|
ProductTileItem(model.bestSellerProduct[i]),
|
|
|
|
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
|
|
|
|
itemCount: model.bestSellerProduct.length,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Container(
|
|
|
|
// Container(
|
|
|
|
// margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
|
|
|
// margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
|
|
|
// child: Row(
|
|
|
|
// child: Row(
|
|
|
|
|