fix loader issue and design

merge-update-with-lab-changes
Fatimah Alshammari 4 years ago
parent 6f63250252
commit 23acdfd494

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

@ -4,8 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/models/pharmacy/brandModel.dart';
import 'package:diplomaticquarterapp/models/pharmacy/topBrandsModel.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/brands_service.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import '../../../locator.dart';
@ -25,28 +24,19 @@ class BrandsViewModel extends BaseViewModel{
Future getBrandsData() async {
hasError = false;
setState(ViewState.Busy);
// GifLoaderDialogUtils.showMyDialog(
// AppGlobal.context);
await _brandsService.getBrands();
// GifLoaderDialogUtils.hideDialog(
// AppGlobal.context);
if (_brandsService.hasError) {
error = _brandsService.error;
setState(ViewState.ErrorLocal);
} else
// GifLoaderDialogUtils.hideDialog(
// locator<NavigationService>().navigatorKey.currentContext);
setState(ViewState.Idle);
}
Future getTopBrandsData() async {
hasError = false;
setState(ViewState.Busy);
GifLoaderDialogUtils.showMyDialog(
AppGlobal.context);
await _topBrandsService.getTopBrands();
GifLoaderDialogUtils.hideDialog(
AppGlobal.context);
if (_topBrandsService.hasError) {
error = _topBrandsService.error;
setState(ViewState.ErrorLocal);

@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/pages/pharmacies/search_brands_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_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
@ -34,117 +35,121 @@ class _ProductBrandsPageState extends State<ProductBrandsPage> {
isPharmacy: true,
isShowDecPage: false,
body: SingleChildScrollView(
child: Container(
child: Column(
children: [
Container(
color: Colors.white,
alignment: languageID == 'ar'
? Alignment.topRight
: Alignment.topLeft,
padding: languageID == 'ar'
? EdgeInsets.only(right: 10.0, top: 10.0)
: EdgeInsets.only(left: 10.0, top: 10.0),
child: Text(
TranslationBase.of(context).topBrands,
style: TextStyle(
fontWeight: FontWeight.bold,
child: NetworkBaseView(
baseViewModel: model,
isLocalLoader:true,
child: Container(
child: Column(
children: [
Container(
color: Colors.white,
alignment: languageID == 'ar'
? Alignment.topRight
: Alignment.topLeft,
padding: languageID == 'ar'
? EdgeInsets.only(right: 10.0, top: 10.0)
: EdgeInsets.only(left: 10.0, top: 10.0),
child: Text(
TranslationBase.of(context).topBrands,
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
),
),
Container(
height: 220,
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),
Container(
height: 220,
width: double.infinity,
color: Colors.white,
child: topBrand(context),
),
child: topBrand(context),
),
SizedBox(
height: 10,
),
Container(
height: MediaQuery.of(context).size.height * 0.056,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
color: Colors.white,
SizedBox(
height: 10,
),
child: InkWell(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Row(
//crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(Icons.search, size: 25.0),
SizedBox(
width: 15.0,
),
Texts(
TranslationBase.of(context).searchProductHere,
fontSize: 13,
)
],
),
Container(
height: MediaQuery.of(context).size.height * 0.076,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
color: Colors.white,
),
onTap: () {
Navigator.push(
context,
FadePage(page: SearchBrandsPage()),
);
},
child: topBrand(context),
),
),
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)
],
SizedBox(
height: 10,
),
Container(
height: MediaQuery.of(context).size.height * 0.066,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
color: Colors.white,
),
child: InkWell(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Row(
//crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(Icons.search, size: 25.0),
SizedBox(
width: 15.0,
),
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FinalProductsPage(
id: model.brandsListList[index].id
.toString(),
)),
);
},
Texts(
TranslationBase.of(context).searchProductHere,
fontSize: 13,
)
],
),
),
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(
Icons.info,
size: 25,
color: Color(0xff005aff),
color: Color(0xFF4CAF50),
// 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/uitl/app_shared_preferences.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/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -90,7 +91,9 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
return BaseView<OrderModelViewModel>(
onModelReady: (model) async {
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
GifLoaderDialogUtils.showMyDialog(context);
model.getOrder(customerId, page_id);
GifLoaderDialogUtils.hideDialog(context);
},
builder: (_, model, wi) => AppScaffold(
appBarTitle: TranslationBase.of(context).myAccount,

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

Loading…
Cancel
Save