From 412e329af255d2f2977526e739b5d4cbabd8046c Mon Sep 17 00:00:00 2001 From: Sam Rawlins Date: Thu, 16 Dec 2021 15:29:17 -0800 Subject: [PATCH] Correct missing return statements in nullably-typed functions (#95428) --- .../api/lib/widgets/actions/action.action_overridable.0.dart | 3 ++- packages/flutter_tools/lib/src/commands/ide_config.dart | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/api/lib/widgets/actions/action.action_overridable.0.dart b/examples/api/lib/widgets/actions/action.action_overridable.0.dart index 95efe6f594a..06fb11cf8f0 100644 --- a/examples/api/lib/widgets/actions/action.action_overridable.0.dart +++ b/examples/api/lib/widgets/actions/action.action_overridable.0.dart @@ -43,6 +43,7 @@ class DigitInputState extends State { onInvoke: (DeleteCharacterIntent intent) { // For simplicity we delete everything in the section. widget.controller.clear(); + return null; }, ); @@ -84,7 +85,7 @@ class _DeleteDigit extends Action { final _SimpleUSPhoneNumberEntryState state; @override - Object? invoke(DeleteCharacterIntent intent) { + void invoke(DeleteCharacterIntent intent) { assert(callingAction != null); callingAction?.invoke(intent); diff --git a/packages/flutter_tools/lib/src/commands/ide_config.dart b/packages/flutter_tools/lib/src/commands/ide_config.dart index 115a47a8684..21b0863454b 100644 --- a/packages/flutter_tools/lib/src/commands/ide_config.dart +++ b/packages/flutter_tools/lib/src/commands/ide_config.dart @@ -273,4 +273,6 @@ String? _validateFlutterDir(String dirPath, { String? flutterRoot }) { case FileSystemEntityType.notFound: return null; } + // In the case of any other [FileSystemEntityType]s, like the deprecated ones, return null. + return null; }