Fix avoid_redundant_argument_values analyzer warnings enabled in the latest Dart SDK (#103734)

See https://github.com/flutter/flutter/pull/103719
This commit is contained in:
Jason Simmons 2022-05-13 12:57:59 -07:00 committed by GitHub
parent 708c363920
commit 275fb0286c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 7 additions and 22 deletions

View file

@ -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?'),

View file

@ -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,

View file

@ -500,7 +500,6 @@ class SystemChrome {
if (callback != null) {
await SystemChannels.platform.invokeMethod<void>(
'SystemChrome.setSystemUIChangeListener',
null,
);
}
}
@ -517,7 +516,6 @@ class SystemChrome {
static Future<void> restoreSystemUIOverlays() async {
await SystemChannels.platform.invokeMethod<void>(
'SystemChrome.restoreSystemUIOverlays',
null,
);
}

View file

@ -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;
}

View file

@ -1635,7 +1635,6 @@ void main() {
await showCupertinoModalPopup<void>(
context: context,
builder: (BuildContext context) => const Text('Visible'),
barrierDismissible: true,
);
},
child: const Text('tap'),

View file

@ -218,7 +218,6 @@ void main() {
showModalBottomSheet<void>(
context: savedContext,
isDismissible: false,
enableDrag: true,
builder: (BuildContext context) {
numBuilderCalls++;
return const Text('BottomSheet');
@ -323,7 +322,6 @@ void main() {
showModalBottomSheet<void>(
context: savedContext,
builder: (BuildContext context) => const Text('BottomSheet'),
isDismissible: true,
).then<void>((void value) {
showBottomSheetThenCalled = true;
});
@ -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;
@ -531,7 +528,6 @@ void main() {
showModalBottomSheet<void>(
context: savedContext,
isDismissible: false,
enableDrag: true,
builder: (BuildContext context) {
numBuilderCalls++;
return const Text('BottomSheet');

View file

@ -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>[

View file

@ -1019,7 +1019,6 @@ void main() {
onPressed: () {
showGeneralDialog<void>(
context: context,
barrierDismissible: false,
transitionDuration: Duration.zero,
pageBuilder: (BuildContext innerContext, _, __) {
return const SizedBox();
@ -1097,7 +1096,6 @@ void main() {
onPressed: () {
showGeneralDialog<void>(
context: context,
barrierDismissible: false,
transitionDuration: Duration.zero,
pageBuilder: (BuildContext innerContext, _, __) {
return const SizedBox();
@ -1135,7 +1133,6 @@ void main() {
showGeneralDialog<void>(
useRootNavigator: false,
context: context,
barrierDismissible: false,
transitionDuration: Duration.zero,
pageBuilder: (BuildContext innerContext, _, __) {
return const SizedBox();

View file

@ -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) {

View file

@ -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: () {

View file

@ -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(),
@ -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(),

View file

@ -73,7 +73,6 @@ class IOCallbackManager implements CallbackManager {
assert(!_isSurfaceRendered, 'Surface already converted to an image');
await integrationTestChannel.invokeMethod<void>(
'convertFlutterSurfaceToImage',
null,
);
_isSurfaceRendered = true;
@ -81,7 +80,6 @@ class IOCallbackManager implements CallbackManager {
assert(_isSurfaceRendered, 'Surface is not an image');
await integrationTestChannel.invokeMethod<void>(
'revertFlutterImage',
null,
);
_isSurfaceRendered = false;
});