|
|
|
|
@ -1,4 +1,6 @@
|
|
|
|
|
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/LastVisitedViewModel.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PrescriptionViewModel.dart';
|
|
|
|
|
@ -35,9 +37,10 @@ class PharmacyPage extends StatefulWidget {
|
|
|
|
|
class _PharmacyPageState extends State<PharmacyPage> {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
|
|
return BaseView<PharmacyModuleViewModel>(
|
|
|
|
|
onModelReady: (model) async {
|
|
|
|
|
// GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
// GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await model.getSavedLanguage();
|
|
|
|
|
await model.getBannerList();
|
|
|
|
|
// GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
@ -49,7 +52,7 @@ class _PharmacyPageState extends State<PharmacyPage> {
|
|
|
|
|
isShowDecPage: false,
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
body: Container(
|
|
|
|
|
body: model.state != ViewState.BusyLocal ? Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
@ -57,54 +60,16 @@ class _PharmacyPageState extends State<PharmacyPage> {
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
BannerPager(model),
|
|
|
|
|
GridViewButtons(model),
|
|
|
|
|
//PrescriptionsWidget(),
|
|
|
|
|
PrescriptionsWidget(),
|
|
|
|
|
ShopByBrandWidget(),
|
|
|
|
|
RecentlyViewedWidget(),
|
|
|
|
|
// TODO MOUSA
|
|
|
|
|
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,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
BestSellerWidget(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
) : Container(
|
|
|
|
|
height: 200,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
@ -265,225 +230,233 @@ class PrescriptionsWidget extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
allowAny: true,
|
|
|
|
|
builder: (_, model, wi) => model.prescriptionsList.length != 0
|
|
|
|
|
? Container(
|
|
|
|
|
height: model.prescriptionsList.length > 0
|
|
|
|
|
? MediaQuery.of(context).size.height * 0.28
|
|
|
|
|
: 0,
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
TranslationBase.of(context).myPrescription,
|
|
|
|
|
bold: true,
|
|
|
|
|
),
|
|
|
|
|
BorderedButton(
|
|
|
|
|
TranslationBase.of(context).viewAll,
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
borderColor: Colors.green,
|
|
|
|
|
textColor: Colors.green,
|
|
|
|
|
vPadding: 6,
|
|
|
|
|
hPadding: 4,
|
|
|
|
|
handler: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) =>
|
|
|
|
|
HomePrescriptionsPage()));
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
builder: (_, model, wi) => model.prescriptionsList.length > 0
|
|
|
|
|
? NetworkBaseView(
|
|
|
|
|
isLocalLoader: true,
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
child: Container(
|
|
|
|
|
height: model.prescriptionsList.length > 0
|
|
|
|
|
? MediaQuery.of(context).size.height * 0.28
|
|
|
|
|
: 0,
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
TranslationBase.of(context).myPrescription,
|
|
|
|
|
bold: true,
|
|
|
|
|
),
|
|
|
|
|
BorderedButton(
|
|
|
|
|
TranslationBase.of(context).viewAll,
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
borderColor: Colors.green,
|
|
|
|
|
textColor: Colors.green,
|
|
|
|
|
vPadding: 6,
|
|
|
|
|
hPadding: 4,
|
|
|
|
|
handler: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) =>
|
|
|
|
|
HomePrescriptionsPage()));
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.symmetric(horizontal: 18.0, vertical: 14.0),
|
|
|
|
|
margin: EdgeInsets.only(left: 10),
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
|
// physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
itemCount: model.prescriptionsList.length,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.3,
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
bottom: 5.0, left: 5.0, right: 8.0),
|
|
|
|
|
margin: EdgeInsets.only(right: 10.0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border.all(
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
style: BorderStyle.solid,
|
|
|
|
|
width: 1.0,
|
|
|
|
|
),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(10.0)),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Column(children: [
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
top: 10.0,
|
|
|
|
|
left: 10.0,
|
|
|
|
|
right: 10.0,
|
|
|
|
|
bottom: 15.0,
|
|
|
|
|
),
|
|
|
|
|
child: CircleAvatar(
|
|
|
|
|
radius: 30,
|
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
|
child: Image.network(
|
|
|
|
|
model.prescriptionsList[index]
|
|
|
|
|
.doctorImageURL,
|
|
|
|
|
width: 60,
|
|
|
|
|
height: 60,
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 18.0, vertical: 14.0),
|
|
|
|
|
margin: EdgeInsets.only(left: 10),
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
|
// physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
itemCount: model.prescriptionsList.length,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.3,
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
bottom: 5.0, left: 5.0, right: 8.0),
|
|
|
|
|
margin: EdgeInsets.only(right: 10.0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border.all(
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
style: BorderStyle.solid,
|
|
|
|
|
width: 1.0,
|
|
|
|
|
),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(10.0)),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Column(children: [
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
top: 10.0,
|
|
|
|
|
left: 10.0,
|
|
|
|
|
right: 10.0,
|
|
|
|
|
bottom: 15.0,
|
|
|
|
|
),
|
|
|
|
|
child: CircleAvatar(
|
|
|
|
|
radius: 30,
|
|
|
|
|
backgroundColor:
|
|
|
|
|
Colors.transparent,
|
|
|
|
|
child: Image.network(
|
|
|
|
|
model.prescriptionsList[index]
|
|
|
|
|
.doctorImageURL,
|
|
|
|
|
width: 60,
|
|
|
|
|
height: 60,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 1),
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
left: 15.0, right: 15.0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border.all(
|
|
|
|
|
]),
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.only(left: 1),
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
left: 15.0, right: 15.0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border.all(
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
style: BorderStyle.solid,
|
|
|
|
|
width: 4.0,
|
|
|
|
|
),
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
style: BorderStyle.solid,
|
|
|
|
|
width: 4.0,
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.circular(
|
|
|
|
|
30.0)),
|
|
|
|
|
child: Text(
|
|
|
|
|
model.languageID == "ar"
|
|
|
|
|
? model
|
|
|
|
|
.prescriptionsList[
|
|
|
|
|
index]
|
|
|
|
|
.isInOutPatientDescriptionN
|
|
|
|
|
.toString()
|
|
|
|
|
: model
|
|
|
|
|
.prescriptionsList[
|
|
|
|
|
index]
|
|
|
|
|
.isInOutPatientDescription
|
|
|
|
|
.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
),
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.circular(
|
|
|
|
|
30.0)),
|
|
|
|
|
child: Text(
|
|
|
|
|
model.languageID == "ar"
|
|
|
|
|
? model
|
|
|
|
|
.prescriptionsList[
|
|
|
|
|
index]
|
|
|
|
|
.isInOutPatientDescriptionN
|
|
|
|
|
.toString()
|
|
|
|
|
: model
|
|
|
|
|
.prescriptionsList[
|
|
|
|
|
index]
|
|
|
|
|
.isInOutPatientDescription
|
|
|
|
|
.toString(),
|
|
|
|
|
)),
|
|
|
|
|
Row(children: <Widget>[
|
|
|
|
|
Image.asset(
|
|
|
|
|
'assets/images/Icon-awesome-calendar.png',
|
|
|
|
|
width: 30,
|
|
|
|
|
height: 30,
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
DateUtil.convertStringToDate(
|
|
|
|
|
model
|
|
|
|
|
.prescriptionsList[
|
|
|
|
|
index]
|
|
|
|
|
.appointmentDate
|
|
|
|
|
.toString())
|
|
|
|
|
.toString()
|
|
|
|
|
.substring(0, 10),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
Row(children: <Widget>[
|
|
|
|
|
Image.asset(
|
|
|
|
|
'assets/images/Icon-awesome-calendar.png',
|
|
|
|
|
width: 30,
|
|
|
|
|
height: 30,
|
|
|
|
|
)
|
|
|
|
|
]),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child: Row(children: <Widget>[
|
|
|
|
|
Text(
|
|
|
|
|
model.prescriptionsList[index]
|
|
|
|
|
.doctorTitle
|
|
|
|
|
.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
DateUtil.convertStringToDate(model
|
|
|
|
|
.prescriptionsList[index]
|
|
|
|
|
.appointmentDate
|
|
|
|
|
.toString())
|
|
|
|
|
.toString()
|
|
|
|
|
.substring(0, 10),
|
|
|
|
|
model.prescriptionsList[index]
|
|
|
|
|
.doctorName
|
|
|
|
|
.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
]),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child: Row(children: <Widget>[
|
|
|
|
|
Text(
|
|
|
|
|
model.prescriptionsList[index]
|
|
|
|
|
.doctorTitle
|
|
|
|
|
.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child: Text(
|
|
|
|
|
model.prescriptionsList[index]
|
|
|
|
|
.doctorName
|
|
|
|
|
.clinicDescription
|
|
|
|
|
.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child: Text(
|
|
|
|
|
model.prescriptionsList[index]
|
|
|
|
|
.clinicDescription
|
|
|
|
|
.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child: Align(
|
|
|
|
|
alignment: Alignment.topLeft,
|
|
|
|
|
child: RatingBar.readOnly(
|
|
|
|
|
initialRating: model
|
|
|
|
|
.prescriptionsList[index]
|
|
|
|
|
.actualDoctorRate
|
|
|
|
|
.toDouble(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child: Align(
|
|
|
|
|
alignment: Alignment.topLeft,
|
|
|
|
|
child: RatingBar.readOnly(
|
|
|
|
|
initialRating: model
|
|
|
|
|
.prescriptionsList[index]
|
|
|
|
|
.actualDoctorRate
|
|
|
|
|
.toDouble(),
|
|
|
|
|
// initialRating: productRate,
|
|
|
|
|
size: 15.0,
|
|
|
|
|
filledColor: Colors.yellow[700],
|
|
|
|
|
emptyColor: Colors.grey[500],
|
|
|
|
|
isHalfAllowed: true,
|
|
|
|
|
halfFilledIcon: Icons.star_half,
|
|
|
|
|
filledIcon: Icons.star,
|
|
|
|
|
emptyIcon: Icons.star,
|
|
|
|
|
size: 15.0,
|
|
|
|
|
filledColor: Colors.yellow[700],
|
|
|
|
|
emptyColor: Colors.grey[500],
|
|
|
|
|
isHalfAllowed: true,
|
|
|
|
|
halfFilledIcon: Icons.star_half,
|
|
|
|
|
filledIcon: Icons.star,
|
|
|
|
|
emptyIcon: Icons.star,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
]),
|
|
|
|
|
]),
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
]),
|
|
|
|
|
]),
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: 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(
|
|
|
|
|
// margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
|
|
|
|
// child: Row(
|
|
|
|
|
|