Skip to content

Commit

Permalink
Fix avoid_redundant_argument_values analyzer warnings enabled in the …
Browse files Browse the repository at this point in the history
…latest Dart SDK (#103734)

See flutter/flutter#103719
  • Loading branch information
jason-simmons authored May 13, 2022
1 parent 708c363 commit 275fb02
Show file tree
Hide file tree
Showing 12 changed files with 7 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ class _LeaveBehindListItem extends StatelessWidget {
Future<bool?> _showConfirmationDialog(BuildContext context, String action) {
return showDialog<bool>(
context: context,
barrierDismissible: true,
builder: (BuildContext context) {
return AlertDialog(
title: Text('Do you want to $action this item?'),
Expand Down
1 change: 0 additions & 1 deletion packages/flutter/lib/src/foundation/_isolates_io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ Future<R> compute<Q, R>(isolates.ComputeCallback<Q, R> callback, Q message, { St
debugLabel,
flow.id,
),
errorsAreFatal: true,
onExit: port.sendPort,
onError: port.sendPort,
debugName: debugLabel,
Expand Down
2 changes: 0 additions & 2 deletions packages/flutter/lib/src/services/system_chrome.dart
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,6 @@ class SystemChrome {
if (callback != null) {
await SystemChannels.platform.invokeMethod<void>(
'SystemChrome.setSystemUIChangeListener',
null,
);
}
}
Expand All @@ -517,7 +516,6 @@ class SystemChrome {
static Future<void> restoreSystemUIOverlays() async {
await SystemChannels.platform.invokeMethod<void>(
'SystemChrome.restoreSystemUIOverlays',
null,
);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/widgets/navigator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5268,7 +5268,7 @@ class _NamedRestorationInformation extends _RestorationInformation {

@override
Route<dynamic> createRoute(NavigatorState navigator) {
final Route<dynamic> route = navigator._routeNamed<dynamic>(name, arguments: arguments, allowNull: false)!;
final Route<dynamic> route = navigator._routeNamed<dynamic>(name, arguments: arguments)!;
assert(route != null);
return route;
}
Expand Down
1 change: 0 additions & 1 deletion packages/flutter/test/cupertino/route_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1635,7 +1635,6 @@ void main() {
await showCupertinoModalPopup<void>(
context: context,
builder: (BuildContext context) => const Text('Visible'),
barrierDismissible: true,
);
},
child: const Text('tap'),
Expand Down
4 changes: 0 additions & 4 deletions packages/flutter/test/material/bottom_sheet_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ void main() {
showModalBottomSheet<void>(
context: savedContext,
isDismissible: false,
enableDrag: true,
builder: (BuildContext context) {
numBuilderCalls++;
return const Text('BottomSheet');
Expand Down Expand Up @@ -323,7 +322,6 @@ void main() {
showModalBottomSheet<void>(
context: savedContext,
builder: (BuildContext context) => const Text('BottomSheet'),
isDismissible: true,
).then<void>((void value) {
showBottomSheetThenCalled = true;
});
Expand Down Expand Up @@ -498,7 +496,6 @@ void main() {
showModalBottomSheet<void>(
context: savedContext,
isDismissible: false,
enableDrag: true,
builder: (BuildContext context) => const Text('BottomSheet'),
).then<void>((void value) {
showBottomSheetThenCalled = true;
Expand Down Expand Up @@ -531,7 +528,6 @@ void main() {
showModalBottomSheet<void>(
context: savedContext,
isDismissible: false,
enableDrag: true,
builder: (BuildContext context) {
numBuilderCalls++;
return const Text('BottomSheet');
Expand Down
1 change: 0 additions & 1 deletion packages/flutter/test/material/dialog_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1648,7 +1648,6 @@ void main() {
Future<bool?> confirmDismiss (DismissDirection dismissDirection) async {
return showDialog<bool>(
context: scaffoldKey.currentContext!,
barrierDismissible: true, // showDialog() returns null if tapped outside the dialog
builder: (BuildContext context) {
return AlertDialog(
actions: <Widget>[
Expand Down
3 changes: 0 additions & 3 deletions packages/flutter/test/widgets/routes_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,6 @@ void main() {
onPressed: () {
showGeneralDialog<void>(
context: context,
barrierDismissible: false,
transitionDuration: Duration.zero,
pageBuilder: (BuildContext innerContext, _, __) {
return const SizedBox();
Expand Down Expand Up @@ -1097,7 +1096,6 @@ void main() {
onPressed: () {
showGeneralDialog<void>(
context: context,
barrierDismissible: false,
transitionDuration: Duration.zero,
pageBuilder: (BuildContext innerContext, _, __) {
return const SizedBox();
Expand Down Expand Up @@ -1135,7 +1133,6 @@ void main() {
showGeneralDialog<void>(
useRootNavigator: false,
context: context,
barrierDismissible: false,
transitionDuration: Duration.zero,
pageBuilder: (BuildContext innerContext, _, __) {
return const SizedBox();
Expand Down
4 changes: 2 additions & 2 deletions packages/flutter_tools/lib/src/android/android_workflow.dart
Original file line number Diff line number Diff line change
Expand Up @@ -402,12 +402,12 @@ class AndroidLicenseValidator extends DoctorValidator {
.transform<String>(const Utf8Decoder(reportErrors: false))
.transform<String>(const LineSplitter())
.listen(handleLine)
.asFuture<void>(null);
.asFuture<void>();
final Future<void> errors = process.stderr
.transform<String>(const Utf8Decoder(reportErrors: false))
.transform<String>(const LineSplitter())
.listen(handleLine)
.asFuture<void>(null);
.asFuture<void>();
await Future.wait<void>(<Future<void>>[output, errors]);
return status ?? LicensesAccepted.unknown;
} on ProcessException catch (e) {
Expand Down
4 changes: 2 additions & 2 deletions packages/flutter_tools/lib/src/base/process.dart
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,11 @@ class _DefaultProcessUtils implements ProcessUtils {
final Future<void> stdoutFuture = process.stdout
.transform<String>(const Utf8Decoder(reportErrors: false))
.listen(stdoutBuffer.write)
.asFuture<void>(null);
.asFuture<void>();
final Future<void> stderrFuture = process.stderr
.transform<String>(const Utf8Decoder(reportErrors: false))
.listen(stderrBuffer.write)
.asFuture<void>(null);
.asFuture<void>();

int? exitCode;
exitCode = await process.exitCode.then<int?>((int x) => x).timeout(timeout, onTimeout: () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void main() {
PluginEventChannel<String>('test3');

final StreamController<String> controller = StreamController<String>(
onListen: expectAsync0<void>(() {}, count: 1));
onListen: expectAsync0<void>(() {}));
sendingChannel.setController(controller);

expect(listeningChannel.receiveBroadcastStream(),
Expand All @@ -109,7 +109,7 @@ void main() {
PluginEventChannel<String>('test3');

final StreamController<String> controller = StreamController<String>(
onListen: expectAsync0<void>(() {}, count: 1));
onListen: expectAsync0<void>(() {}));
sendingChannel.setController(controller);

expect(listeningChannel.receiveBroadcastStream(),
Expand Down
2 changes: 0 additions & 2 deletions packages/integration_test/lib/_callback_io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,13 @@ class IOCallbackManager implements CallbackManager {
assert(!_isSurfaceRendered, 'Surface already converted to an image');
await integrationTestChannel.invokeMethod<void>(
'convertFlutterSurfaceToImage',
null,
);
_isSurfaceRendered = true;

addTearDown(() async {
assert(_isSurfaceRendered, 'Surface is not an image');
await integrationTestChannel.invokeMethod<void>(
'revertFlutterImage',
null,
);
_isSurfaceRendered = false;
});
Expand Down

0 comments on commit 275fb02

Please sign in to comment.