Merge branch 'Fatima-New-Design' into 'development_new_design_2.0'

Fatima new design

See merge request Cloud_Solution/diplomatic-quarter!487
merge-update-with-lab-changes
haroon amjad 4 years ago
commit 75056478fc

@ -494,7 +494,7 @@ const Map localizedValues = {
"lakumPoint": {"en": "Point", "ar": "نقطه"}, "lakumPoint": {"en": "Point", "ar": "نقطه"},
"wishlist": {"en": "Wishlist", "ar": "المفضلة"}, "wishlist": {"en": "Wishlist", "ar": "المفضلة"},
"products": {"en": "Products", "ar": "المنتجات"}, "products": {"en": "Products", "ar": "المنتجات"},
"reviews": {"en": "Reviews", "ar": "التقيمات"}, "reviews": {"en": "Reviews", "ar": "التقييمات"},
"brands": {"en": "Brands", "ar": "العلامات التجارية"}, "brands": {"en": "Brands", "ar": "العلامات التجارية"},
"productDetails": {"en": "Product Details", "ar": "تفاصيل المنتج"}, "productDetails": {"en": "Product Details", "ar": "تفاصيل المنتج"},
"medicationRefill": {"en": "Medication Refill", "ar": "تعبئة الأدوية"}, "medicationRefill": {"en": "Medication Refill", "ar": "تعبئة الأدوية"},

@ -1,9 +1,11 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/models/pharmacy/brandModel.dart'; import 'package:diplomaticquarterapp/models/pharmacy/brandModel.dart';
import 'package:diplomaticquarterapp/models/pharmacy/topBrandsModel.dart'; import 'package:diplomaticquarterapp/models/pharmacy/topBrandsModel.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/brands_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/brands_service.dart';
import '../../../locator.dart'; import '../../../locator.dart';
class BrandsViewModel extends BaseViewModel{ class BrandsViewModel extends BaseViewModel{
@ -22,6 +24,7 @@ class BrandsViewModel extends BaseViewModel{
Future getBrandsData() async { Future getBrandsData() async {
hasError = false; hasError = false;
setState(ViewState.Busy); setState(ViewState.Busy);
await _brandsService.getBrands(); await _brandsService.getBrands();
if (_brandsService.hasError) { if (_brandsService.hasError) {
error = _brandsService.error; error = _brandsService.error;

@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/pages/pharmacies/search_brands_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -34,117 +35,121 @@ class _ProductBrandsPageState extends State<ProductBrandsPage> {
isPharmacy: true, isPharmacy: true,
isShowDecPage: false, isShowDecPage: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: NetworkBaseView(
child: Column( baseViewModel: model,
children: [ isLocalLoader:true,
Container( child: Container(
color: Colors.white, child: Column(
alignment: languageID == 'ar' children: [
? Alignment.topRight Container(
: Alignment.topLeft, color: Colors.white,
padding: languageID == 'ar' alignment: languageID == 'ar'
? EdgeInsets.only(right: 10.0, top: 10.0) ? Alignment.topRight
: EdgeInsets.only(left: 10.0, top: 10.0), : Alignment.topLeft,
child: Text( padding: languageID == 'ar'
TranslationBase.of(context).topBrands, ? EdgeInsets.only(right: 10.0, top: 10.0)
style: TextStyle( : EdgeInsets.only(left: 10.0, top: 10.0),
fontWeight: FontWeight.bold, child: Text(
TranslationBase.of(context).topBrands,
style: TextStyle(
fontWeight: FontWeight.bold,
),
), ),
), ),
), Container(
Container( height: 220,
height: 220, width: double.infinity,
width: double.infinity,
color: Colors.white,
child: topBrand(context),
),
SizedBox(
height: 10,
),
Container(
height: MediaQuery.of(context).size.height * 0.076,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
color: Colors.white, color: Colors.white,
child: topBrand(context),
), ),
child: topBrand(context), SizedBox(
), height: 10,
SizedBox(
height: 10,
),
Container(
height: MediaQuery.of(context).size.height * 0.056,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
color: Colors.white,
), ),
child: InkWell( Container(
child: Padding( height: MediaQuery.of(context).size.height * 0.076,
padding: EdgeInsets.all(8.0), decoration: BoxDecoration(
child: Row( borderRadius: BorderRadius.circular(5.0),
//crossAxisAlignment: CrossAxisAlignment.center, color: Colors.white,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(Icons.search, size: 25.0),
SizedBox(
width: 15.0,
),
Texts(
TranslationBase.of(context).searchProductHere,
fontSize: 13,
)
],
),
), ),
onTap: () { child: topBrand(context),
Navigator.push(
context,
FadePage(page: SearchBrandsPage()),
);
},
), ),
), SizedBox(
SizedBox( height: 10,
height: 10, ),
), Container(
Container( height: MediaQuery.of(context).size.height * 0.066,
height: 250, decoration: BoxDecoration(
width: double.infinity, borderRadius: BorderRadius.circular(5.0),
color: Colors.white, color: Colors.white,
child: ListView.builder( ),
itemCount: model.brandsListList.length, child: InkWell(
itemBuilder: (BuildContext context, int index) { child: Padding(
return InkWell( padding: EdgeInsets.all(8.0),
child: Container( child: Row(
margin: EdgeInsets.only(top: 50, left: 10), //crossAxisAlignment: CrossAxisAlignment.center,
child: Column( mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
mainAxisAlignment: MainAxisAlignment.start, Icon(Icons.search, size: 25.0),
children: [ SizedBox(
languageID == 'ar' width: 15.0,
? Text(model.brandsListList[index].namen)
: Text(model.brandsListList[index].name),
SizedBox(
height: 3,
),
Divider(height: 1, color: Colors.grey)
],
), ),
), Texts(
onTap: () { TranslationBase.of(context).searchProductHere,
Navigator.push( fontSize: 13,
context, )
MaterialPageRoute( ],
builder: (context) => FinalProductsPage( ),
id: model.brandsListList[index].id ),
.toString(), onTap: () {
)), Navigator.push(
); context,
}, FadePage(page: SearchBrandsPage()),
); );
}), },
), ),
], ),
SizedBox(
height: 10,
),
Container(
height: 250,
width: double.infinity,
color: Colors.white,
child: ListView.builder(
itemCount: model.brandsListList.length,
itemBuilder: (BuildContext context, int index) {
return InkWell(
child: Container(
margin: EdgeInsets.only(top: 50, left: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
languageID == 'ar'
? Text(model.brandsListList[index].namen)
: Text(model.brandsListList[index].name),
SizedBox(
height: 3,
),
Divider(height: 1, color: Colors.grey)
],
),
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FinalProductsPage(
id: model.brandsListList[index].id
.toString(),
)),
);
},
);
}),
),
],
),
), ),
), ),
), ),

@ -347,7 +347,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
child: Icon( child: Icon(
Icons.info, Icons.info,
size: 25, size: 25,
color: Color(0xff005aff), color: Color(0xFF4CAF50),
// color: Color(0xff005aff), // color: Color(0xff005aff),
), ),
), ),

@ -18,6 +18,7 @@ import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -90,7 +91,9 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
return BaseView<OrderModelViewModel>( return BaseView<OrderModelViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
GifLoaderDialogUtils.showMyDialog(context);
model.getOrder(customerId, page_id); model.getOrder(customerId, page_id);
GifLoaderDialogUtils.hideDialog(context);
}, },
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
appBarTitle: TranslationBase.of(context).myAccount, appBarTitle: TranslationBase.of(context).myAccount,

@ -129,7 +129,7 @@ class productTile extends StatelessWidget {
), ),
), ),
Text( Text(
'$approvedTotalReviews', '${approvedTotalReviews} ${TranslationBase.of(context).reviews}',
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey, fontSize: 13), style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey, fontSize: 13),
), ),
], ],
@ -159,7 +159,7 @@ class productTile extends StatelessWidget {
icon: Icon( icon: Icon(
Icons.shopping_cart, Icons.shopping_cart,
size: 18, size: 18,
color: Colors.blue, color: Colors.green,
), ),
onPressed: () async { onPressed: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
@ -253,7 +253,8 @@ class productTile extends StatelessWidget {
// alignment: Alignment.topLeft, // alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: '($productReviews reviews)', text: '${productReviews} ${TranslationBase.of(context).reviews}',
// text: '($productReviews reviews)',
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey, fontSize: 13), style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey, fontSize: 13),
), ),
), ),

Loading…
Cancel
Save