Browse Source

dynamite, neon, nextcloud: nullaware spreads (codestyle)

pull/289/head
Nikolas Rimikis 2 years ago
parent
commit
8394d9c4ef
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 15
      packages/dynamite/lib/src/openapi_builder.dart
  2. 8
      packages/neon/neon/lib/src/widgets/list_view.dart
  3. 8
      packages/neon/neon_notes/lib/widgets/notes_view.dart
  4. 4
      packages/nextcloud/lib/src/nextcloud.openapi.dart

15
packages/dynamite/lib/src/openapi_builder.dart

@ -33,9 +33,7 @@ class OpenAPIBuilder implements Builder {
if (spec.paths != null) ...{ if (spec.paths != null) ...{
for (final pathItem in spec.paths!.values) ...{ for (final pathItem in spec.paths!.values) ...{
for (final operation in pathItem.operations.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(''' ..body = const Code('''
this.baseHeaders = { this.baseHeaders = {
if (baseHeaders != null) ...{ ...?baseHeaders,
...baseHeaders,
},
}; };
this.httpClient = (httpClient ?? HttpClient())..userAgent = userAgent; this.httpClient = (httpClient ?? HttpClient())..userAgent = userAgent;
'''), '''),
@ -670,12 +666,7 @@ class OpenAPIBuilder implements Builder {
final acceptHeader = operation.responses?.values final acceptHeader = operation.responses?.values
.map((final response) => response.content?.keys) .map((final response) => response.content?.keys)
.reduce( .reduce((final a, final b) => [...?a, ...?b])
(final a, final b) => [
...a ?? [],
...b ?? [],
],
)
?.toSet() ?.toSet()
.join(','); .join(',');
final code = StringBuffer(''' final code = StringBuffer('''

8
packages/neon/neon/lib/src/widgets/list_view.dart

@ -29,9 +29,7 @@ class NeonListView<T> extends StatelessWidget {
onRefresh: onRefresh, onRefresh: onRefresh,
child: Column( child: Column(
children: [ children: [
if (topFixedChildren != null) ...[ ...?topFixedChildren,
...topFixedChildren!,
],
NeonLinearProgressIndicator( NeonLinearProgressIndicator(
margin: const EdgeInsets.symmetric( margin: const EdgeInsets.symmetric(
horizontal: 10, horizontal: 10,
@ -47,9 +45,7 @@ class NeonListView<T> extends StatelessWidget {
key: scrollKey != null ? PageStorageKey<String>(scrollKey!) : null, key: scrollKey != null ? PageStorageKey<String>(scrollKey!) : null,
padding: withFloatingActionButton ? const EdgeInsets.only(bottom: 88) : null, padding: withFloatingActionButton ? const EdgeInsets.only(bottom: 88) : null,
children: [ children: [
if (topScrollingChildren != null) ...[ ...?topScrollingChildren,
...topScrollingChildren!,
],
NeonException( NeonException(
error, error,
onRetry: onRefresh, onRetry: onRefresh,

8
packages/neon/neon_notes/lib/widgets/notes_view.dart

@ -51,12 +51,8 @@ class NotesView extends StatelessWidget {
scrollKey: 'notes-notes', scrollKey: 'notes-notes',
withFloatingActionButton: true, withFloatingActionButton: true,
items: [ items: [
if (sortedFavorites != null) ...[ ...?sortedFavorites,
...sortedFavorites, ...?sortedNonFavorites,
],
if (sortedNonFavorites != null) ...[
...sortedNonFavorites,
],
], ],
isLoading: notes.loading, isLoading: notes.loading,
error: notes.error, error: notes.error,

4
packages/nextcloud/lib/src/nextcloud.openapi.dart

@ -106,9 +106,7 @@ class NextcloudClient {
this.authentications = const [], this.authentications = const [],
}) { }) {
this.baseHeaders = { this.baseHeaders = {
if (baseHeaders != null) ...{ ...?baseHeaders,
...baseHeaders,
},
}; };
this.httpClient = (httpClient ?? HttpClient())..userAgent = userAgent; this.httpClient = (httpClient ?? HttpClient())..userAgent = userAgent;
} }

Loading…
Cancel
Save