Null safety
This commit is contained in:
parent
e22c4a5228
commit
be31e0c9da
|
|
@ -973,7 +973,6 @@ abstract class GatewayEntity extends Object
|
|||
return 'https://dashboard.stripe.com/sources/$transactionReference';
|
||||
else
|
||||
return 'https://dashboard.stripe.com/payments/$transactionReference';
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1447,12 +1447,13 @@ abstract class InvoiceEntity extends Object
|
|||
return taxes;
|
||||
}
|
||||
|
||||
void _calculateTax(Map<String, Map<String, dynamic>> map, String name,
|
||||
double rate, double amount, double paid) {
|
||||
if (amount == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
void _calculateTax(
|
||||
Map<String, Map<String, dynamic>> map,
|
||||
String name,
|
||||
double rate,
|
||||
double amount,
|
||||
double paid,
|
||||
) {
|
||||
final key = rate.toString() + ' ' + name;
|
||||
|
||||
map.putIfAbsent(
|
||||
|
|
|
|||
|
|
@ -329,7 +329,7 @@ abstract class PaymentEntity extends Object
|
|||
case PaymentFields.type:
|
||||
final typeA = paymentTypeMap![paymentA!.typeId] ?? PaymentTypeEntity();
|
||||
final typeB = paymentTypeMap[paymentB!.typeId] ?? PaymentTypeEntity();
|
||||
return typeA.name.toLowerCase().compareTo(typeB.name.toLowerCase());
|
||||
response = typeA.name.toLowerCase().compareTo(typeB.name.toLowerCase());
|
||||
break;
|
||||
case EntityFields.assignedTo:
|
||||
final userA = userMap![paymentA!.assignedUserId] ?? UserEntity();
|
||||
|
|
|
|||
|
|
@ -98,10 +98,10 @@ class VendorOverview extends StatelessWidget {
|
|||
memoizedCalculateVendorBalance(vendor.id, vendor.currencyId,
|
||||
state.expenseState.map, state.expenseState.list),
|
||||
context,
|
||||
currencyId: vendor.currencyId ?? company.currencyId),
|
||||
currencyId: vendor.currencyId),
|
||||
),
|
||||
ListDivider(),
|
||||
if ((vendor.privateNotes ?? '').isNotEmpty) ...[
|
||||
if (vendor.privateNotes.isNotEmpty) ...[
|
||||
IconMessage(vendor.privateNotes,
|
||||
iconData: Icons.lock, copyToClipboard: true),
|
||||
ListDivider()
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ String toSpaceCase(String value) {
|
|||
}
|
||||
|
||||
String toTitleCase(String text) {
|
||||
if ((text ?? '').isEmpty) {
|
||||
if (text.isEmpty) {
|
||||
return '';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,10 @@ class WebUtils {
|
|||
final loginRequest = PopupRequest()..scopes = ['user.read'];
|
||||
|
||||
publicClientApp.loginPopup(loginRequest).then((result) {
|
||||
succesCallback(result.idToken ?? '', result.accessToken ?? '');
|
||||
succesCallback(
|
||||
result.idToken,
|
||||
result.accessToken,
|
||||
);
|
||||
}).catchError((dynamic error) {
|
||||
failureCallback(error);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue