Null safety
This commit is contained in:
parent
c639ac4098
commit
d32bab8378
|
|
@ -950,7 +950,7 @@ abstract class GatewayEntity extends Object
|
|||
|
||||
for (var i = 0; i < gatewayIds.length; i++) {
|
||||
final gatewayTypeId = gatewayIds[i];
|
||||
final gatewayType = localization!.lookup(kGatewayTypes[gatewayTypeId])!;
|
||||
final gatewayType = localization!.lookup(kGatewayTypes[gatewayTypeId]);
|
||||
|
||||
if (gatewayType.toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
|
|
@ -978,7 +978,7 @@ abstract class GatewayEntity extends Object
|
|||
|
||||
for (var i = 0; i < gatewayIds.length; i++) {
|
||||
final gatewayTypeId = gatewayIds[i];
|
||||
final gatewayType = localization!.lookup(kGatewayTypes[gatewayTypeId])!;
|
||||
final gatewayType = localization!.lookup(kGatewayTypes[gatewayTypeId]);
|
||||
|
||||
if (gatewayType.toLowerCase().contains(filter)) {
|
||||
return gatewayType;
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ abstract class ScheduleEntity extends Object
|
|||
@override
|
||||
String get listDisplayName {
|
||||
final localization = AppLocalization.of(navigatorKey.currentContext!)!;
|
||||
return localization.lookup(template) ?? '';
|
||||
return localization.lookup(template);
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
|||
|
|
@ -404,7 +404,7 @@ void handleProductAction(
|
|||
children: kTaxCategories.keys.map((taxCategoryId) {
|
||||
final taxCategory = kTaxCategories[taxCategoryId];
|
||||
return SimpleDialogOption(
|
||||
child: Text(localization.lookup(taxCategory)!),
|
||||
child: Text(localization.lookup(taxCategory)),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
store.dispatch(SetTaxCategoryProductsRequest(
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class FieldGrid extends StatelessWidget {
|
|||
children: <Widget>[
|
||||
Flexible(
|
||||
child: Text(
|
||||
localization!.lookup(field)!,
|
||||
localization!.lookup(field),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: textColor!.withOpacity(.65),
|
||||
|
|
|
|||
|
|
@ -58,8 +58,7 @@ class ActionMenuButton extends StatelessWidget {
|
|||
SizedBox(width: 16.0),
|
||||
Expanded(
|
||||
child: Text(
|
||||
AppLocalization.of(context)!.lookup(action.toString()) ??
|
||||
''),
|
||||
AppLocalization.of(context)!.lookup(action.toString())),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -156,9 +156,9 @@ class _AppBottomBarState extends State<AppBottomBar> {
|
|||
children: EntityState.values.map<Widget>((state) {
|
||||
return CheckboxListTile(
|
||||
key: ValueKey('state_' +
|
||||
AppLocalization.of(context)!.lookup('$state')!),
|
||||
AppLocalization.of(context)!.lookup('$state')),
|
||||
title:
|
||||
Text(AppLocalization.of(context)!.lookup('$state')!),
|
||||
Text(AppLocalization.of(context)!.lookup('$state')),
|
||||
controlAffinity: ListTileControlAffinity.leading,
|
||||
value: stateFilters.contains(state),
|
||||
activeColor: Theme.of(context).colorScheme.secondary,
|
||||
|
|
@ -199,7 +199,7 @@ class _AppBottomBarState extends State<AppBottomBar> {
|
|||
return CheckboxListTile(
|
||||
key: Key(status.toString()),
|
||||
title: Text(
|
||||
AppLocalization.of(context)!.lookup(status.name)!),
|
||||
AppLocalization.of(context)!.lookup(status.name)),
|
||||
controlAffinity: ListTileControlAffinity.leading,
|
||||
value: statusFilters.contains(status),
|
||||
activeColor: Theme.of(context).colorScheme.secondary,
|
||||
|
|
@ -245,7 +245,7 @@ class _AppBottomBarState extends State<AppBottomBar> {
|
|||
child: RadioListTile<String>(
|
||||
dense: true,
|
||||
title: Text(
|
||||
AppLocalization.of(context)!.lookup(sortField)!),
|
||||
AppLocalization.of(context)!.lookup(sortField)),
|
||||
subtitle: sortField == listUIState.sortField
|
||||
? Text(listUIState.sortAscending
|
||||
? AppLocalization.of(context)!.ascending
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@ class AutobillDropdownMenuItem extends StatelessWidget {
|
|||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(localization.lookup(type)!),
|
||||
Text(localization.lookup(type)),
|
||||
Text(
|
||||
localization.lookup('auto_bill_help_' + type)!,
|
||||
localization.lookup('auto_bill_help_' + type),
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class BottomButtons extends StatelessWidget {
|
|||
Icon(getEntityActionIcon(action1)),
|
||||
SizedBox(width: 12),
|
||||
Text(
|
||||
localization.lookup('$action1')!,
|
||||
localization.lookup('$action1'),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: textColor.withOpacity(
|
||||
|
|
@ -84,7 +84,7 @@ class BottomButtons extends StatelessWidget {
|
|||
Icon(getEntityActionIcon(action2)),
|
||||
SizedBox(width: 12),
|
||||
Text(
|
||||
localization.lookup('$action2')!,
|
||||
localization.lookup('$action2'),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: textColor.withOpacity(
|
||||
|
|
|
|||
|
|
@ -98,9 +98,9 @@ class MultiSelectListState extends State<MultiSelectList> {
|
|||
if (parts.length == 1 || parts[0] == widget.prefix) {
|
||||
return localization!.lookup(parts.last);
|
||||
} else {
|
||||
return localization!.lookup(parts[0])! +
|
||||
return localization!.lookup(parts[0])+
|
||||
' ' +
|
||||
localization.lookup(parts[1])!;
|
||||
localization.lookup(parts[1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,8 @@ class EditScaffold extends StatelessWidget {
|
|||
if (account.trialDaysLeft <= 1) {
|
||||
upgradeMessage = localization.freeTrialEndsToday;
|
||||
} else {
|
||||
upgradeMessage = localization.freeTrialEndsInDays.replaceFirst(':count', account.trialDaysLeft.toString());
|
||||
upgradeMessage = localization.freeTrialEndsInDays
|
||||
.replaceFirst(':count', account.trialDaysLeft.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -306,9 +307,7 @@ class EditScaffold extends StatelessWidget {
|
|||
.secondary),
|
||||
SizedBox(width: 16.0),
|
||||
Text(AppLocalization.of(context)!
|
||||
.lookup(
|
||||
action.toString()) ??
|
||||
''),
|
||||
.lookup(action.toString())),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
@ -451,8 +450,7 @@ class EditScaffold extends StatelessWidget {
|
|||
SizedBox(width: 16.0),
|
||||
Text(AppLocalization.of(
|
||||
context)!
|
||||
.lookup(
|
||||
action.toString())!),
|
||||
.lookup(action.toString())),
|
||||
],
|
||||
),
|
||||
value: action,
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class EntityActionListTile extends StatelessWidget {
|
|||
return ListTile(
|
||||
leading: Icon(getEntityActionIcon(action)),
|
||||
title: Text(
|
||||
localization.lookup(action.toString())!,
|
||||
localization.lookup(action.toString()),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
onTap: () {
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class EntityStatusChip extends StatelessWidget {
|
|||
return SizedBox();
|
||||
}
|
||||
|
||||
label = localization!.lookup(label) ?? '';
|
||||
label = localization!.lookup(label);
|
||||
|
||||
if (label.isEmpty) {
|
||||
label = localization.logged;
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ class EntityTopFilter extends StatelessWidget {
|
|||
child: TextButton(
|
||||
child: Text(
|
||||
localization!.lookup(
|
||||
'${relatedTypes[i].plural}')!,
|
||||
'${relatedTypes[i].plural}'),
|
||||
style: TextStyle(
|
||||
color: state.headerTextColor,
|
||||
),
|
||||
|
|
@ -434,8 +434,7 @@ class EntityTopFilterHeader extends StatelessWidget {
|
|||
.secondary),
|
||||
SizedBox(width: 16.0),
|
||||
Text(AppLocalization.of(context)!
|
||||
.lookup(action.toString()) ??
|
||||
''),
|
||||
.lookup(action.toString())),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ class NotificationSettings extends StatelessWidget {
|
|||
return DataRow(cells: [
|
||||
// workaround for mistake in translations
|
||||
DataCell(Text(eventType == kNotificationsInvoiceSent
|
||||
? localization.invoiceSentNotificationLabel: localization.lookup(eventType)!)),
|
||||
? localization.invoiceSentNotificationLabel: localization.lookup(eventType))),
|
||||
DataCell(isAllEnabled
|
||||
? value == NOTIFY_ALL
|
||||
? IconText(
|
||||
|
|
|
|||
|
|
@ -120,20 +120,20 @@ class _HistoryListTileState extends State<HistoryListTile> {
|
|||
EntityType.reports,
|
||||
EntityType.settings,
|
||||
].contains(history.entityType)) {
|
||||
title = Text(localization!.lookup(history.entityType.toString())!);
|
||||
title = Text(localization!.lookup(history.entityType.toString()));
|
||||
if (history.entityType == EntityType.reports) {
|
||||
subtitle = Text(
|
||||
localization.lookup(state.uiState.reportsUIState.report)!,
|
||||
localization.lookup(state.uiState.reportsUIState.report),
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
);
|
||||
} else if (history.entityType == EntityType.settings) {
|
||||
subtitle = Text(
|
||||
localization.lookup(history.id ?? kSettingsCompanyDetails)!,
|
||||
localization.lookup(history.id ?? kSettingsCompanyDetails),
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
);
|
||||
}
|
||||
} else if (history.id == null) {
|
||||
title = Text(localization!.lookup(history.entityType.plural)!);
|
||||
title = Text(localization!.lookup(history.entityType.plural));
|
||||
} else {
|
||||
entity =
|
||||
state.getEntityMap(history.entityType)![history.id] as BaseEntity?;
|
||||
|
|
@ -153,7 +153,7 @@ class _HistoryListTileState extends State<HistoryListTile> {
|
|||
: entity.listDisplayName);
|
||||
|
||||
subtitle = Text(
|
||||
localization!.lookup('${history.entityType}')!,
|
||||
localization!.lookup('${history.entityType}'),
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class InvoiceItemListTile extends StatelessWidget {
|
|||
|
||||
if (company.calculateTaxes) {
|
||||
subtitle += ' • ' +
|
||||
localization!.lookup(kTaxCategories[invoiceItem!.taxCategoryId])!;
|
||||
localization!.lookup(kTaxCategories[invoiceItem!.taxCategoryId]);
|
||||
}
|
||||
|
||||
if (invoiceItem!.taxRate1 != 0) {
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class _ListFilterState extends State<ListFilter> {
|
|||
|
||||
return isSingle
|
||||
? placeholder
|
||||
: placeholder!.replaceFirst(
|
||||
: placeholder.replaceFirst(
|
||||
':count',
|
||||
formatNumber(count.toDouble(), context,
|
||||
formatNumberType: FormatNumberType.int)!);
|
||||
|
|
@ -184,7 +184,7 @@ class _ListFilterState extends State<ListFilter> {
|
|||
menuItembuilder: (dynamic value) {
|
||||
final state = value as EntityState;
|
||||
return Text(
|
||||
localization.lookup(state.name)!,
|
||||
localization.lookup(state.name),
|
||||
overflow: TextOverflow.clip,
|
||||
maxLines: 1,
|
||||
);
|
||||
|
|
@ -244,7 +244,7 @@ class _ListFilterState extends State<ListFilter> {
|
|||
whenEmpty: localization!.all,
|
||||
menuItembuilder: (dynamic value) {
|
||||
final state = value as EntityStatus;
|
||||
return Text(localization.lookup(state.name)!);
|
||||
return Text(localization.lookup(state.name));
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ class ActivityListTile extends StatelessWidget {
|
|||
children: <Widget>[
|
||||
Flexible(
|
||||
child: Text(((activity.notes).isNotEmpty
|
||||
? localization.lookup(activity.notes)!.trim() + '\n'
|
||||
? localization.lookup(activity.notes).trim() + '\n'
|
||||
: '') +
|
||||
formatDate(
|
||||
convertTimestampToDateString(activity.createdAt), context,
|
||||
|
|
|
|||
|
|
@ -67,11 +67,11 @@ class _SystemLogViewerState extends State<SystemLogViewer> {
|
|||
headerBuilder: (BuildContext context, bool isExpanded) {
|
||||
return ListTile(
|
||||
leading: Icon(getActivityIcon(systemLog.categoryId)),
|
||||
title: Text(localization!.lookup(systemLog.category)! +
|
||||
title: Text(localization!.lookup(systemLog.category)+
|
||||
' › ' +
|
||||
localization.lookup(systemLog.type)!),
|
||||
localization.lookup(systemLog.type)),
|
||||
isThreeLine: true,
|
||||
subtitle: Text(localization.lookup(systemLog.event)! +
|
||||
subtitle: Text(localization.lookup(systemLog.event)+
|
||||
(client.isOld ? ' • ${client.displayName}' : '') +
|
||||
'\n' +
|
||||
formatDate(
|
||||
|
|
|
|||
|
|
@ -277,7 +277,7 @@ class _EntityListState extends State<EntityList> {
|
|||
return DataColumn(
|
||||
label: Container(
|
||||
child: Text(
|
||||
label!,
|
||||
label,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
|
|
@ -442,9 +442,7 @@ class _EntityListState extends State<EntityList> {
|
|||
.secondary),
|
||||
SizedBox(width: 16.0),
|
||||
Text(AppLocalization.of(context)!
|
||||
.lookup(
|
||||
action.toString()) ??
|
||||
''),
|
||||
.lookup(action.toString())),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ class _ClientPdfViewState extends State<ClientPdfView> {
|
|||
.where((value) => value != DateRange.allTime)
|
||||
.map((dateRange) => DropdownMenuItem<DateRange>(
|
||||
child: Text(localization
|
||||
.lookup(dateRange.toString())!),
|
||||
.lookup(dateRange.toString())),
|
||||
value: dateRange,
|
||||
))
|
||||
.toList(),
|
||||
|
|
@ -298,7 +298,7 @@ class _ClientPdfViewState extends State<ClientPdfView> {
|
|||
kStatementStatusUnpaid,
|
||||
]
|
||||
.map((value) => DropdownMenuItem<String>(
|
||||
child: Text(localization.lookup(value)!),
|
||||
child: Text(localization.lookup(value)),
|
||||
value: value,
|
||||
))
|
||||
.toList()),
|
||||
|
|
@ -321,7 +321,7 @@ class _ClientPdfViewState extends State<ClientPdfView> {
|
|||
selectedValues:
|
||||
state.prefState.statementIncludes.toList(),
|
||||
menuItembuilder: (dynamic option) => Text(
|
||||
localization.lookup(option)!,
|
||||
localization.lookup(option),
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
isDense: true,
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ class ClientPresenter extends EntityPresenter {
|
|||
client!.contacts.map((contact) => contact.fullName).join('\n');
|
||||
return TableTooltip(message: contacts);
|
||||
case ClientFields.classification:
|
||||
return Text(localization!.lookup(client!.classification)!);
|
||||
return Text(localization!.lookup(client!.classification));
|
||||
}
|
||||
|
||||
return super.getField(field: field, context: context);
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ class ClientEditDetailsState extends State<ClientEditDetails> {
|
|||
},
|
||||
items: kTaxClassifications
|
||||
.map((classification) => DropdownMenuItem(
|
||||
child: Text(localization.lookup(classification)!),
|
||||
child: Text(localization.lookup(classification)),
|
||||
value: classification,
|
||||
))
|
||||
.toList(),
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ class _CompanyGatewayEditState extends State<CompanyGatewayEdit>
|
|||
SettingsEntity.AUTO_BILL_OFF,
|
||||
]
|
||||
.map((type) =>
|
||||
Text(localization.lookup(type)!))
|
||||
Text(localization.lookup(type)))
|
||||
.toList(),
|
||||
onChanged: (dynamic value) => viewModel.onChanged(
|
||||
companyGateway
|
||||
|
|
@ -267,8 +267,7 @@ class _CompanyGatewayEditState extends State<CompanyGatewayEdit>
|
|||
SwitchListTile(
|
||||
title: Text(kGatewayTypes.containsKey(gatewayTypeId)
|
||||
? localization
|
||||
.lookup(kGatewayTypes[gatewayTypeId] ?? '')!
|
||||
: '$gatewayTypeId'),
|
||||
.lookup(kGatewayTypes[gatewayTypeId] ?? ''): '$gatewayTypeId'),
|
||||
activeColor: Theme.of(context).colorScheme.secondary,
|
||||
value: companyGateway
|
||||
.getSettingsForGatewayTypeId(gatewayTypeId)
|
||||
|
|
@ -466,7 +465,7 @@ class _CompanyGatewayEditState extends State<CompanyGatewayEdit>
|
|||
items: enabledGatewayIds
|
||||
.map((gatewayTypeId) => DropdownMenuItem(
|
||||
child: Text(localization.lookup(
|
||||
kGatewayTypes[gatewayTypeId] ?? '')!),
|
||||
kGatewayTypes[gatewayTypeId] ?? '')),
|
||||
value: gatewayTypeId,
|
||||
))
|
||||
.toList(),
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ class _CompanyGatewayOverview extends StatelessWidget {
|
|||
Padding(
|
||||
padding: const EdgeInsets.only(top: 20, left: 20),
|
||||
child: Text(
|
||||
localization.lookup(kGatewayTypes[entry.key])!,
|
||||
localization.lookup(kGatewayTypes[entry.key]),
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ class CreditListItem extends StatelessWidget {
|
|||
),
|
||||
Text(
|
||||
localization!.lookup(
|
||||
kCreditStatuses[credit.calculatedStatusId])!,
|
||||
kCreditStatuses[credit.calculatedStatusId]),
|
||||
style: TextStyle(
|
||||
color: !credit.isSent
|
||||
? textColor
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ class _DashboardChartState extends State<DashboardChart> {
|
|||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(localization!.lookup(dataGroup.name)!,
|
||||
Text(localization!.lookup(dataGroup.name),
|
||||
style: theme.textTheme.titleLarge!.copyWith(
|
||||
color: isSelected ? Colors.white : null,
|
||||
)),
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ class _DashboardDateRangePickerState extends State<DashboardDateRangePicker> {
|
|||
.where((value) => value != DateRange.allTime)
|
||||
.map((dateRange) => DropdownMenuItem<DateRange>(
|
||||
child: Text(localization
|
||||
.lookup(dateRange.toString())!),
|
||||
.lookup(dateRange.toString())),
|
||||
value: dateRange,
|
||||
))
|
||||
.toList(),
|
||||
|
|
@ -134,7 +134,7 @@ class _DashboardDateRangePickerState extends State<DashboardDateRangePicker> {
|
|||
.map((dateRange) => DropdownMenuItem<
|
||||
DateRangeComparison>(
|
||||
child: Text(localization.lookup(
|
||||
dateRange.toString())!),
|
||||
dateRange.toString())),
|
||||
value: dateRange,
|
||||
))
|
||||
.toList(),
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ class DashboardPanels extends StatelessWidget {
|
|||
.map((dateRange) => PopupMenuItem(
|
||||
child: Text(dateRange == DateRange.custom
|
||||
? '${localization.more}...'
|
||||
: localization.lookup(dateRange.toString())!),
|
||||
: localization.lookup(dateRange.toString())),
|
||||
value: dateRange,
|
||||
))
|
||||
.toList(),
|
||||
|
|
@ -634,7 +634,7 @@ class DashboardPanels extends StatelessWidget {
|
|||
padding: const EdgeInsets.all(0),
|
||||
children: [
|
||||
Text(
|
||||
localization!.lookup(dashboardField.field)!,
|
||||
localization!.lookup(dashboardField.field),
|
||||
style: textTheme.titleMedium,
|
||||
textAlign: TextAlign.center),
|
||||
SizedBox(height: 6),
|
||||
|
|
@ -649,7 +649,7 @@ class DashboardPanels extends StatelessWidget {
|
|||
textAlign: TextAlign.center),
|
||||
SizedBox(height: 6),
|
||||
Text(
|
||||
localization.lookup(dashboardField.period)!,
|
||||
localization.lookup(dashboardField.period),
|
||||
style: textTheme.bodySmall,
|
||||
textAlign: TextAlign.center),
|
||||
],
|
||||
|
|
@ -1192,9 +1192,9 @@ class __DashboardSettingsState extends State<_DashboardSettings> {
|
|||
ListTile(
|
||||
key: ValueKey(
|
||||
'__${dashboardField.field}_${dashboardField.period}_'),
|
||||
title: Text(localization.lookup(dashboardField.field)!),
|
||||
title: Text(localization.lookup(dashboardField.field)),
|
||||
subtitle:
|
||||
Text(localization.lookup(dashboardField.period)!),
|
||||
Text(localization.lookup(dashboardField.period)),
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.close),
|
||||
onPressed: () {
|
||||
|
|
@ -1297,7 +1297,7 @@ class _DashboardFieldState extends State<_DashboardField> {
|
|||
fields.forEach((field) {
|
||||
if (company.isModuleEnabled(entityType)) {
|
||||
items.add(DropdownMenuItem<String>(
|
||||
child: Text(localization.lookup(field)!),
|
||||
child: Text(localization.lookup(field)),
|
||||
value: field,
|
||||
));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -418,7 +418,7 @@ class _CustomTabBarView extends StatelessWidget {
|
|||
trailing: Icon(Icons.navigate_next),
|
||||
subtitle: Text(subtitle != null
|
||||
? subtitle
|
||||
: localization!.lookup('${entity.entityType}')!),
|
||||
: localization!.lookup('${entity.entityType}')),
|
||||
onTap: () => viewEntity(entity: entity),
|
||||
);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -357,7 +357,7 @@ class ExpenseEditDetailsState extends State<ExpenseEditDetails> {
|
|||
items: kFrequencies.entries
|
||||
.map((entry) => DropdownMenuItem(
|
||||
value: entry.key,
|
||||
child: Text(localization.lookup(entry.value)!),
|
||||
child: Text(localization.lookup(entry.value)),
|
||||
))
|
||||
.toList()),
|
||||
DatePicker(
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ class ExpenseListItem extends StatelessWidget {
|
|||
),
|
||||
Text(
|
||||
localization!.lookup(
|
||||
kExpenseStatuses[expense.calculatedStatusId])!,
|
||||
kExpenseStatuses[expense.calculatedStatusId]),
|
||||
style: TextStyle(
|
||||
color: category.color.isNotEmpty &&
|
||||
category.color != '#fff'
|
||||
|
|
|
|||
|
|
@ -371,7 +371,7 @@ class InvoiceEditDesktopState extends State<InvoiceEditDesktop>
|
|||
.map((entry) => DropdownMenuItem(
|
||||
value: entry.key,
|
||||
child: Text(localization
|
||||
.lookup(entry.value)!),
|
||||
.lookup(entry.value)),
|
||||
))
|
||||
.toList()),
|
||||
DatePicker(
|
||||
|
|
@ -568,7 +568,7 @@ class InvoiceEditDesktopState extends State<InvoiceEditDesktop>
|
|||
SettingsEntity.AUTO_BILL_OFF,
|
||||
]
|
||||
.map((type) =>
|
||||
Text(localization.lookup(type)!))
|
||||
Text(localization.lookup(type)))
|
||||
.toList(),
|
||||
onChanged: (dynamic value) => viewModel
|
||||
.onChanged!(
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ class InvoiceEditDetailsState extends State<InvoiceEditDetails> {
|
|||
items: kFrequencies.entries
|
||||
.map((entry) => DropdownMenuItem(
|
||||
value: entry.key,
|
||||
child: Text(localization.lookup(entry.value)!),
|
||||
child: Text(localization.lookup(entry.value)),
|
||||
))
|
||||
.toList()),
|
||||
DatePicker(
|
||||
|
|
@ -357,7 +357,7 @@ class InvoiceEditDetailsState extends State<InvoiceEditDetails> {
|
|||
SettingsEntity.AUTO_BILL_OPT_IN,
|
||||
SettingsEntity.AUTO_BILL_OFF,
|
||||
]
|
||||
.map((type) => Text(localization.lookup(type)!))
|
||||
.map((type) => Text(localization.lookup(type)))
|
||||
.toList(),
|
||||
onChanged: (dynamic value) => viewModel
|
||||
.onChanged!(invoice.rebuild((b) => b..autoBill = value)),
|
||||
|
|
|
|||
|
|
@ -334,7 +334,7 @@ class ItemEditDetailsState extends State<ItemEditDetails> {
|
|||
.map((key) => DropdownMenuItem<String>(
|
||||
child: Text(localization.lookup(
|
||||
kTaxCategories[key],
|
||||
)!),
|
||||
)),
|
||||
value: key,
|
||||
))
|
||||
.toList()),
|
||||
|
|
|
|||
|
|
@ -471,7 +471,7 @@ class _InvoiceEditItemsDesktopState extends State<InvoiceEditItemsDesktop> {
|
|||
return Text(item.taxName3);
|
||||
} else if (column == COLUMN_TAX_CATEGORY) {
|
||||
return Text(localization
|
||||
.lookup(kTaxCategories[item.taxCategoryId])!);
|
||||
.lookup(kTaxCategories[item.taxCategoryId]));
|
||||
} else if (column == COLUMN_UNIT_COST) {
|
||||
return Text(
|
||||
formatNumber(
|
||||
|
|
@ -966,7 +966,7 @@ class _InvoiceEditItemsDesktopState extends State<InvoiceEditItemsDesktop> {
|
|||
.map((key) => DropdownMenuItem<String>(
|
||||
child: Text(localization.lookup(
|
||||
kTaxCategories[key],
|
||||
)!),
|
||||
)),
|
||||
value: key,
|
||||
))
|
||||
.toList()),
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ class InvoiceListItem extends StatelessWidget {
|
|||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
Text(statusLabel!,
|
||||
Text(statusLabel,
|
||||
style: TextStyle(
|
||||
color:
|
||||
!invoice.isSent ? textColor : statusColor,
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ class _InvoicePdfViewState extends State<InvoicePdfView> {
|
|||
Uri.parse(invoice.invitationDownloadLink));
|
||||
} else {
|
||||
final fileName = localization
|
||||
.lookup('${invoice.entityType}')! +
|
||||
.lookup('${invoice.entityType}')+
|
||||
'_' +
|
||||
(invoice.number.isEmpty
|
||||
? localization.pending
|
||||
|
|
@ -322,7 +322,7 @@ class _InvoicePdfViewState extends State<InvoicePdfView> {
|
|||
canDebug: false,
|
||||
maxPageWidth: 800,
|
||||
pdfFileName:
|
||||
localization.lookup(invoice.entityType!.snakeCase)! +
|
||||
localization.lookup(invoice.entityType!.snakeCase)+
|
||||
'_' +
|
||||
invoice.number +
|
||||
'.pdf',
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ class InvoicePresenter extends EntityPresenter {
|
|||
return Text(invoice.isViewed ? localization!.yes : localization!.no);
|
||||
case InvoiceFields.autoBillEnabled:
|
||||
return Text(localization!.lookup(
|
||||
invoice.autoBillEnabled ? localization.yes : localization.no)!);
|
||||
invoice.autoBillEnabled ? localization.yes : localization.no));
|
||||
case InvoiceFields.clientState:
|
||||
return Text(client.state);
|
||||
case InvoiceFields.clientCity:
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ class InvoiceOverview extends StatelessWidget {
|
|||
? localization.endless
|
||||
: '${invoice.remainingCycles}',
|
||||
RecurringInvoiceFields.autoBill:
|
||||
localization.lookup(invoice.autoBill)! +
|
||||
localization.lookup(invoice.autoBill)+
|
||||
([
|
||||
SettingsEntity.AUTO_BILL_OPT_IN,
|
||||
SettingsEntity.AUTO_BILL_OPT_OUT
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ class PaymentListItem extends StatelessWidget {
|
|||
),
|
||||
Text(
|
||||
localization!.lookup(
|
||||
'payment_status_${payment.calculatedStatusId}')!,
|
||||
'payment_status_${payment.calculatedStatusId}'),
|
||||
style: TextStyle(
|
||||
color: PaymentStatusColors(
|
||||
state.prefState.colorThemeModel)
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ class PaymentPresenter extends EntityPresenter {
|
|||
return Text(companyGateway.label);
|
||||
case PaymentFields.gatewayType:
|
||||
return Text(
|
||||
localization!.lookup(kGatewayTypes[payment!.gatewayTypeId])!);
|
||||
localization!.lookup(kGatewayTypes[payment!.gatewayTypeId]));
|
||||
}
|
||||
|
||||
return super.getField(field: field, context: context);
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ class _ProductEditState extends State<ProductEdit> {
|
|||
items: kTaxCategories.keys
|
||||
.map((key) => DropdownMenuItem<String>(
|
||||
child: Text(
|
||||
localization.lookup(kTaxCategories[key])!),
|
||||
localization.lookup(kTaxCategories[key])),
|
||||
value: key,
|
||||
))
|
||||
.toList()),
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class ProductPresenter extends EntityPresenter {
|
|||
formatNumberType: FormatNumberType.int)!);
|
||||
case ProductFields.taxCategory:
|
||||
return Text(
|
||||
localization!.lookup(kTaxCategories[product!.taxCategoryId])!);
|
||||
localization!.lookup(kTaxCategories[product!.taxCategoryId]));
|
||||
case ProductFields.notificationThreshold:
|
||||
final store = StoreProvider.of<AppState>(context);
|
||||
return Text(formatNumber(
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ class PurchaseOrderListItem extends StatelessWidget {
|
|||
),
|
||||
Text(
|
||||
localization!.lookup(kPurchaseOrderStatuses[
|
||||
purchaseOrder.calculatedStatusId])!,
|
||||
purchaseOrder.calculatedStatusId]),
|
||||
style: TextStyle(
|
||||
color: !purchaseOrder.isSent
|
||||
? textColor
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ class QuoteListItem extends StatelessWidget {
|
|||
),
|
||||
Text(
|
||||
localization!.lookup(
|
||||
kQuoteStatuses[quote.calculatedStatusId])!,
|
||||
kQuoteStatuses[quote.calculatedStatusId]),
|
||||
style: TextStyle(
|
||||
color: !quote.isSent
|
||||
? textColor
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ class RecurringExpensePresenter extends EntityPresenter {
|
|||
case RecurringExpenseFields.remainingCycles:
|
||||
return Text('${expense!.remainingCycles}');
|
||||
case RecurringExpenseFields.frequency:
|
||||
return Text(localization!.lookup(kFrequencies[expense!.frequencyId])!);
|
||||
return Text(localization!.lookup(kFrequencies[expense!.frequencyId]));
|
||||
}
|
||||
|
||||
return super.getField(field: field, context: context);
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class RecurringInvoiceListItem extends StatelessWidget {
|
|||
if (subtitle.isNotEmpty) {
|
||||
subtitle += ' • ';
|
||||
}
|
||||
subtitle += localization.lookup(kFrequencies[invoice.frequencyId])!;
|
||||
subtitle += localization.lookup(kFrequencies[invoice.frequencyId]);
|
||||
|
||||
return DismissibleEntity(
|
||||
isSelected: isDesktop(context) &&
|
||||
|
|
@ -235,7 +235,7 @@ class RecurringInvoiceListItem extends StatelessWidget {
|
|||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
Text(statusLabel!,
|
||||
Text(statusLabel,
|
||||
style: TextStyle(
|
||||
color:
|
||||
!invoice.isSent ? textColor : statusColor,
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ class RecurringInvoicePresenter extends EntityPresenter {
|
|||
showTime: true, showSeconds: false)
|
||||
: formatDate(invoice.nextSendDate, context));
|
||||
case RecurringInvoiceFields.frequency:
|
||||
return Text(localization!.lookup(kFrequencies[invoice.frequencyId])!);
|
||||
return Text(localization!.lookup(kFrequencies[invoice.frequencyId]));
|
||||
case RecurringInvoiceFields.dueDateDays:
|
||||
return Text(invoice.dueDateDays == 'terms'
|
||||
? localization!.paymentTerm
|
||||
|
|
@ -130,7 +130,7 @@ class RecurringInvoicePresenter extends EntityPresenter {
|
|||
: localization!.dayCount
|
||||
.replaceFirst(':count', '${invoice.dueDateDays}'));
|
||||
case RecurringInvoiceFields.autoBill:
|
||||
return Text(localization!.lookup(invoice.autoBill)!);
|
||||
return Text(localization!.lookup(invoice.autoBill));
|
||||
}
|
||||
|
||||
return super.getField(field: field, context: context);
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ class ReportsScreen extends StatelessWidget {
|
|||
items: reports
|
||||
.map((report) => DropdownMenuItem(
|
||||
value: report,
|
||||
child: Text(localization.lookup(report)!),
|
||||
child: Text(localization.lookup(report)),
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
|
|
@ -160,8 +160,7 @@ class ReportsScreen extends StatelessWidget {
|
|||
final columnTitle = state.company.getCustomFieldLabel(column);
|
||||
return DropdownMenuItem(
|
||||
child: Text(columnTitle.isEmpty
|
||||
? localization.lookup(column)!
|
||||
: columnTitle),
|
||||
? localization.lookup(column): columnTitle),
|
||||
value: column,
|
||||
);
|
||||
}).toList(),
|
||||
|
|
@ -246,7 +245,7 @@ class ReportsScreen extends StatelessWidget {
|
|||
.map((column) => DropdownMenuItem<String>(
|
||||
value: column,
|
||||
child: Text(
|
||||
localization.lookup(column)!,
|
||||
localization.lookup(column),
|
||||
),
|
||||
))
|
||||
.toList()),
|
||||
|
|
@ -269,7 +268,7 @@ class ReportsScreen extends StatelessWidget {
|
|||
items: DateRange.values
|
||||
.where((value) => value != DateRange.allTime)
|
||||
.map((dateRange) => DropdownMenuItem<DateRange>(
|
||||
child: Text(localization.lookup(dateRange.toString())!),
|
||||
child: Text(localization.lookup(dateRange.toString())),
|
||||
value: dateRange,
|
||||
))
|
||||
.toList(),
|
||||
|
|
@ -314,7 +313,7 @@ class ReportsScreen extends StatelessWidget {
|
|||
ReportColumnType.duration,
|
||||
].contains(getReportColumnType(column, context)))
|
||||
.map((column) => DropdownMenuItem(
|
||||
child: Text(localization.lookup(column)!),
|
||||
child: Text(localization.lookup(column)),
|
||||
value: column,
|
||||
))
|
||||
.toList(),
|
||||
|
|
@ -396,7 +395,7 @@ class ReportsScreen extends StatelessWidget {
|
|||
: reportResult.entities!;
|
||||
confirmCallback(
|
||||
context: context,
|
||||
message: localization.lookup(action.toString())! +
|
||||
message: localization.lookup(action.toString())+
|
||||
' • ' +
|
||||
(entities.length == 1
|
||||
? '1 ${localization.lookup(firstEntity!.entityType.toString())}'
|
||||
|
|
@ -949,7 +948,7 @@ class ReportResult {
|
|||
}
|
||||
|
||||
final localization = AppLocalization.of(navigatorKey.currentContext!)!;
|
||||
if (localization.lookup(value)!.toLowerCase().contains(filter)) {
|
||||
if (localization.lookup(value).toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1054,7 +1053,7 @@ class ReportResult {
|
|||
Text(
|
||||
(company.getCustomFieldLabel(column!).isNotEmpty
|
||||
? company.getCustomFieldLabel(column)
|
||||
: localization!.lookup(column))! +
|
||||
: localization!.lookup(column))+
|
||||
' ',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
|
|
@ -1136,7 +1135,7 @@ class ReportResult {
|
|||
},
|
||||
items: kAgeGroups.keys
|
||||
.map((ageGroup) => DropdownMenuItem(
|
||||
child: Text(localization!.lookup(ageGroup)!),
|
||||
child: Text(localization!.lookup(ageGroup)),
|
||||
value: ageGroup,
|
||||
))
|
||||
.toList(),
|
||||
|
|
@ -1186,7 +1185,7 @@ class ReportResult {
|
|||
items: DateRange.values
|
||||
.where((value) => value != DateRange.allTime)
|
||||
.map((dateRange) => DropdownMenuItem<DateRange>(
|
||||
child: Text(localization!.lookup(dateRange.toString())!),
|
||||
child: Text(localization!.lookup(dateRange.toString())),
|
||||
value: dateRange,
|
||||
))
|
||||
.toList(),
|
||||
|
|
@ -1370,7 +1369,7 @@ class ReportResult {
|
|||
} else {
|
||||
value = group == 'null' ? localization!.blank : group;
|
||||
}
|
||||
value = value! + ' (' + values!['count']!.floor().toString() + ')';
|
||||
value = value+ ' (' + values!['count']!.floor().toString() + ')';
|
||||
} else if (columnType == ReportColumnType.number) {
|
||||
final currencyId = values!['${column}_currency_id'];
|
||||
value = formatNumber(values[column], context,
|
||||
|
|
@ -1465,8 +1464,7 @@ class ReportResult {
|
|||
mt.DataColumn(
|
||||
label: Text(
|
||||
company.getCustomFieldLabel(column!).isEmpty
|
||||
? localization.lookup(column)!
|
||||
: company.getCustomFieldLabel(column),
|
||||
? localization.lookup(column): company.getCustomFieldLabel(column),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
numeric: true,
|
||||
|
|
|
|||
|
|
@ -474,12 +474,12 @@ class ReportsScreenVM {
|
|||
columns
|
||||
.sort((String? str1, String? str2) => str1!.compareTo(str2!));
|
||||
|
||||
csvData += localization!.lookup(reportState.group)! +
|
||||
csvData += localization!.lookup(reportState.group)+
|
||||
',' +
|
||||
localization.count;
|
||||
|
||||
columns.forEach((column) {
|
||||
csvData += ',' + localization.lookup(column)!;
|
||||
csvData += ',' + localization.lookup(column);
|
||||
});
|
||||
|
||||
csvData += '\n';
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ class _ScheduleEditState extends State<ScheduleEdit> {
|
|||
items: ScheduleEntity.TEMPLATES
|
||||
.map((entry) => DropdownMenuItem(
|
||||
value: entry,
|
||||
child: Text(localization.lookup(entry)!),
|
||||
child: Text(localization.lookup(entry)),
|
||||
))
|
||||
.toList()),
|
||||
DatePicker(
|
||||
|
|
@ -203,7 +203,7 @@ class _ScheduleEditState extends State<ScheduleEdit> {
|
|||
.map((entry) => DropdownMenuItem(
|
||||
value: entry.key,
|
||||
child:
|
||||
Text(localization.lookup(entry.value)!),
|
||||
Text(localization.lookup(entry.value)),
|
||||
))
|
||||
.toList()),
|
||||
if (schedule.frequencyId.isNotEmpty)
|
||||
|
|
@ -249,7 +249,7 @@ class _ScheduleEditState extends State<ScheduleEdit> {
|
|||
.where((value) => value != DateRange.custom)
|
||||
.map((dateRange) => DropdownMenuItem<DateRange>(
|
||||
child: Text(
|
||||
localization.lookup(dateRange.toString())!),
|
||||
localization.lookup(dateRange.toString())),
|
||||
value: dateRange,
|
||||
))
|
||||
.toList(),
|
||||
|
|
@ -268,7 +268,7 @@ class _ScheduleEditState extends State<ScheduleEdit> {
|
|||
kStatementStatusUnpaid,
|
||||
]
|
||||
.map((value) => DropdownMenuItem<String>(
|
||||
child: Text(localization.lookup(value)!),
|
||||
child: Text(localization.lookup(value)),
|
||||
value: value,
|
||||
))
|
||||
.toList(),
|
||||
|
|
@ -357,7 +357,7 @@ class _ScheduleEditState extends State<ScheduleEdit> {
|
|||
.map((entityType) => DropdownMenuItem<String>(
|
||||
value: entityType.apiValue,
|
||||
child: Text(
|
||||
localization.lookup(entityType.apiValue)!,
|
||||
localization.lookup(entityType.apiValue),
|
||||
),
|
||||
))
|
||||
.toList()),
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class ScheduleListItem extends StatelessWidget {
|
|||
|
||||
String subtitle = formatDate(schedule.nextRun, context);
|
||||
|
||||
String title = localization.lookup(schedule.template) ?? '';
|
||||
String title = localization.lookup(schedule.template);
|
||||
if (schedule.template == ScheduleEntity.TEMPLATE_EMAIL_RECORD) {
|
||||
final entityType = EntityType.valueOf(schedule.parameters.entityType!);
|
||||
final entity =
|
||||
|
|
@ -60,7 +60,7 @@ class ScheduleListItem extends StatelessWidget {
|
|||
}
|
||||
|
||||
subtitle += ' • ' +
|
||||
localization.lookup(schedule.parameters.entityType)! +
|
||||
localization.lookup(schedule.parameters.entityType) +
|
||||
' ' +
|
||||
(entity?.listDisplayName ?? '');
|
||||
} else if (schedule.template == ScheduleEntity.TEMPLATE_EMAIL_STATEMENT) {
|
||||
|
|
@ -74,7 +74,7 @@ class ScheduleListItem extends StatelessWidget {
|
|||
': ${schedule.parameters.clients!.length} ${localization.clients}';
|
||||
}
|
||||
subtitle +=
|
||||
' • ' + localization.lookup(kFrequencies[schedule.frequencyId])!;
|
||||
' • ' + localization.lookup(kFrequencies[schedule.frequencyId]);
|
||||
}
|
||||
|
||||
return DismissibleEntity(
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ class _AccountManagementState extends State<AccountManagement>
|
|||
children: kModules.keys.map((module) {
|
||||
return CheckboxListTile(
|
||||
controlAffinity: ListTileControlAffinity.leading,
|
||||
title: Text(localization.lookup(kModules[module])!),
|
||||
title: Text(localization.lookup(kModules[module])),
|
||||
value: company.enabledModules & module != 0,
|
||||
activeColor: Theme.of(context).colorScheme.secondary,
|
||||
onChanged: (value) {
|
||||
|
|
|
|||
|
|
@ -559,7 +559,7 @@ class _ClientPortalState extends State<ClientPortal>
|
|||
return Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(localization.lookup(field.key)!),
|
||||
child: Text(localization.lookup(field.key)),
|
||||
),
|
||||
Expanded(
|
||||
child: AppDropdownButton<String>(
|
||||
|
|
|
|||
|
|
@ -393,7 +393,7 @@ class _CompanyDetailsState extends State<CompanyDetails>
|
|||
},
|
||||
items: kTaxClassifications
|
||||
.map((classification) => DropdownMenuItem(
|
||||
child: Text(localization.lookup(classification)!),
|
||||
child: Text(localization.lookup(classification)),
|
||||
value: classification,
|
||||
))
|
||||
.toList(),
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ class _GeneratedNumbersState extends State<GeneratedNumbers>
|
|||
id,
|
||||
DropdownMenuItem<String>(
|
||||
child:
|
||||
Text(localization.lookup(frequency)!),
|
||||
Text(localization.lookup(frequency)),
|
||||
value: id,
|
||||
)))
|
||||
.values
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ class _ImportExportState extends State<ImportExport> {
|
|||
.map((importType) => DropdownMenuItem<ImportType>(
|
||||
value: importType,
|
||||
child: Text(
|
||||
localization.lookup('$importType')!)))
|
||||
localization.lookup('$importType'))))
|
||||
.toList()),
|
||||
),
|
||||
),
|
||||
|
|
@ -237,7 +237,7 @@ class _ImportExportState extends State<ImportExport> {
|
|||
items: ExportType.values
|
||||
.map((importType) => DropdownMenuItem<ExportType>(
|
||||
value: importType,
|
||||
child: Text(localization.lookup('$importType')!)))
|
||||
child: Text(localization.lookup('$importType'))))
|
||||
.toList(),
|
||||
),
|
||||
if (DATE_FIELDS.containsKey(_exportType)) ...[
|
||||
|
|
@ -254,7 +254,7 @@ class _ImportExportState extends State<ImportExport> {
|
|||
.map((dateField) => DropdownMenuItem<String>(
|
||||
value: dateField,
|
||||
child:
|
||||
Text(localization.lookup('$dateField')!)))
|
||||
Text(localization.lookup('$dateField'))))
|
||||
.toList(),
|
||||
),
|
||||
if (_exportDate.isNotEmpty)
|
||||
|
|
@ -278,7 +278,7 @@ class _ImportExportState extends State<ImportExport> {
|
|||
}
|
||||
return DropdownMenuItem<String>(
|
||||
value: dateRange,
|
||||
child: Text(label!),
|
||||
child: Text(label),
|
||||
);
|
||||
},
|
||||
).toList(),
|
||||
|
|
@ -494,7 +494,7 @@ class _FileImportState extends State<_FileImport> {
|
|||
]
|
||||
.map((importType) => DropdownMenuItem<ImportType>(
|
||||
value: importType,
|
||||
child: Text(localization.lookup('$importType')!)))
|
||||
child: Text(localization.lookup('$importType'))))
|
||||
.toList()),
|
||||
),
|
||||
)
|
||||
|
|
@ -666,7 +666,7 @@ class __FileMapperState extends State<_FileMapper> {
|
|||
children.addAll([
|
||||
SizedBox(height: 25),
|
||||
Text(
|
||||
localization!.lookup(entry.key)!,
|
||||
localization!.lookup(entry.key),
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
overflow: TextOverflow.clip,
|
||||
maxLines: 1,
|
||||
|
|
@ -845,13 +845,11 @@ class _FieldMapper extends StatelessWidget {
|
|||
final partsB = fieldB.split('.');
|
||||
if (partsA[0] == partsB[0]) {
|
||||
return localization!
|
||||
.lookup(partsA[1])!
|
||||
.compareTo(localization.lookup(partsB[1])!);
|
||||
.lookup(partsA[1]).compareTo(localization.lookup(partsB[1]));
|
||||
}
|
||||
|
||||
return localization!
|
||||
.lookup(partsA[0])!
|
||||
.compareTo(localization.lookup(partsB[0])!);
|
||||
.lookup(partsA[0]).compareTo(localization.lookup(partsB[0]));
|
||||
});
|
||||
|
||||
return Row(
|
||||
|
|
|
|||
|
|
@ -426,7 +426,7 @@ class _InvoiceDesignState extends State<InvoiceDesign>
|
|||
.map((pageLayout) => DropdownMenuItem<String>(
|
||||
value: pageLayout,
|
||||
child:
|
||||
Text(localization.lookup(pageLayout)!),
|
||||
Text(localization.lookup(pageLayout)),
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
|
|
@ -439,7 +439,7 @@ class _InvoiceDesignState extends State<InvoiceDesign>
|
|||
items: kPageSizes
|
||||
.map((pageSize) => DropdownMenuItem<String>(
|
||||
value: pageSize,
|
||||
child: Text(localization.lookup(pageSize)!),
|
||||
child: Text(localization.lookup(pageSize)),
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class _LocalizationSettingsState extends State<LocalizationSettings>
|
|||
final customLabels =
|
||||
kCustomLabels.where((key) => !translations.keys.contains(key)).toList();
|
||||
customLabels.sort(
|
||||
(a, b) => localization.lookup(a)!.compareTo(localization.lookup(b)!));
|
||||
(a, b) => localization.lookup(a).compareTo(localization.lookup(b)));
|
||||
|
||||
return EditScaffold(
|
||||
title: localization.localization,
|
||||
|
|
@ -257,7 +257,7 @@ class _LocalizationSettingsState extends State<LocalizationSettings>
|
|||
MapEntry<String, DropdownMenuItem<String>>(
|
||||
id,
|
||||
DropdownMenuItem<String>(
|
||||
child: Text(localization.lookup(month)!),
|
||||
child: Text(localization.lookup(month)),
|
||||
value: id,
|
||||
)))
|
||||
.values
|
||||
|
|
@ -280,7 +280,7 @@ class _LocalizationSettingsState extends State<LocalizationSettings>
|
|||
child: DropdownButton<String>(
|
||||
items: customLabels
|
||||
.map((key) => DropdownMenuItem(
|
||||
child: Text(localization.lookup(key)!),
|
||||
child: Text(localization.lookup(key)),
|
||||
value: key,
|
||||
))
|
||||
.toList(),
|
||||
|
|
@ -348,7 +348,7 @@ class _LocalizationSettingsState extends State<LocalizationSettings>
|
|||
child: Text(
|
||||
key!.startsWith('country_')
|
||||
? key.split('_')[1]
|
||||
: localization.lookup(key)!,
|
||||
: localization.lookup(key),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
)),
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ class _PaymentSettingsState extends State<PaymentSettings> {
|
|||
SettingsEntity.AUTO_BILL_OPT_IN,
|
||||
SettingsEntity.AUTO_BILL_OFF,
|
||||
]
|
||||
.map((type) => Text(localization.lookup(type)!))
|
||||
.map((type) => Text(localization.lookup(type)))
|
||||
.toList(),
|
||||
items: [
|
||||
SettingsEntity.AUTO_BILL_ALWAYS,
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@ class _SettingsListTileState extends State<SettingsListTile> {
|
|||
child: Icon(icon ?? icon, size: 22),
|
||||
),
|
||||
title: Text(
|
||||
localization.lookup(widget.section)!,
|
||||
localization.lookup(widget.section),
|
||||
style:
|
||||
Theme.of(context).textTheme.bodyLarge!.copyWith(fontSize: 14),
|
||||
),
|
||||
|
|
@ -331,7 +331,7 @@ class SettingsSearch extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final localization = AppLocalization.of(context);
|
||||
final localization = AppLocalization.of(context)!;
|
||||
final store = StoreProvider.of<AppState>(context);
|
||||
final company = store.state.company;
|
||||
|
||||
|
|
@ -417,7 +417,7 @@ class SettingsSearch extends StatelessWidget {
|
|||
'online_payment_email',
|
||||
'manual_payment_email',
|
||||
'use_available_credits',
|
||||
'enable_applying_payments_later#2022-06-06',
|
||||
'admin_initiated_payments#2022-06-06',
|
||||
'allow_over_payment',
|
||||
'allow_under_payment',
|
||||
'auto_bill_standard_invoices#2023-01-17',
|
||||
|
|
@ -696,8 +696,8 @@ class SettingsSearch extends StatelessWidget {
|
|||
for (var parts
|
||||
in sections.map((section) => section.split('#').toList()))
|
||||
if ((filter ?? '').trim().isEmpty ||
|
||||
localization!
|
||||
.lookup(parts[1])!
|
||||
localization
|
||||
.lookup(parts[1])
|
||||
.toLowerCase()
|
||||
.contains(filter!.toLowerCase()))
|
||||
ListTile(
|
||||
|
|
@ -708,9 +708,9 @@ class SettingsSearch extends StatelessWidget {
|
|||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(localization!.lookup(parts[1])!),
|
||||
Text(localization.lookup(parts[1])),
|
||||
Text(
|
||||
localization.lookup(parts[2])!,
|
||||
localization.lookup(parts[2]),
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
],
|
||||
|
|
@ -739,17 +739,17 @@ class SettingsSearch extends StatelessWidget {
|
|||
for (var section in map.keys)
|
||||
for (int i = 0; i < map[section]!.length; i++)
|
||||
for (var field in map[section]![i])
|
||||
if (localization!
|
||||
.lookup(field.split('#')[0])!
|
||||
if (localization
|
||||
.lookup(field.split('#')[0])
|
||||
.toLowerCase()
|
||||
.contains(filter!.toLowerCase()))
|
||||
ListTile(
|
||||
title: Text(localization.lookup(field.split('#')[0])!),
|
||||
title: Text(localization.lookup(field.split('#')[0])),
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.only(left: 6, top: 10),
|
||||
child: Icon(getSettingIcon(section), size: 22),
|
||||
),
|
||||
subtitle: Text(localization.lookup(section)!),
|
||||
subtitle: Text(localization.lookup(section)),
|
||||
onTap: () => viewModel!.loadSection(context, section, i),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ class _TaskSettingsState extends State<TaskSettings> {
|
|||
SettingsEntity.PORTAL_TASKS_ALL,
|
||||
]
|
||||
.map((value) => DropdownMenuItem(
|
||||
child: Text(localization.lookup(value)!),
|
||||
child: Text(localization.lookup(value)),
|
||||
value: value,
|
||||
))
|
||||
.toList(),
|
||||
|
|
|
|||
|
|
@ -397,7 +397,7 @@ class _TemplatesAndRemindersState extends State<TemplatesAndReminders>
|
|||
}
|
||||
|
||||
return DropdownMenuItem<EmailTemplate>(
|
||||
child: Text(name!),
|
||||
child: Text(name),
|
||||
value: item,
|
||||
);
|
||||
}).toList(),
|
||||
|
|
@ -509,7 +509,7 @@ class _TemplatesAndRemindersState extends State<TemplatesAndReminders>
|
|||
id,
|
||||
DropdownMenuItem<String>(
|
||||
child:
|
||||
Text(localization.lookup(frequency)!),
|
||||
Text(localization.lookup(frequency)),
|
||||
value: id,
|
||||
)))
|
||||
.values
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ class _WorkflowSettingsState extends State<WorkflowSettings>
|
|||
SettingsEntity.LOCK_INVOICES_PAID,
|
||||
]
|
||||
.map((option) => DropdownMenuItem(
|
||||
child: Text(localization.lookup(option)!),
|
||||
child: Text(localization.lookup(option)),
|
||||
value: option,
|
||||
))
|
||||
.toList(),
|
||||
|
|
|
|||
|
|
@ -446,7 +446,7 @@ class _SubscriptionEditState extends State<SubscriptionEdit>
|
|||
items: kFrequencies.entries
|
||||
.map((entry) => DropdownMenuItem(
|
||||
value: entry.key,
|
||||
child: Text(localization.lookup(entry.value)!),
|
||||
child: Text(localization.lookup(entry.value)),
|
||||
))
|
||||
.toList()),
|
||||
AppDropdownButton<String>(
|
||||
|
|
@ -461,7 +461,7 @@ class _SubscriptionEditState extends State<SubscriptionEdit>
|
|||
SettingsEntity.AUTO_BILL_OPT_OUT,
|
||||
SettingsEntity.AUTO_BILL_OPT_IN,
|
||||
SettingsEntity.AUTO_BILL_OFF,
|
||||
].map((type) => Text(localization.lookup(type)!)).toList(),
|
||||
].map((type) => Text(localization.lookup(type))).toList(),
|
||||
items: [
|
||||
SettingsEntity.AUTO_BILL_ALWAYS,
|
||||
SettingsEntity.AUTO_BILL_OPT_OUT,
|
||||
|
|
|
|||
|
|
@ -298,7 +298,7 @@ class _KanbanTaskCardState extends State<KanbanTaskCard> {
|
|||
]
|
||||
.map((value) => PopupMenuItem<String>(
|
||||
child:
|
||||
Text(localization.lookup(value)!),
|
||||
Text(localization.lookup(value)),
|
||||
value: value,
|
||||
))
|
||||
.toList();
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ class TransactionListItem extends StatelessWidget {
|
|||
),
|
||||
Text(
|
||||
localization!.lookup(
|
||||
kPurchaseOrderStatuses[transaction.statusId])!,
|
||||
kPurchaseOrderStatuses[transaction.statusId]),
|
||||
style: TextStyle(
|
||||
color: TransactionStatusColors(
|
||||
state.prefState.colorThemeModel)
|
||||
|
|
|
|||
|
|
@ -180,11 +180,11 @@ class _TransactionRuleEditState extends State<TransactionRuleEdit> {
|
|||
children: [
|
||||
Expanded(
|
||||
child:
|
||||
Text(localization.lookup(rule.searchKey)!),
|
||||
Text(localization.lookup(rule.searchKey)),
|
||||
),
|
||||
Expanded(
|
||||
child:
|
||||
Text(localization.lookup(rule.operator)!),
|
||||
Text(localization.lookup(rule.operator)),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(rule.value),
|
||||
|
|
|
|||
|
|
@ -102,10 +102,10 @@ class _TransactionRuleViewState extends State<TransactionRuleView> {
|
|||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(localization.lookup(rule.searchKey)!),
|
||||
child: Text(localization.lookup(rule.searchKey)),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(localization.lookup(rule.operator)!),
|
||||
child: Text(localization.lookup(rule.operator)),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(rule.value),
|
||||
|
|
|
|||
|
|
@ -431,7 +431,7 @@ class _UserEditState extends State<UserEdit>
|
|||
final editPermission = 'edit_' + type.apiValue;
|
||||
final viewPermission = 'view_' + type.apiValue;
|
||||
return DataRow(cells: [
|
||||
DataCell(Text(localization.lookup('$type')!),
|
||||
DataCell(Text(localization.lookup('$type')),
|
||||
onTap: () {
|
||||
_togglePermission(createPermission);
|
||||
WidgetsBinding.instance
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ class VendorEditDetailsState extends State<VendorEditDetails> {
|
|||
},
|
||||
items: kTaxClassifications
|
||||
.map((classification) => DropdownMenuItem(
|
||||
child: Text(localization.lookup(classification)!),
|
||||
child: Text(localization.lookup(classification)),
|
||||
value: classification,
|
||||
))
|
||||
.toList(),
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ class VendorPresenter extends EntityPresenter {
|
|||
: formatDate(
|
||||
convertTimestampToDateString(vendor.lastLogin), context));
|
||||
case VendorFields.classification:
|
||||
return Text(localization!.lookup(vendor!.classification)!);
|
||||
return Text(localization!.lookup(vendor!.classification));
|
||||
}
|
||||
|
||||
return super.getField(field: field, context: context);
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ class _WebhookEditState extends State<WebhookEdit> {
|
|||
items: WebhookEntity.EVENT_MAP.keys
|
||||
.map((eventId) => DropdownMenuItem(
|
||||
child: Text(localization
|
||||
.lookup(WebhookEntity.EVENT_MAP[eventId])!),
|
||||
.lookup(WebhookEntity.EVENT_MAP[eventId])),
|
||||
value: eventId,
|
||||
))
|
||||
.toList(),
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class WebhookListItem extends StatelessWidget {
|
|||
subtitle: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(localization.lookup(webhook.eventType)!),
|
||||
Text(localization.lookup(webhook.eventType)),
|
||||
subtitle != null && subtitle.isNotEmpty
|
||||
? Text(
|
||||
subtitle,
|
||||
|
|
|
|||
|
|
@ -109889,7 +109889,7 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
|||
|
||||
// STARTER: lang field - do not remove comment
|
||||
|
||||
String? lookup(String? key) {
|
||||
String lookup(String? key) {
|
||||
final lookupKey = toSnakeCase(key);
|
||||
|
||||
if ((key ?? '').isEmpty) {
|
||||
|
|
@ -109897,7 +109897,7 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
|||
}
|
||||
|
||||
if (lookupKey.startsWith('_')) {
|
||||
return key;
|
||||
return key ?? '';
|
||||
}
|
||||
|
||||
final value = _localizedValues[localeCode]![lookupKey] ??
|
||||
|
|
@ -109907,9 +109907,9 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
|||
if (value.isEmpty) {
|
||||
print('## ERROR: localization key not found - $key');
|
||||
|
||||
final englishValue = _localizedValues['en']![lookupKey]!;
|
||||
final englishValue = _localizedValues['en']![lookupKey] ?? '';
|
||||
|
||||
return englishValue.isEmpty ? key : englishValue;
|
||||
return englishValue.isEmpty ? (key ?? '') : englishValue;
|
||||
}
|
||||
|
||||
return value;
|
||||
|
|
|
|||
Loading…
Reference in New Issue