Skip to content

Commit 275fb02

Browse files
Fix avoid_redundant_argument_values analyzer warnings enabled in the latest Dart SDK (#103734)
See flutter/flutter#103719
1 parent 708c363 commit 275fb02

File tree

12 files changed

+7
-22
lines changed

12 files changed

+7
-22
lines changed

dev/integration_tests/flutter_gallery/lib/demo/material/leave_behind_demo.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ class _LeaveBehindListItem extends StatelessWidget {
275275
Future<bool?> _showConfirmationDialog(BuildContext context, String action) {
276276
return showDialog<bool>(
277277
context: context,
278-
barrierDismissible: true,
279278
builder: (BuildContext context) {
280279
return AlertDialog(
281280
title: Text('Do you want to $action this item?'),

packages/flutter/lib/src/foundation/_isolates_io.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ Future<R> compute<Q, R>(isolates.ComputeCallback<Q, R> callback, Q message, { St
4141
debugLabel,
4242
flow.id,
4343
),
44-
errorsAreFatal: true,
4544
onExit: port.sendPort,
4645
onError: port.sendPort,
4746
debugName: debugLabel,

packages/flutter/lib/src/services/system_chrome.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,6 @@ class SystemChrome {
500500
if (callback != null) {
501501
await SystemChannels.platform.invokeMethod<void>(
502502
'SystemChrome.setSystemUIChangeListener',
503-
null,
504503
);
505504
}
506505
}
@@ -517,7 +516,6 @@ class SystemChrome {
517516
static Future<void> restoreSystemUIOverlays() async {
518517
await SystemChannels.platform.invokeMethod<void>(
519518
'SystemChrome.restoreSystemUIOverlays',
520-
null,
521519
);
522520
}
523521

packages/flutter/lib/src/widgets/navigator.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5268,7 +5268,7 @@ class _NamedRestorationInformation extends _RestorationInformation {
52685268

52695269
@override
52705270
Route<dynamic> createRoute(NavigatorState navigator) {
5271-
final Route<dynamic> route = navigator._routeNamed<dynamic>(name, arguments: arguments, allowNull: false)!;
5271+
final Route<dynamic> route = navigator._routeNamed<dynamic>(name, arguments: arguments)!;
52725272
assert(route != null);
52735273
return route;
52745274
}

packages/flutter/test/cupertino/route_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1635,7 +1635,6 @@ void main() {
16351635
await showCupertinoModalPopup<void>(
16361636
context: context,
16371637
builder: (BuildContext context) => const Text('Visible'),
1638-
barrierDismissible: true,
16391638
);
16401639
},
16411640
child: const Text('tap'),

packages/flutter/test/material/bottom_sheet_test.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ void main() {
218218
showModalBottomSheet<void>(
219219
context: savedContext,
220220
isDismissible: false,
221-
enableDrag: true,
222221
builder: (BuildContext context) {
223222
numBuilderCalls++;
224223
return const Text('BottomSheet');
@@ -323,7 +322,6 @@ void main() {
323322
showModalBottomSheet<void>(
324323
context: savedContext,
325324
builder: (BuildContext context) => const Text('BottomSheet'),
326-
isDismissible: true,
327325
).then<void>((void value) {
328326
showBottomSheetThenCalled = true;
329327
});
@@ -498,7 +496,6 @@ void main() {
498496
showModalBottomSheet<void>(
499497
context: savedContext,
500498
isDismissible: false,
501-
enableDrag: true,
502499
builder: (BuildContext context) => const Text('BottomSheet'),
503500
).then<void>((void value) {
504501
showBottomSheetThenCalled = true;
@@ -531,7 +528,6 @@ void main() {
531528
showModalBottomSheet<void>(
532529
context: savedContext,
533530
isDismissible: false,
534-
enableDrag: true,
535531
builder: (BuildContext context) {
536532
numBuilderCalls++;
537533
return const Text('BottomSheet');

packages/flutter/test/material/dialog_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1648,7 +1648,6 @@ void main() {
16481648
Future<bool?> confirmDismiss (DismissDirection dismissDirection) async {
16491649
return showDialog<bool>(
16501650
context: scaffoldKey.currentContext!,
1651-
barrierDismissible: true, // showDialog() returns null if tapped outside the dialog
16521651
builder: (BuildContext context) {
16531652
return AlertDialog(
16541653
actions: <Widget>[

packages/flutter/test/widgets/routes_test.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,6 @@ void main() {
10191019
onPressed: () {
10201020
showGeneralDialog<void>(
10211021
context: context,
1022-
barrierDismissible: false,
10231022
transitionDuration: Duration.zero,
10241023
pageBuilder: (BuildContext innerContext, _, __) {
10251024
return const SizedBox();
@@ -1097,7 +1096,6 @@ void main() {
10971096
onPressed: () {
10981097
showGeneralDialog<void>(
10991098
context: context,
1100-
barrierDismissible: false,
11011099
transitionDuration: Duration.zero,
11021100
pageBuilder: (BuildContext innerContext, _, __) {
11031101
return const SizedBox();
@@ -1135,7 +1133,6 @@ void main() {
11351133
showGeneralDialog<void>(
11361134
useRootNavigator: false,
11371135
context: context,
1138-
barrierDismissible: false,
11391136
transitionDuration: Duration.zero,
11401137
pageBuilder: (BuildContext innerContext, _, __) {
11411138
return const SizedBox();

packages/flutter_tools/lib/src/android/android_workflow.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,12 +402,12 @@ class AndroidLicenseValidator extends DoctorValidator {
402402
.transform<String>(const Utf8Decoder(reportErrors: false))
403403
.transform<String>(const LineSplitter())
404404
.listen(handleLine)
405-
.asFuture<void>(null);
405+
.asFuture<void>();
406406
final Future<void> errors = process.stderr
407407
.transform<String>(const Utf8Decoder(reportErrors: false))
408408
.transform<String>(const LineSplitter())
409409
.listen(handleLine)
410-
.asFuture<void>(null);
410+
.asFuture<void>();
411411
await Future.wait<void>(<Future<void>>[output, errors]);
412412
return status ?? LicensesAccepted.unknown;
413413
} on ProcessException catch (e) {

packages/flutter_tools/lib/src/base/process.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,11 @@ class _DefaultProcessUtils implements ProcessUtils {
295295
final Future<void> stdoutFuture = process.stdout
296296
.transform<String>(const Utf8Decoder(reportErrors: false))
297297
.listen(stdoutBuffer.write)
298-
.asFuture<void>(null);
298+
.asFuture<void>();
299299
final Future<void> stderrFuture = process.stderr
300300
.transform<String>(const Utf8Decoder(reportErrors: false))
301301
.listen(stderrBuffer.write)
302-
.asFuture<void>(null);
302+
.asFuture<void>();
303303

304304
int? exitCode;
305305
exitCode = await process.exitCode.then<int?>((int x) => x).timeout(timeout, onTimeout: () {

0 commit comments

Comments
 (0)