Skip to content

Commit 4b9e366

Browse files
spydonrussellwheatley
authored andcommitted
chore: Fix null safety analyzer warnings (#11504)
* chore: Add trailing commas where needed * chore: Fix the nullsafety analyzer warnings * ci: fix broken test run using Flutter `dev` version * ci: switch to `macos-latest` for building web apps * ci: pin flutter version '3.10.6' temporarily for building web apps * chore: fix trailing commas * chore: format --------- Co-authored-by: russellwheatley <[email protected]>
1 parent 4557064 commit 4b9e366

File tree

65 files changed

+544
-541
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+544
-541
lines changed

.github/workflows/all_plugins.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ jobs:
112112
- uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa
113113
with:
114114
channel: 'stable'
115+
# TODO - remove the below fixed version once hot fix lands: https://github.com/flutter/flutter/issues/132711
116+
flutter-version: '3.10.6'
115117
cache: true
116118
- uses: bluefireteam/melos-action@dd3c344d731938d2ab2567a261f54a19a68b5f6a
117119
with:

packages/cloud_firestore/cloud_firestore/dartpad/lib/main.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class _FilmListState extends State<FilmList> {
103103
style: Theme.of(context).textTheme.bodySmall,
104104
);
105105
},
106-
)
106+
),
107107
],
108108
),
109109
actions: <Widget>[
@@ -220,7 +220,7 @@ class _MovieItem extends StatelessWidget {
220220
Likes(
221221
reference: reference,
222222
currentLikes: movie.likes,
223-
)
223+
),
224224
],
225225
),
226226
);
@@ -264,7 +264,7 @@ class _MovieItem extends StatelessWidget {
264264
style: const TextStyle(color: Colors.white),
265265
),
266266
),
267-
)
267+
),
268268
];
269269
}
270270

packages/cloud_firestore/cloud_firestore/example/integration_test/collection_reference_e2e.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ void runCollectionReferenceTests() {
119119
emits(
120120
isA<QuerySnapshot>().having((e) => e.docs, 'docs', [
121121
isA<QueryDocumentSnapshot>()
122-
.having((e) => e.data(), 'data', {'value': 42})
122+
.having((e) => e.data(), 'data', {'value': 42}),
123123
]),
124124
),
125125
);
@@ -128,7 +128,7 @@ void runCollectionReferenceTests() {
128128
emits(
129129
isA<QuerySnapshot<int>>().having((e) => e.docs, 'docs', [
130130
isA<QueryDocumentSnapshot<int>>()
131-
.having((e) => e.data(), 'data', 42)
131+
.having((e) => e.data(), 'data', 42),
132132
]),
133133
),
134134
);
@@ -145,7 +145,7 @@ void runCollectionReferenceTests() {
145145
isA<QueryDocumentSnapshot<Map<String, dynamic>>>()
146146
.having((e) => e.data(), 'data', {'value': 42}),
147147
isA<QueryDocumentSnapshot<Map<String, dynamic>>>()
148-
.having((e) => e.data(), 'data', {'value': 21})
148+
.having((e) => e.data(), 'data', {'value': 21}),
149149
]),
150150
),
151151
),
@@ -161,7 +161,7 @@ void runCollectionReferenceTests() {
161161
isA<QueryDocumentSnapshot<int>>()
162162
.having((e) => e.data(), 'data', 42),
163163
isA<QueryDocumentSnapshot<int>>()
164-
.having((e) => e.data(), 'data', 21)
164+
.having((e) => e.data(), 'data', 21),
165165
]),
166166
),
167167
),
@@ -189,7 +189,7 @@ void runCollectionReferenceTests() {
189189
isA<QuerySnapshot<Null>>().having((e) => e.docs, 'docs', [
190190
// ignore: prefer_void_to_null
191191
isA<QueryDocumentSnapshot<Null>>()
192-
.having((e) => e.data(), 'data', null)
192+
.having((e) => e.data(), 'data', null),
193193
]),
194194
),
195195
);

packages/cloud_firestore/cloud_firestore/example/integration_test/document_reference_e2e.dart

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -355,14 +355,14 @@ void runDocumentReferenceTests() {
355355
'bool_false': false,
356356
'map': {
357357
'foo': 'bar',
358-
'bar': {'baz': 'ben'}
358+
'bar': {'baz': 'ben'},
359359
},
360360
'list': [
361361
1,
362362
'2',
363363
true,
364364
false,
365-
{'foo': 'bar'}
365+
{'foo': 'bar'},
366366
],
367367
'null': null,
368368
'timestamp': Timestamp.now(),
@@ -385,7 +385,7 @@ void runDocumentReferenceTests() {
385385
data['map'],
386386
equals(<String, dynamic>{
387387
'foo': 'bar',
388-
'bar': {'baz': 'ben'}
388+
'bar': {'baz': 'ben'},
389389
}),
390390
);
391391
expect(
@@ -395,7 +395,7 @@ void runDocumentReferenceTests() {
395395
'2',
396396
true,
397397
false,
398-
{'foo': 'bar'}
398+
{'foo': 'bar'},
399399
]),
400400
);
401401
expect(data['null'], equals(null));
@@ -427,13 +427,13 @@ void runDocumentReferenceTests() {
427427
DocumentReference<Map<String, dynamic>> document =
428428
await initializeTest('document-update-field-path');
429429
await document.set({
430-
'foo': {'bar': 'baz'}
430+
'foo': {'bar': 'baz'},
431431
});
432432
DocumentSnapshot<Map<String, dynamic>> snapshot = await document.get();
433433
expect(
434434
snapshot.data(),
435435
equals({
436-
'foo': {'bar': 'baz'}
436+
'foo': {'bar': 'baz'},
437437
}),
438438
);
439439

@@ -442,7 +442,7 @@ void runDocumentReferenceTests() {
442442
expect(
443443
snapshot2.data(),
444444
equals({
445-
'foo': {'bar': 'toto'}
445+
'foo': {'bar': 'toto'},
446446
}),
447447
);
448448
});
@@ -451,24 +451,24 @@ void runDocumentReferenceTests() {
451451
DocumentReference<Map<String, dynamic>> document =
452452
await initializeTest('document-update-field-path');
453453
await document.set({
454-
'foo': {'bar': 'baz'}
454+
'foo': {'bar': 'baz'},
455455
});
456456
DocumentSnapshot<Map<String, dynamic>> snapshot = await document.get();
457457
expect(
458458
snapshot.data(),
459459
equals({
460-
'foo': {'bar': 'baz'}
460+
'foo': {'bar': 'baz'},
461461
}),
462462
);
463463

464464
await document.update({
465-
FieldPath(const ['foo', 'bar']): 'toto'
465+
FieldPath(const ['foo', 'bar']): 'toto',
466466
});
467467
DocumentSnapshot<Map<String, dynamic>> snapshot2 = await document.get();
468468
expect(
469469
snapshot2.data(),
470470
equals({
471-
'foo': {'bar': 'toto'}
471+
'foo': {'bar': 'toto'},
472472
}),
473473
);
474474
});
@@ -485,7 +485,7 @@ void runDocumentReferenceTests() {
485485
);
486486

487487
await document.update({
488-
FieldPath(const ['foo.bar']): 'toto'
488+
FieldPath(const ['foo.bar']): 'toto',
489489
});
490490
DocumentSnapshot<Map<String, dynamic>> snapshot2 = await document.get();
491491
expect(

packages/cloud_firestore/cloud_firestore/example/integration_test/field_value_e2e.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ void runFieldValueTests() {
9696
DocumentReference<Map<String, dynamic>> doc =
9797
await initializeTest('field-value-array-union-update-array');
9898
await doc.set({
99-
'foo': [1, 2]
99+
'foo': [1, 2],
100100
});
101101
await doc.update({
102-
'foo': FieldValue.arrayUnion([3, 4])
102+
'foo': FieldValue.arrayUnion([3, 4]),
103103
});
104104
DocumentSnapshot<Map<String, dynamic>> snapshot = await doc.get();
105105
expect(snapshot.data()!['foo'], equals([1, 2, 3, 4]));
@@ -111,7 +111,7 @@ void runFieldValueTests() {
111111
await initializeTest('field-value-array-union-replace');
112112
await doc.set({'foo': 'bar'});
113113
await doc.update({
114-
'foo': FieldValue.arrayUnion([3, 4])
114+
'foo': FieldValue.arrayUnion([3, 4]),
115115
});
116116
DocumentSnapshot<Map<String, dynamic>> snapshot = await doc.get();
117117
expect(snapshot.data()!['foo'], equals([3, 4]));
@@ -122,7 +122,7 @@ void runFieldValueTests() {
122122
await initializeTest('field-value-array-union-replace');
123123
await doc.set({'foo': 'bar'});
124124
await doc.set({
125-
'foo': FieldValue.arrayUnion([3, 4])
125+
'foo': FieldValue.arrayUnion([3, 4]),
126126
});
127127
DocumentSnapshot<Map<String, dynamic>> snapshot = await doc.get();
128128
expect(snapshot.data()!['foo'], equals([3, 4]));
@@ -134,10 +134,10 @@ void runFieldValueTests() {
134134
DocumentReference<Map<String, dynamic>> doc =
135135
await initializeTest('field-value-array-remove-existing');
136136
await doc.set({
137-
'foo': [1, 2, 3, 4]
137+
'foo': [1, 2, 3, 4],
138138
});
139139
await doc.update({
140-
'foo': FieldValue.arrayRemove([3, 4])
140+
'foo': FieldValue.arrayRemove([3, 4]),
141141
});
142142
DocumentSnapshot<Map<String, dynamic>> snapshot = await doc.get();
143143
expect(snapshot.data()!['foo'], equals([1, 2]));
@@ -149,7 +149,7 @@ void runFieldValueTests() {
149149
await initializeTest('field-value-array-remove-replace');
150150
await doc.set({'foo': 'bar'});
151151
await doc.update({
152-
'foo': FieldValue.arrayUnion([3, 4])
152+
'foo': FieldValue.arrayUnion([3, 4]),
153153
});
154154
DocumentSnapshot<Map<String, dynamic>> snapshot = await doc.get();
155155
expect(snapshot.data()!['foo'], equals([3, 4]));
@@ -161,7 +161,7 @@ void runFieldValueTests() {
161161
await initializeTest('field-value-array-remove-replace');
162162
await doc.set({'foo': 'bar'});
163163
await doc.set({
164-
'foo': FieldValue.arrayUnion([3, 4])
164+
'foo': FieldValue.arrayUnion([3, 4]),
165165
});
166166
DocumentSnapshot<Map<String, dynamic>> snapshot = await doc.get();
167167
expect(snapshot.data()!['foo'], equals([3, 4]));
@@ -179,10 +179,10 @@ void runFieldValueTests() {
179179
FirebaseFirestore.instance.doc('foo/bar');
180180

181181
await doc.set({
182-
'foo': [1]
182+
'foo': [1],
183183
});
184184
await doc.update({
185-
'foo': FieldValue.arrayUnion([2, ref])
185+
'foo': FieldValue.arrayUnion([2, ref]),
186186
});
187187
DocumentSnapshot<Map<String, dynamic>> snapshot = await doc.get();
188188
expect(snapshot.data()!['foo'], equals([1, 2, ref]));

packages/cloud_firestore/cloud_firestore/example/integration_test/instance_e2e.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ void runInstanceTests() {
159159
fieldPath: 'fieldPath',
160160
order: Order.ascending,
161161
arrayConfig: ArrayConfig.contains,
162-
)
162+
),
163163
],
164164
);
165165

@@ -239,17 +239,17 @@ void runInstanceTests() {
239239
'queryScope': 'COLLECTION',
240240
'fields': [
241241
{'fieldPath': 'author', 'arrayConfig': 'CONTAINS'},
242-
{'fieldPath': 'timestamp', 'order': 'DESCENDING'}
243-
]
242+
{'fieldPath': 'timestamp', 'order': 'DESCENDING'},
243+
],
244244
}
245245
],
246246
'fieldOverrides': [
247247
{
248248
'collectionGroup': 'posts',
249249
'fieldPath': 'myBigMapField',
250-
'indexes': []
250+
'indexes': [],
251251
}
252-
]
252+
],
253253
});
254254

255255
await firestore.setIndexConfigurationFromJSON(json);

0 commit comments

Comments
 (0)