Null safety
This commit is contained in:
parent
e5b0ba8365
commit
818e39a0e8
|
|
@ -17,7 +17,7 @@ class DesignPicker extends StatelessWidget {
|
|||
this.initialValue,
|
||||
});
|
||||
|
||||
final Function(DesignEntity?) onSelected;
|
||||
final Function(DesignEntity) onSelected;
|
||||
final String? label;
|
||||
final String? initialValue;
|
||||
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class CreditEditDetailsVM extends EntityEditDetailsVM {
|
|||
force: true,
|
||||
completer: completer,
|
||||
cancelCompleter: Completer<Null>()
|
||||
..future.then((_) {
|
||||
..future.then<Null>(() {
|
||||
store.dispatch(UpdateCurrentRoute(CreditEditScreen.route));
|
||||
} as FutureOr<Null> Function(Null)));
|
||||
completer.future.then((SelectableEntity client) {
|
||||
|
|
|
|||
|
|
@ -414,7 +414,7 @@ class DashboardPanels extends StatelessWidget {
|
|||
final previousExpenseData = memoizedPreviousChartExpenses(
|
||||
state.staticState.currencyMap,
|
||||
state.company,
|
||||
settings.rebuild((b) => b..offset += 1),
|
||||
settings.rebuild((b) => b..offset = settings.offset + 1),
|
||||
state.invoiceState.map,
|
||||
state.expenseState.map);
|
||||
|
||||
|
|
@ -481,8 +481,8 @@ class DashboardPanels extends StatelessWidget {
|
|||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child:
|
||||
Text(localization!.addGatewayHelpMessage!),
|
||||
child: Text(
|
||||
localization!.addGatewayHelpMessage!),
|
||||
),
|
||||
if (isDesktop(context))
|
||||
TextButton(
|
||||
|
|
@ -633,7 +633,8 @@ class DashboardPanels extends StatelessWidget {
|
|||
return FormCard(
|
||||
padding: const EdgeInsets.all(0),
|
||||
children: [
|
||||
Text(localization!.lookup(dashboardField.field)!,
|
||||
Text(
|
||||
localization!.lookup(dashboardField.field)!,
|
||||
style: textTheme.titleMedium,
|
||||
textAlign: TextAlign.center),
|
||||
SizedBox(height: 6),
|
||||
|
|
@ -647,7 +648,8 @@ class DashboardPanels extends StatelessWidget {
|
|||
style: textTheme.headlineSmall,
|
||||
textAlign: TextAlign.center),
|
||||
SizedBox(height: 6),
|
||||
Text(localization.lookup(dashboardField.period)!,
|
||||
Text(
|
||||
localization.lookup(dashboardField.period)!,
|
||||
style: textTheme.bodySmall,
|
||||
textAlign: TextAlign.center),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -230,7 +230,8 @@ class _DesignEditState extends State<DesignEdit>
|
|||
return EditScaffold(
|
||||
entity: design,
|
||||
isFullscreen: true,
|
||||
title: design.isNew ? localization!.newDesign : localization!.editDesign,
|
||||
title:
|
||||
design.isNew ? localization!.newDesign : localization!.editDesign,
|
||||
onCancelPressed: (context) => viewModel.onCancelPressed(context),
|
||||
appBarBottom: isMobile(context)
|
||||
? TabBar(
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class DocumentPresenter extends EntityPresenter {
|
|||
case DocumentFields.id:
|
||||
return Text(document!.id);
|
||||
case DocumentFields.hash:
|
||||
return Text(document.hash);
|
||||
return Text(document!.hash);
|
||||
case DocumentFields.linkedTo:
|
||||
final parentEntity =
|
||||
state.getEntity(document!.parentType, document.parentId);
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ class InvoiceEditDetailsVM extends EntityEditDetailsVM {
|
|||
force: true,
|
||||
completer: completer,
|
||||
cancelCompleter: Completer<Null>()
|
||||
..future.then((_) {
|
||||
..future.then<Null>(() {
|
||||
store.dispatch(UpdateCurrentRoute(InvoiceEditScreen.route));
|
||||
} as FutureOr<Null> Function(Null)));
|
||||
completer.future.then((SelectableEntity client) {
|
||||
|
|
|
|||
|
|
@ -208,7 +208,8 @@ class InvoiceEditVM extends AbstractInvoiceEditVM {
|
|||
..projectId = projectId ?? ''
|
||||
..invitations.replace(BuiltList<InvitationEntity>(client!
|
||||
.emailContacts
|
||||
.map((contact) => InvitationEntity(clientContactId: contact!.id))
|
||||
.map(
|
||||
(contact) => InvitationEntity(clientContactId: contact!.id))
|
||||
.toList())))));
|
||||
}
|
||||
store.dispatch(AddInvoiceItems(items));
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class ProjectEditVM {
|
|||
force: true,
|
||||
completer: completer,
|
||||
cancelCompleter: Completer<Null>()
|
||||
..future.then((_) {
|
||||
..future.then<Null>(() {
|
||||
store.dispatch(UpdateCurrentRoute(ProjectEditScreen.route));
|
||||
} as FutureOr<Null> Function(Null)));
|
||||
completer.future.then((SelectableEntity client) {
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class RecurringExpenseEditVM extends AbstractExpenseEditVM {
|
|||
AppState? state,
|
||||
ExpenseEntity? expense,
|
||||
Function(ExpenseEntity)? onChanged,
|
||||
Function(BuildContext)? onSavePressed,
|
||||
Function(BuildContext, [EntityAction?])? onSavePressed,
|
||||
Function(BuildContext)? onCancelPressed,
|
||||
bool? isLoading,
|
||||
bool? isSaving,
|
||||
|
|
@ -62,8 +62,7 @@ class RecurringExpenseEditVM extends AbstractExpenseEditVM {
|
|||
state: state,
|
||||
expense: expense,
|
||||
onChanged: onChanged,
|
||||
onSavePressed:
|
||||
onSavePressed as dynamic Function(BuildContext, [EntityAction])?,
|
||||
onSavePressed: onSavePressed,
|
||||
onCancelPressed: onCancelPressed,
|
||||
origExpense: origExpense,
|
||||
onAddClientPressed: onAddClientPressed,
|
||||
|
|
@ -91,10 +90,10 @@ class RecurringExpenseEditVM extends AbstractExpenseEditVM {
|
|||
force: true,
|
||||
completer: completer,
|
||||
cancelCompleter: Completer<Null>()
|
||||
..future.then((_) {
|
||||
..future.then<Null>(() {
|
||||
store.dispatch(
|
||||
UpdateCurrentRoute(RecurringExpenseEditScreen.route));
|
||||
} as FutureOr<Null> Function(Null)));
|
||||
} as FutureOr<_> Function(Null)));
|
||||
completer.future.then((SelectableEntity client) {
|
||||
store.dispatch(UpdateCurrentRoute(RecurringExpenseEditScreen.route));
|
||||
});
|
||||
|
|
@ -106,7 +105,7 @@ class RecurringExpenseEditVM extends AbstractExpenseEditVM {
|
|||
force: true,
|
||||
completer: completer,
|
||||
cancelCompleter: Completer<Null>()
|
||||
..future.then((_) {
|
||||
..future.then<Null>(() {
|
||||
store.dispatch(
|
||||
UpdateCurrentRoute(RecurringExpenseEditScreen.route));
|
||||
} as FutureOr<Null> Function(Null)));
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ class RecurringInvoiceEditDetailsVM extends EntityEditDetailsVM {
|
|||
CompanyEntity? company,
|
||||
InvoiceEntity? invoice,
|
||||
Function(InvoiceEntity)? onChanged,
|
||||
Function(BuildContext, InvoiceEntity, ClientEntity)? onClientChanged,
|
||||
Function(BuildContext, InvoiceEntity, VendorEntity)? onVendorChanged,
|
||||
Function(BuildContext, InvoiceEntity, ClientEntity?)? onClientChanged,
|
||||
Function(BuildContext, InvoiceEntity, VendorEntity?)? onVendorChanged,
|
||||
BuiltMap<String?, ClientEntity?>? clientMap,
|
||||
BuiltList<String>? clientList,
|
||||
Function(BuildContext context, Completer<SelectableEntity> completer)?
|
||||
|
|
@ -103,7 +103,7 @@ class RecurringInvoiceEditDetailsVM extends EntityEditDetailsVM {
|
|||
force: true,
|
||||
completer: completer,
|
||||
cancelCompleter: Completer<Null>()
|
||||
..future.then((_) {
|
||||
..future.then<Null>(() {
|
||||
store.dispatch(
|
||||
UpdateCurrentRoute(RecurringInvoiceEditScreen.route));
|
||||
} as FutureOr<Null> Function(Null)));
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class RecurringInvoiceEditVM extends AbstractInvoiceEditVM {
|
|||
InvoiceEntity? invoice,
|
||||
int? invoiceItemIndex,
|
||||
InvoiceEntity? origInvoice,
|
||||
Function(BuildContext)? onSavePressed,
|
||||
Function(BuildContext, [EntityAction?])? onSavePressed,
|
||||
Function(List<InvoiceItemEntity>, String, String)? onItemsAdded,
|
||||
bool? isSaving,
|
||||
Function(BuildContext)? onCancelPressed,
|
||||
|
|
@ -63,7 +63,7 @@ class RecurringInvoiceEditVM extends AbstractInvoiceEditVM {
|
|||
invoice: invoice,
|
||||
invoiceItemIndex: invoiceItemIndex,
|
||||
origInvoice: origInvoice,
|
||||
onSavePressed: onSavePressed as dynamic Function(BuildContext, [EntityAction])?,
|
||||
onSavePressed: onSavePressed,
|
||||
onItemsAdded: onItemsAdded,
|
||||
isSaving: isSaving,
|
||||
onCancelPressed: onCancelPressed,
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class TaskEditDetailsVM {
|
|||
force: true,
|
||||
completer: completer,
|
||||
cancelCompleter: Completer<Null>()
|
||||
..future.then((_) {
|
||||
..future.then<Null>(() {
|
||||
store.dispatch(UpdateCurrentRoute(TaskEditDetailsScreen.route));
|
||||
} as FutureOr<Null> Function(Null)));
|
||||
completer.future.then((SelectableEntity client) {
|
||||
|
|
@ -107,7 +107,7 @@ class TaskEditDetailsVM {
|
|||
force: true,
|
||||
completer: completer,
|
||||
cancelCompleter: Completer<Null>()
|
||||
..future.then((_) {
|
||||
..future.then<Null>(() {
|
||||
store.dispatch(UpdateCurrentRoute(TaskEditDetailsScreen.route));
|
||||
} as FutureOr<Null> Function(Null)));
|
||||
completer.future.then((SelectableEntity client) {
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class TransactionEditVM {
|
|||
force: true,
|
||||
completer: completer,
|
||||
cancelCompleter: Completer<Null>()
|
||||
..future.then((_) {
|
||||
..future.then<Null>(() {
|
||||
store.dispatch(UpdateCurrentRoute(TransactionEditScreen.route));
|
||||
} as FutureOr<Null> Function(Null)));
|
||||
completer.future.then((SelectableEntity client) {
|
||||
|
|
|
|||
|
|
@ -1109,7 +1109,7 @@ class _MatchWithdrawalsState extends State<_MatchWithdrawals> {
|
|||
force: true,
|
||||
completer: completer,
|
||||
cancelCompleter: Completer<Null>()
|
||||
..future.then((_) {
|
||||
..future.then<Null>(() {
|
||||
store.dispatch(UpdateCurrentRoute(
|
||||
TransactionScreen.route));
|
||||
} as FutureOr<Null> Function(Null)));
|
||||
|
|
@ -1193,7 +1193,7 @@ class _MatchWithdrawalsState extends State<_MatchWithdrawals> {
|
|||
force: true,
|
||||
completer: completer,
|
||||
cancelCompleter: Completer<Null>()
|
||||
..future.then((_) {
|
||||
..future.then<Null>(() {
|
||||
store.dispatch(UpdateCurrentRoute(
|
||||
TransactionScreen.route));
|
||||
} as FutureOr<Null> Function(Null)));
|
||||
|
|
|
|||
Loading…
Reference in New Issue