diff --git a/lib/data/models/company_model.dart b/lib/data/models/company_model.dart index a4f77be5d..9d9e2aa44 100644 --- a/lib/data/models/company_model.dart +++ b/lib/data/models/company_model.dart @@ -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; } diff --git a/lib/data/models/invoice_model.dart b/lib/data/models/invoice_model.dart index 0fa89367b..c50bc6bfe 100644 --- a/lib/data/models/invoice_model.dart +++ b/lib/data/models/invoice_model.dart @@ -1447,12 +1447,13 @@ abstract class InvoiceEntity extends Object return taxes; } - void _calculateTax(Map> map, String name, - double rate, double amount, double paid) { - if (amount == null) { - return; - } - + void _calculateTax( + Map> map, + String name, + double rate, + double amount, + double paid, + ) { final key = rate.toString() + ' ' + name; map.putIfAbsent( diff --git a/lib/data/models/payment_model.dart b/lib/data/models/payment_model.dart index 3c1e4b6cf..c85ec03f5 100644 --- a/lib/data/models/payment_model.dart +++ b/lib/data/models/payment_model.dart @@ -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(); diff --git a/lib/ui/vendor/view/vendor_view_overview.dart b/lib/ui/vendor/view/vendor_view_overview.dart index 7ca34f010..c069fe1a1 100644 --- a/lib/ui/vendor/view/vendor_view_overview.dart +++ b/lib/ui/vendor/view/vendor_view_overview.dart @@ -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() diff --git a/lib/utils/strings.dart b/lib/utils/strings.dart index 4beba28fa..2bd87d52c 100644 --- a/lib/utils/strings.dart +++ b/lib/utils/strings.dart @@ -43,7 +43,7 @@ String toSpaceCase(String value) { } String toTitleCase(String text) { - if ((text ?? '').isEmpty) { + if (text.isEmpty) { return ''; } diff --git a/lib/utils/web.dart b/lib/utils/web.dart index 1c375ea3e..4a3454136 100644 --- a/lib/utils/web.dart +++ b/lib/utils/web.dart @@ -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); });