diff --git a/packages/dynamite/lib/src/openapi_builder.dart b/packages/dynamite/lib/src/openapi_builder.dart index 5c8bbb07..64fbc7a7 100644 --- a/packages/dynamite/lib/src/openapi_builder.dart +++ b/packages/dynamite/lib/src/openapi_builder.dart @@ -33,9 +33,7 @@ class OpenAPIBuilder implements Builder { if (spec.paths != null) ...{ for (final pathItem in spec.paths!.values) ...{ for (final operation in pathItem.operations.values) ...{ - if (operation.tags != null) ...{ - ...operation.tags!, - }, + ...?operation.tags, }, }, }, @@ -518,9 +516,7 @@ class OpenAPIBuilder implements Builder { ]) ..body = const Code(''' this.baseHeaders = { - if (baseHeaders != null) ...{ - ...baseHeaders, - }, + ...?baseHeaders, }; this.httpClient = (httpClient ?? HttpClient())..userAgent = userAgent; '''), @@ -670,12 +666,7 @@ class OpenAPIBuilder implements Builder { final acceptHeader = operation.responses?.values .map((final response) => response.content?.keys) - .reduce( - (final a, final b) => [ - ...a ?? [], - ...b ?? [], - ], - ) + .reduce((final a, final b) => [...?a, ...?b]) ?.toSet() .join(','); final code = StringBuffer(''' diff --git a/packages/neon/neon/lib/src/widgets/list_view.dart b/packages/neon/neon/lib/src/widgets/list_view.dart index c4325500..8e4a3633 100644 --- a/packages/neon/neon/lib/src/widgets/list_view.dart +++ b/packages/neon/neon/lib/src/widgets/list_view.dart @@ -29,9 +29,7 @@ class NeonListView extends StatelessWidget { onRefresh: onRefresh, child: Column( children: [ - if (topFixedChildren != null) ...[ - ...topFixedChildren!, - ], + ...?topFixedChildren, NeonLinearProgressIndicator( margin: const EdgeInsets.symmetric( horizontal: 10, @@ -47,9 +45,7 @@ class NeonListView extends StatelessWidget { key: scrollKey != null ? PageStorageKey(scrollKey!) : null, padding: withFloatingActionButton ? const EdgeInsets.only(bottom: 88) : null, children: [ - if (topScrollingChildren != null) ...[ - ...topScrollingChildren!, - ], + ...?topScrollingChildren, NeonException( error, onRetry: onRefresh, diff --git a/packages/neon/neon_notes/lib/widgets/notes_view.dart b/packages/neon/neon_notes/lib/widgets/notes_view.dart index 7cb4fc2d..cfc5e7e7 100644 --- a/packages/neon/neon_notes/lib/widgets/notes_view.dart +++ b/packages/neon/neon_notes/lib/widgets/notes_view.dart @@ -51,12 +51,8 @@ class NotesView extends StatelessWidget { scrollKey: 'notes-notes', withFloatingActionButton: true, items: [ - if (sortedFavorites != null) ...[ - ...sortedFavorites, - ], - if (sortedNonFavorites != null) ...[ - ...sortedNonFavorites, - ], + ...?sortedFavorites, + ...?sortedNonFavorites, ], isLoading: notes.loading, error: notes.error, diff --git a/packages/nextcloud/lib/src/nextcloud.openapi.dart b/packages/nextcloud/lib/src/nextcloud.openapi.dart index 8c27481a..ef49897d 100644 --- a/packages/nextcloud/lib/src/nextcloud.openapi.dart +++ b/packages/nextcloud/lib/src/nextcloud.openapi.dart @@ -106,9 +106,7 @@ class NextcloudClient { this.authentications = const [], }) { this.baseHeaders = { - if (baseHeaders != null) ...{ - ...baseHeaders, - }, + ...?baseHeaders, }; this.httpClient = (httpClient ?? HttpClient())..userAgent = userAgent; }