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-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 وكلاهما في حالة مزامنة." },
"tamaraInstPlan" : { "en": "Select the tamara installment plan", "ar": "حدد خطة تقسيط تمارة" },
};

@ -466,7 +466,7 @@ class BaseAppClient {
simplePost(
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(String error, int statusCode) onFailure,
}) async {

@ -147,6 +147,18 @@ class OffersAndPackagesServices extends BaseService {
var finished = 0;
var totalCalls = 3;
completedAll(){
finished++;
if(completion != null && finished == totalCalls) {
_hideLoading(context, showLoading);
completion();
}
}
_showLoading(context, showLoading);
final auth_token = await baseAppClient.generatePackagesToken();
if(auth_token == null){
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
// # 1
getBestSellers(request: OffersProductsRequestModel(), context: context, showLoading: false).then((value){
@ -283,7 +283,7 @@ class OffersAndPackagesServices extends BaseService {
var jsonResponse = json.decode(stringResponse);
var jsonCartItem = jsonResponse["shopping_carts"][0];
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){
_hideLoading(context, showLoading);
@ -334,19 +334,18 @@ class OffersAndPackagesServices extends BaseService {
// --------------------
// 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;
var jsonBody = <String,dynamic>{
"order": {
"customer_id" : customer.id,
"billing_address": {
"email": patientUser.emailAddress,
"phone_number": patientUser.mobileNumber
},
}
Map<dynamic,dynamic> jsonBody = {
"customer_id" : customer.id,
"billing_address": {
"email": patientUser.emailAddress,
"phone_number": patientUser.mobileNumber
},
};
jsonBody.addAll(paymentParams);
jsonBody = {'order' : jsonBody};
int order_id;
_showLoading(context, showLoading);

@ -87,7 +87,7 @@ class _PackagesCartPageState extends State<PackagesCartPage>
'Failed to place order, please try again later');
}
}).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 {
viewModel.service.getOrderById(orderId, context: context).then((value) {
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}";
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => PackageOrderCompletedPage(
@ -231,7 +231,7 @@ class _PackagesCartPageState extends State<PackagesCartPage>
// /* Payment Footer Widgets */
// ---------------------------
String _selectedPaymentMethod;
Map _selectedPaymentParams;
Map<dynamic,dynamic> _selectedPaymentParams;
Widget _paymentOptions(BuildContext context, Function(String) onSelected, {PackagesViewModel viewModel}) {
double height = 30;
@ -258,7 +258,7 @@ Widget _paymentOptions(BuildContext context, Function(String) onSelected, {Packa
Future<String> selectTamaraPaymentOption() async{
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;
}
@ -271,13 +271,16 @@ Widget _paymentOptions(BuildContext context, Function(String) onSelected, {Packa
mainAxisAlignment: MainAxisAlignment.center,
children: [
InkWell(
child: buttonContent(_selectedPaymentMethod == "tamara", 'mada.png'),
child: buttonContent(_selectedPaymentMethod == "tamara", 'tamara.png'),
onTap: () async{
final tamara_option = await selectTamaraPaymentOption();
_selectedPaymentParams = {"channel" : "Web", "payment_method_system_name" : "Payments.Tamara", "payment_option" : tamara_option};
onSelected("tamara");
},
),
SizedBox(
width: 5,
),
InkWell(
child: buttonContent(_selectedPaymentMethod == "mada", 'mada.png'),
onTap: () {
@ -305,17 +308,17 @@ Widget _paymentOptions(BuildContext context, Function(String) onSelected, {Packa
onSelected("mastercard");
},
),
SizedBox(
width: 5,
),
InkWell(
child: buttonContent(
_selectedPaymentMethod == "installment", 'installment.png'),
onTap: () {
_selectedPaymentParams = {"payment_method_system_name" : "Payments.PayFort", "payment_option" : "INSTALLMENT"};
onSelected("installment");
},
),
// SizedBox(
// width: 5,
// ),
// InkWell(
// child: buttonContent(
// _selectedPaymentMethod == "installment", 'installment.png'),
// onTap: () {
// _selectedPaymentParams = {"payment_method_system_name" : "Payments.PayFort", "payment_option" : "INSTALLMENT"};
// onSelected("installment");
// },
// ),
],
),
),

@ -98,7 +98,7 @@ class _PackagesHomePageState extends State<PackagesHomePage> with AfterLayoutMix
await viewModel.service.addProductToCart(request, context: context).then((response){
appScaffold.appBar.badgeUpdater(viewModel.service.cartItemCount);
}).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 androidInstructions4 => localizedValues["android-instructions-4"][locale.languageCode];
String get tamaraInstPlan => localizedValues["tamaraInstPlan"][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

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

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

Loading…
Cancel
Save