small changes to tools.dart
This commit is contained in:
parent
d403225743
commit
9d57663115
@ -38,9 +38,8 @@ appWooSignal(Function(WooSignal) api) async {
|
|||||||
return await api(wooSignal);
|
return await api(wooSignal);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<PaymentType> getPaymentTypes() {
|
List<PaymentType> getPaymentTypes() =>
|
||||||
return arrPaymentMethods.where((v) => v != null).toList();
|
arrPaymentMethods.where((v) => v != null).toList();
|
||||||
}
|
|
||||||
|
|
||||||
PaymentType addPayment(PaymentType paymentType) {
|
PaymentType addPayment(PaymentType paymentType) {
|
||||||
return app_payment_methods.contains(paymentType.name) ? paymentType : null;
|
return app_payment_methods.contains(paymentType.name) ? paymentType : null;
|
||||||
@ -424,17 +423,12 @@ showPlatformAlertDialog(BuildContext context,
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
DateTime parseDateTime(String strDate) {
|
DateTime parseDateTime(String strDate) => DateTime.parse(strDate);
|
||||||
return DateTime.parse(strDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
DateFormat formatDateTime(String format) {
|
DateFormat formatDateTime(String format) => DateFormat(format);
|
||||||
return DateFormat(format);
|
|
||||||
}
|
|
||||||
|
|
||||||
String dateFormatted({@required String date, @required String formatType}) {
|
String dateFormatted({@required String date, @required String formatType}) =>
|
||||||
return formatDateTime(formatType).format(parseDateTime(date));
|
formatDateTime(formatType).format(parseDateTime(date));
|
||||||
}
|
|
||||||
|
|
||||||
enum FormatType {
|
enum FormatType {
|
||||||
DateTime,
|
DateTime,
|
||||||
@ -512,7 +506,8 @@ Widget refreshableScroll(context,
|
|||||||
index: index, product: products[index], onTap: onTap);
|
index: index, product: products[index], onTap: onTap);
|
||||||
},
|
},
|
||||||
))
|
))
|
||||||
: wsNoResults(context)));
|
: wsNoResults(context)),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
class UserAuth {
|
class UserAuth {
|
||||||
|
|||||||
@ -39,14 +39,13 @@ class CustomerAddress {
|
|||||||
emailAddress = "";
|
emailAddress = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasMissingFields() {
|
bool hasMissingFields() =>
|
||||||
return (this.firstName.isEmpty ||
|
(this.firstName.isEmpty ||
|
||||||
this.lastName.isEmpty ||
|
this.lastName.isEmpty ||
|
||||||
this.addressLine.isEmpty ||
|
this.addressLine.isEmpty ||
|
||||||
this.city.isEmpty ||
|
this.city.isEmpty ||
|
||||||
this.postalCode.isEmpty) &&
|
this.postalCode.isEmpty) ||
|
||||||
(this.country == "United States" ? this.state.isEmpty : false);
|
(this.country == "United States" ? this.state.isEmpty : false);
|
||||||
}
|
|
||||||
|
|
||||||
String addressFull() {
|
String addressFull() {
|
||||||
List<String> tmpArrAddress = new List<String>();
|
List<String> tmpArrAddress = new List<String>();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user