Merge branch 'pharmacy_fix_bugs' into 'development'
fix bugs pharmacy home See merge request Cloud_Solution/diplomatic-quarter!402merge-update-with-lab-changes
commit
1c1fcb00cb
@ -1,5 +1,26 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart';
|
||||||
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
||||||
|
|
||||||
|
import '../../../locator.dart';
|
||||||
|
|
||||||
class BestSellerViewModel extends BaseViewModel {
|
class BestSellerViewModel extends BaseViewModel {
|
||||||
|
|
||||||
|
PharmacyModuleService _pharmacyService = locator<PharmacyModuleService>();
|
||||||
|
|
||||||
|
List<PharmacyProduct> get bestSellerProduct =>
|
||||||
|
_pharmacyService.bestSellerProducts;
|
||||||
|
|
||||||
|
getBestSellerProducts() async {
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _pharmacyService.getBestSellerProducts();
|
||||||
|
if (_pharmacyService.hasError) {
|
||||||
|
error = _pharmacyService.error;
|
||||||
|
setState(ViewState.Error);
|
||||||
|
} else {
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/BestSellerViewModel.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../../final_products_page.dart';
|
||||||
|
import '../ProductTileItem.dart';
|
||||||
|
import 'ViewAllHomeWidget.dart';
|
||||||
|
|
||||||
|
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: [
|
||||||
|
ViewAllHomeWidget(
|
||||||
|
TranslationBase.of(context).bestSellers,
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,81 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../../offers_categorise_page.dart';
|
||||||
|
import 'GridViewCard.dart';
|
||||||
|
|
||||||
|
class GridViewButtons extends StatelessWidget {
|
||||||
|
final PharmacyModuleViewModel model;
|
||||||
|
|
||||||
|
GridViewButtons(this.model);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final gridHeight = (MediaQuery.of(context).size.width * 0.3) * 1.8;
|
||||||
|
return Container(
|
||||||
|
child: SizedBox(
|
||||||
|
height: gridHeight,
|
||||||
|
child: GridView.count(
|
||||||
|
childAspectRatio: 2.2,
|
||||||
|
crossAxisSpacing: 10,
|
||||||
|
mainAxisSpacing: 10,
|
||||||
|
controller: new ScrollController(keepScrollOffset: false),
|
||||||
|
shrinkWrap: true,
|
||||||
|
padding: const EdgeInsets.all(4.0),
|
||||||
|
crossAxisCount: 2,
|
||||||
|
children: [
|
||||||
|
DashboardItem(
|
||||||
|
imageName: 'pharmacy_module/bg_1.png',
|
||||||
|
hasColorFilter: false,
|
||||||
|
opacity: 0.8,
|
||||||
|
child: GridViewCard(
|
||||||
|
TranslationBase.of(context).offersAndPromotions,
|
||||||
|
'assets/images/pharmacy_module/offer_icon.png', () {
|
||||||
|
Navigator.push(context, FadePage(page: OffersCategorisePage()));
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
DashboardItem(
|
||||||
|
imageName: 'pharmacy_module/bg_2.png',
|
||||||
|
opacity: 0,
|
||||||
|
hasColorFilter: false,
|
||||||
|
child: GridViewCard(TranslationBase.of(context).medicationRefill,
|
||||||
|
'assets/images/pharmacy_module/medication_icon.png', () {
|
||||||
|
// model.checkUserIsActivated().then((isActivated) {
|
||||||
|
// if (isActivated) {
|
||||||
|
// Navigator.push(context, FadePage(page: LakumMainPage()));
|
||||||
|
// } else {
|
||||||
|
// Navigator.push(
|
||||||
|
// context, FadePage(page: LakumActivationVidaPage()));
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
DashboardItem(
|
||||||
|
imageName: 'pharmacy_module/bg_3.png',
|
||||||
|
opacity: 0,
|
||||||
|
hasColorFilter: false,
|
||||||
|
child: GridViewCard(TranslationBase.of(context).myPrescriptions,
|
||||||
|
'assets/images/pharmacy_module/prescription_icon.png', () {
|
||||||
|
Navigator.push(
|
||||||
|
context, FadePage(page: HomePrescriptionsPage()));
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
DashboardItem(
|
||||||
|
imageName: 'pharmacy_module/bg_4.png',
|
||||||
|
opacity: 0,
|
||||||
|
hasColorFilter: false,
|
||||||
|
child: GridViewCard(
|
||||||
|
TranslationBase.of(context).searchAndScanMedication,
|
||||||
|
'assets/images/pharmacy_module/search_scan_icon.png',
|
||||||
|
() {}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,78 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class GridViewCard extends StatelessWidget {
|
||||||
|
final String text;
|
||||||
|
final String cardImage;
|
||||||
|
final Function handler;
|
||||||
|
|
||||||
|
GridViewCard(this.text, this.cardImage, this.handler);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.all(4.0),
|
||||||
|
child: Container(
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(6),
|
||||||
|
child: Texts(
|
||||||
|
text,
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: SizeConfig.textMultiplier * 1.5,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
BorderedButton(
|
||||||
|
TranslationBase.of(context).viewAll,
|
||||||
|
handler: handler,
|
||||||
|
tPadding: 0,
|
||||||
|
bPadding: 0,
|
||||||
|
),
|
||||||
|
Expanded(child: Container()),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.centerRight,
|
||||||
|
child: Image.asset(
|
||||||
|
cardImage,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String getDate(String date) {
|
||||||
|
DateTime dateObj = DateUtil.convertStringToDate(date);
|
||||||
|
return DateUtil.getWeekDay(dateObj.weekday) +
|
||||||
|
", " +
|
||||||
|
dateObj.day.toString() +
|
||||||
|
" " +
|
||||||
|
DateUtil.getMonth(dateObj.month) +
|
||||||
|
" " +
|
||||||
|
dateObj.year.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,233 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PrescriptionViewModel.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/ViewAllHomeWidget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:rating_bar/rating_bar.dart';
|
||||||
|
|
||||||
|
class PrescriptionsWidget extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BaseView<PrescriptionViewModel>(
|
||||||
|
onModelReady: (model) async {
|
||||||
|
if (Provider.of<ProjectViewModel>(context, listen: false).isLogin) {
|
||||||
|
model.getPrescription();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
allowAny: true,
|
||||||
|
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: [
|
||||||
|
ViewAllHomeWidget(
|
||||||
|
TranslationBase.of(context).myPrescription,
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
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,
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
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.black,
|
||||||
|
fontSize: 15.0,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
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(
|
||||||
|
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: 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(),
|
||||||
|
// 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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Container(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/LastVisitedViewModel.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../../final_products_page.dart';
|
||||||
|
import '../ProductTileItem.dart';
|
||||||
|
import 'ViewAllHomeWidget.dart';
|
||||||
|
|
||||||
|
class RecentlyViewedWidget extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BaseView<LastVisitedViewModel>(
|
||||||
|
onModelReady: (model) => model.getLastVisitedProducts(),
|
||||||
|
allowAny: true,
|
||||||
|
builder: (_, model, wi) => NetworkBaseView(
|
||||||
|
isLocalLoader: true,
|
||||||
|
baseViewModel: model,
|
||||||
|
child: Container(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
ViewAllHomeWidget(
|
||||||
|
TranslationBase.of(context).recentlyViewed,
|
||||||
|
FinalProductsPage(
|
||||||
|
id: "",
|
||||||
|
productType: 3,
|
||||||
|
)),
|
||||||
|
Container(
|
||||||
|
height: model.lastVisitedProducts.length > 0
|
||||||
|
? MediaQuery.of(context).size.height / 4 + 20
|
||||||
|
: 0,
|
||||||
|
child: ListView.builder(
|
||||||
|
itemBuilder: (ctx, i) =>
|
||||||
|
ProductTileItem(model.lastVisitedProducts[i]),
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
itemCount: model.lastVisitedProducts.length,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,40 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/BrandViewModel.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../product-brands.dart';
|
||||||
|
import '../manufacturerItem.dart';
|
||||||
|
import 'ViewAllHomeWidget.dart';
|
||||||
|
|
||||||
|
class ShopByBrandWidget extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BaseView<BrandViewModel>(
|
||||||
|
onModelReady: (model) => model.getTopManufacturerList(),
|
||||||
|
allowAny: true,
|
||||||
|
builder: (_, model, wi) => NetworkBaseView(
|
||||||
|
isLocalLoader: true,
|
||||||
|
baseViewModel: model,
|
||||||
|
child: Container(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
ViewAllHomeWidget(
|
||||||
|
TranslationBase.of(context).shopByBrands,
|
||||||
|
ProductBrandsPage()),
|
||||||
|
Container(
|
||||||
|
height: 100,
|
||||||
|
child: ListView.builder(
|
||||||
|
itemBuilder: (ctx, i) =>
|
||||||
|
ManufacturerItem(model.manufacturerList[i]),
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
itemCount: model.manufacturerList.length,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class ViewAllHomeWidget extends StatelessWidget {
|
||||||
|
|
||||||
|
final String title;
|
||||||
|
final Widget navigationWidget;
|
||||||
|
|
||||||
|
|
||||||
|
ViewAllHomeWidget(this.title, this.navigationWidget);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Texts(
|
||||||
|
title,
|
||||||
|
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) =>
|
||||||
|
navigationWidget));
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue