no message

merge-update-with-lab-changes
Zohaib Iqbal Kambrani 4 years ago
parent 4c5b9b4244
commit 9d71793e88

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

@ -1603,4 +1603,5 @@ const Map localizedValues = {
"android-instructions-2": { "en": "Make sure that you have installed your watch related apps from Google PlayStore.", "ar": "تأكد من أنك قمت بتثبيت التطبيقات المتعلقة بالساعات من Google PlayStore." }, "android-instructions-2": { "en": "Make sure that you have installed your watch related apps from Google PlayStore.", "ar": "تأكد من أنك قمت بتثبيت التطبيقات المتعلقة بالساعات من Google PlayStore." },
"android-instructions-3": { "en": "Make sure that your Smart Watch is connected with the WearOS app & your watch apps.", "ar": "تأكد من أن ساعتك الذكية متصلة بتطبيق WearOS وتطبيقات ساعتك." }, "android-instructions-3": { "en": "Make sure that your Smart Watch is connected with the WearOS app & your watch apps.", "ar": "تأكد من أن ساعتك الذكية متصلة بتطبيق WearOS وتطبيقات ساعتك." },
"android-instructions-4": { "en": "Make sure that your smart watch apps are linked/associated with Google Fit App.", "ar": "تأكد من أن تطبيقات ساعتك الذكية مرتبطة / مرتبطة بتطبيق Google Fit." }, "android-instructions-5": { "en": "Make sure that data like heart rate, steps, distance etc. are being shown on your watch app & on Google Fit app & both are in sync.", "ar": "تأكد من عرض بيانات مثل معدل ضربات القلب والخطوات والمسافة وما إلى ذلك على تطبيق الساعة وعلى تطبيق Google Fit وكلاهما في حالة مزامنة." }, "android-instructions-4": { "en": "Make sure that your smart watch apps are linked/associated with Google Fit App.", "ar": "تأكد من أن تطبيقات ساعتك الذكية مرتبطة / مرتبطة بتطبيق Google Fit." }, "android-instructions-5": { "en": "Make sure that data like heart rate, steps, distance etc. are being shown on your watch app & on Google Fit app & both are in sync.", "ar": "تأكد من عرض بيانات مثل معدل ضربات القلب والخطوات والمسافة وما إلى ذلك على تطبيق الساعة وعلى تطبيق Google Fit وكلاهما في حالة مزامنة." },
"tamaraInstPlan" : { "en": "Select the tamara installment plan", "ar": "حدد خطة تقسيط تمارة" },
}; };

@ -466,7 +466,7 @@ class BaseAppClient {
simplePost( simplePost(
String fullUrl, { String fullUrl, {
Map<String, dynamic> body, Map<String, String> headers, Map<dynamic, dynamic> body, Map<String, String> headers,
Function(dynamic response, int statusCode) onSuccess, Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure, Function(String error, int statusCode) onFailure,
}) async { }) async {

@ -147,6 +147,18 @@ class OffersAndPackagesServices extends BaseService {
var finished = 0; var finished = 0;
var totalCalls = 3; var totalCalls = 3;
completedAll(){
finished++;
if(completion != null && finished == totalCalls) {
_hideLoading(context, showLoading);
completion();
}
}
_showLoading(context, showLoading);
final auth_token = await baseAppClient.generatePackagesToken(); final auth_token = await baseAppClient.generatePackagesToken();
if(auth_token == null){ if(auth_token == null){
throw 'Something went wrong while authentication, Please try again letter'; throw 'Something went wrong while authentication, Please try again letter';
@ -162,18 +174,6 @@ class OffersAndPackagesServices extends BaseService {
} }
} }
completedAll(){
finished++;
if(completion != null && finished == totalCalls) {
_hideLoading(context, showLoading);
completion();
}
}
_showLoading(context, showLoading);
// Performing Parallel Request on same time // Performing Parallel Request on same time
// # 1 // # 1
getBestSellers(request: OffersProductsRequestModel(), context: context, showLoading: false).then((value){ getBestSellers(request: OffersProductsRequestModel(), context: context, showLoading: false).then((value){
@ -283,7 +283,7 @@ class OffersAndPackagesServices extends BaseService {
var jsonResponse = json.decode(stringResponse); var jsonResponse = json.decode(stringResponse);
var jsonCartItem = jsonResponse["shopping_carts"][0]; var jsonCartItem = jsonResponse["shopping_carts"][0];
response = ResponseModel(status: true, data: PackagesCartItemsResponseModel.fromJson(jsonCartItem), error: null); response = ResponseModel(status: true, data: PackagesCartItemsResponseModel.fromJson(jsonCartItem), error: null);
cartItemCount = response.data.quantity.toString(); cartItemCount = (jsonResponse['count'] ?? 0).toString();
}, onFailure: (String error, int statusCode){ }, onFailure: (String error, int statusCode){
_hideLoading(context, showLoading); _hideLoading(context, showLoading);
@ -334,19 +334,18 @@ class OffersAndPackagesServices extends BaseService {
// -------------------- // --------------------
// Place Order // Place Order
// -------------------- // --------------------
Future placeOrder({@required Map paymentParams, @required BuildContext context, bool showLoading = true}) async{ Future placeOrder({@required Map<dynamic,dynamic> paymentParams, @required BuildContext context, bool showLoading = true}) async{
Future errorThrow; Future errorThrow;
var jsonBody = <String,dynamic>{ Map<dynamic,dynamic> jsonBody = {
"order": { "customer_id" : customer.id,
"customer_id" : customer.id, "billing_address": {
"billing_address": { "email": patientUser.emailAddress,
"email": patientUser.emailAddress, "phone_number": patientUser.mobileNumber
"phone_number": patientUser.mobileNumber },
},
}
}; };
jsonBody.addAll(paymentParams); jsonBody.addAll(paymentParams);
jsonBody = {'order' : jsonBody};
int order_id; int order_id;
_showLoading(context, showLoading); _showLoading(context, showLoading);

@ -87,7 +87,7 @@ class _PackagesCartPageState extends State<PackagesCartPage>
'Failed to place order, please try again later'); 'Failed to place order, please try again later');
} }
}).catchError((error) { }).catchError((error) {
utils.Utils.showErrorToast(error); utils.Utils.showErrorToast(error.toString());
}); });
} }
@ -217,7 +217,7 @@ class _PackagesCartPageState extends State<PackagesCartPage>
{@required int orderId, @required bool withStatus, dynamic data}) async { {@required int orderId, @required bool withStatus, dynamic data}) async {
viewModel.service.getOrderById(orderId, context: context).then((value) { viewModel.service.getOrderById(orderId, context: context).then((value) {
var heading = withStatus ? "Success" : "Failed"; var heading = withStatus ? "Success" : "Failed";
var title = "Your order has been placed successfully"; var title = withStatus ? "Your order has been placed successfully" : "Failed to place your order";
var subTitle = "Order# ${value.data.customOrderNumber}"; var subTitle = "Order# ${value.data.customOrderNumber}";
Navigator.of(context).pushReplacement(MaterialPageRoute( Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => PackageOrderCompletedPage( builder: (context) => PackageOrderCompletedPage(
@ -231,7 +231,7 @@ class _PackagesCartPageState extends State<PackagesCartPage>
// /* Payment Footer Widgets */ // /* Payment Footer Widgets */
// --------------------------- // ---------------------------
String _selectedPaymentMethod; String _selectedPaymentMethod;
Map _selectedPaymentParams; Map<dynamic,dynamic> _selectedPaymentParams;
Widget _paymentOptions(BuildContext context, Function(String) onSelected, {PackagesViewModel viewModel}) { Widget _paymentOptions(BuildContext context, Function(String) onSelected, {PackagesViewModel viewModel}) {
double height = 30; double height = 30;
@ -258,7 +258,7 @@ Widget _paymentOptions(BuildContext context, Function(String) onSelected, {Packa
Future<String> selectTamaraPaymentOption() async{ Future<String> selectTamaraPaymentOption() async{
final tamara_options = await viewModel.service.getTamaraOptions(context: context, showLoading: true); final tamara_options = await viewModel.service.getTamaraOptions(context: context, showLoading: true);
final selected = await SingleSelectionDialog<TamaraPaymentOption>(tamara_options, title: 'Select the tamara installment plan').show(context); final selected = await SingleSelectionDialog<TamaraPaymentOption>(tamara_options, icon: Image.asset('assets/images/new-design/tamara.png'), title: TranslationBase.of(context).tamaraInstPlan).show(context);
return selected.name; return selected.name;
} }
@ -271,13 +271,16 @@ Widget _paymentOptions(BuildContext context, Function(String) onSelected, {Packa
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
InkWell( InkWell(
child: buttonContent(_selectedPaymentMethod == "tamara", 'mada.png'), child: buttonContent(_selectedPaymentMethod == "tamara", 'tamara.png'),
onTap: () async{ onTap: () async{
final tamara_option = await selectTamaraPaymentOption(); final tamara_option = await selectTamaraPaymentOption();
_selectedPaymentParams = {"channel" : "Web", "payment_method_system_name" : "Payments.Tamara", "payment_option" : tamara_option}; _selectedPaymentParams = {"channel" : "Web", "payment_method_system_name" : "Payments.Tamara", "payment_option" : tamara_option};
onSelected("tamara"); onSelected("tamara");
}, },
), ),
SizedBox(
width: 5,
),
InkWell( InkWell(
child: buttonContent(_selectedPaymentMethod == "mada", 'mada.png'), child: buttonContent(_selectedPaymentMethod == "mada", 'mada.png'),
onTap: () { onTap: () {
@ -305,17 +308,17 @@ Widget _paymentOptions(BuildContext context, Function(String) onSelected, {Packa
onSelected("mastercard"); onSelected("mastercard");
}, },
), ),
SizedBox( // SizedBox(
width: 5, // width: 5,
), // ),
InkWell( // InkWell(
child: buttonContent( // child: buttonContent(
_selectedPaymentMethod == "installment", 'installment.png'), // _selectedPaymentMethod == "installment", 'installment.png'),
onTap: () { // onTap: () {
_selectedPaymentParams = {"payment_method_system_name" : "Payments.PayFort", "payment_option" : "INSTALLMENT"}; // _selectedPaymentParams = {"payment_method_system_name" : "Payments.PayFort", "payment_option" : "INSTALLMENT"};
onSelected("installment"); // onSelected("installment");
}, // },
), // ),
], ],
), ),
), ),

@ -98,7 +98,7 @@ class _PackagesHomePageState extends State<PackagesHomePage> with AfterLayoutMix
await viewModel.service.addProductToCart(request, context: context).then((response){ await viewModel.service.addProductToCart(request, context: context).then((response){
appScaffold.appBar.badgeUpdater(viewModel.service.cartItemCount); appScaffold.appBar.badgeUpdater(viewModel.service.cartItemCount);
}).catchError((error) { }).catchError((error) {
utils.Utils.showErrorToast(error); utils.Utils.showErrorToast(error.toString());
}); });
} }
} }

@ -2563,6 +2563,8 @@ class TranslationBase {
String get androidInstructions3 => localizedValues["android-instructions-3"][locale.languageCode]; String get androidInstructions3 => localizedValues["android-instructions-3"][locale.languageCode];
String get androidInstructions4 => localizedValues["android-instructions-4"][locale.languageCode]; String get androidInstructions4 => localizedValues["android-instructions-4"][locale.languageCode];
String get tamaraInstPlan => localizedValues["tamaraInstPlan"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -110,7 +110,7 @@ class RadioSelectionDialogState extends State<RadioSelectionDialog> {
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).save, TranslationBase.of(context).save,
() { (){
Navigator.pop(context); Navigator.pop(context);
widget.onValueSelected(selectedIndex); widget.onValueSelected(selectedIndex);
}, },

@ -13,8 +13,9 @@ import 'package:permission_handler/permission_handler.dart';
class SingleSelectionDialog<T> extends StatefulWidget { class SingleSelectionDialog<T> extends StatefulWidget {
final List<T> items; final List<T> items;
final String title; final String title;
final Widget icon;
SingleSelectionDialog(this.items, {Widget icon, @required this.title}); SingleSelectionDialog(this.items, {@required this.icon, @required this.title});
Future<T> show(BuildContext context) async { Future<T> show(BuildContext context) async {
return showDialog<T>( return showDialog<T>(
@ -32,6 +33,7 @@ class SingleSelectionDialog<T> extends StatefulWidget {
@override @override
_SingleSelectionDialogState createState() => _SingleSelectionDialogState(); _SingleSelectionDialogState createState() => _SingleSelectionDialogState();
} }
class _SingleSelectionDialogState extends State<SingleSelectionDialog> { class _SingleSelectionDialogState extends State<SingleSelectionDialog> {
@ -51,11 +53,12 @@ class _SingleSelectionDialogState extends State<SingleSelectionDialog> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Icon(
Icons.notifications_active, SizedBox(
color: Color(0xff2B353E), height: 40,
size: 50, child: widget.icon,
), ),
IconButton( IconButton(
icon: Icon(Icons.clear), icon: Icon(Icons.clear),
color: Color(0xff2B353E), color: Color(0xff2B353E),
@ -95,33 +98,33 @@ class _SingleSelectionDialogState extends State<SingleSelectionDialog> {
} }
Widget optionList(List<dynamic> options){ Widget optionList(List<dynamic> options){
return ListView( return ListView.builder(
shrinkWrap: true, shrinkWrap: true,
children: List.generate(options.length, (index){ itemCount: options.length,
itemBuilder: (ctx,idx){
final opt = options[index]; final opt = options[idx];
return Row( return Row(
children: [ children: [
Radio<int>( Radio<int>(
value: index, value: idx,
groupValue: i, groupValue: i,
onChanged: (int value) { onChanged: (int value) {
setState(() { setState(() {
i = value; i = value;
}); });
}, },
),
Text(
opt.toString(),
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
), ),
), Text(
], opt.toString(),
); style: TextStyle(
}), fontSize: 12,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
),
],
);
}
); );
} }
} }

Loading…
Cancel
Save