Unverified Commit da6e5297 authored by Sam Rawlins's avatar Sam Rawlins Committed by GitHub

Add null return statements to nullable functions with implicit returns (#94760)

parent f248064a
...@@ -304,7 +304,7 @@ class RestorationManager extends ChangeNotifier { ...@@ -304,7 +304,7 @@ class RestorationManager extends ChangeNotifier {
); );
} }
Future<Object?> _methodHandler(MethodCall call) async { Future<void> _methodHandler(MethodCall call) async {
switch (call.method) { switch (call.method) {
case 'push': case 'push':
_parseAndHandleRestorationUpdateFromEngine(call.arguments as Map<Object?, Object?>); _parseAndHandleRestorationUpdateFromEngine(call.arguments as Map<Object?, Object?>);
......
...@@ -1489,7 +1489,7 @@ class PrioritizedAction extends Action<PrioritizedIntents> { ...@@ -1489,7 +1489,7 @@ class PrioritizedAction extends Action<PrioritizedIntents> {
} }
@override @override
Object? invoke(PrioritizedIntents intent) { void invoke(PrioritizedIntents intent) {
assert(_selectedAction != null); assert(_selectedAction != null);
assert(_selectedIntent != null); assert(_selectedIntent != null);
_selectedAction.invoke(_selectedIntent); _selectedAction.invoke(_selectedIntent);
......
...@@ -3741,13 +3741,13 @@ class _UpdateTextSelectionToAdjacentLineAction<T extends DirectionalCaretMovemen ...@@ -3741,13 +3741,13 @@ class _UpdateTextSelectionToAdjacentLineAction<T extends DirectionalCaretMovemen
} }
@override @override
Object? invoke(T intent, [BuildContext? context]) { void invoke(T intent, [BuildContext? context]) {
assert(state._value.selection.isValid); assert(state._value.selection.isValid);
final bool collapseSelection = intent.collapseSelection || !state.widget.selectionEnabled; final bool collapseSelection = intent.collapseSelection || !state.widget.selectionEnabled;
final TextEditingValue value = state._textEditingValueforTextLayoutMetrics; final TextEditingValue value = state._textEditingValueforTextLayoutMetrics;
if (!value.selection.isValid) { if (!value.selection.isValid) {
return null; return;
} }
if (_verticalMovementRun?.isValid == false) { if (_verticalMovementRun?.isValid == false) {
...@@ -3807,7 +3807,7 @@ class _CopySelectionAction extends ContextAction<CopySelectionTextIntent> { ...@@ -3807,7 +3807,7 @@ class _CopySelectionAction extends ContextAction<CopySelectionTextIntent> {
final EditableTextState state; final EditableTextState state;
@override @override
Object? invoke(CopySelectionTextIntent intent, [BuildContext? context]) { void invoke(CopySelectionTextIntent intent, [BuildContext? context]) {
if (intent.collapseSelection) { if (intent.collapseSelection) {
state.cutSelection(intent.cause); state.cutSelection(intent.cause);
} else { } else {
......
...@@ -1077,6 +1077,7 @@ void main() { ...@@ -1077,6 +1077,7 @@ void main() {
} }
return inactivePressedOverlayColor; return inactivePressedOverlayColor;
} }
return null;
} }
const double splashRadius = 24.0; const double splashRadius = 24.0;
TestGesture gesture; TestGesture gesture;
......
...@@ -305,6 +305,7 @@ class TestClipPaintingContext extends PaintingContext { ...@@ -305,6 +305,7 @@ class TestClipPaintingContext extends PaintingContext {
ClipRectLayer? oldLayer, ClipRectLayer? oldLayer,
}) { }) {
this.clipBehavior = clipBehavior; this.clipBehavior = clipBehavior;
return null;
} }
Clip clipBehavior = Clip.none; Clip clipBehavior = Clip.none;
......
...@@ -1701,9 +1701,8 @@ class TestContextAction extends ContextAction<TestIntent> { ...@@ -1701,9 +1701,8 @@ class TestContextAction extends ContextAction<TestIntent> {
List<BuildContext?> capturedContexts = <BuildContext?>[]; List<BuildContext?> capturedContexts = <BuildContext?>[];
@override @override
Object? invoke(covariant TestIntent intent, [BuildContext? context]) { void invoke(covariant TestIntent intent, [BuildContext? context]) {
capturedContexts.add(context); capturedContexts.add(context);
return null;
} }
} }
...@@ -1724,7 +1723,7 @@ class LogInvocationAction extends Action<LogIntent> { ...@@ -1724,7 +1723,7 @@ class LogInvocationAction extends Action<LogIntent> {
bool get isActionEnabled => enabled; bool get isActionEnabled => enabled;
@override @override
Object? invoke(LogIntent intent) { void invoke(LogIntent intent) {
final Action<LogIntent>? callingAction = this.callingAction; final Action<LogIntent>? callingAction = this.callingAction;
if (callingAction == null) { if (callingAction == null) {
intent.log.add('$actionName.invoke'); intent.log.add('$actionName.invoke');
...@@ -1755,7 +1754,7 @@ class LogInvocationContextAction extends ContextAction<LogIntent> { ...@@ -1755,7 +1754,7 @@ class LogInvocationContextAction extends ContextAction<LogIntent> {
bool get isActionEnabled => enabled; bool get isActionEnabled => enabled;
@override @override
Object? invoke(LogIntent intent, [BuildContext? context]) { void invoke(LogIntent intent, [BuildContext? context]) {
invokeContext = context; invokeContext = context;
final Action<LogIntent>? callingAction = this.callingAction; final Action<LogIntent>? callingAction = this.callingAction;
if (callingAction == null) { if (callingAction == null) {
...@@ -1792,5 +1791,5 @@ class RedirectOutputAction extends LogInvocationAction { ...@@ -1792,5 +1791,5 @@ class RedirectOutputAction extends LogInvocationAction {
final List<String> newLog; final List<String> newLog;
@override @override
Object? invoke(LogIntent intent) => super.invoke(LogIntent(log: newLog)); void invoke(LogIntent intent) => super.invoke(LogIntent(log: newLog));
} }
...@@ -29,5 +29,6 @@ class MockClipboard { ...@@ -29,5 +29,6 @@ class MockClipboard {
_clipboardData = methodCall.arguments; _clipboardData = methodCall.arguments;
break; break;
} }
return null;
} }
} }
...@@ -792,6 +792,7 @@ testWidgets('ChildBackButtonDispatcher take priority recursively', (WidgetTester ...@@ -792,6 +792,7 @@ testWidgets('ChildBackButtonDispatcher take priority recursively', (WidgetTester
SystemChannels.navigation, SystemChannels.navigation,
(MethodCall methodCall) async { (MethodCall methodCall) async {
log.add(methodCall); log.add(methodCall);
return null;
} }
); );
final RouteInformationProvider provider = PlatformRouteInformationProvider( final RouteInformationProvider provider = PlatformRouteInformationProvider(
......
...@@ -103,6 +103,7 @@ Widget activatorTester( ...@@ -103,6 +103,7 @@ Widget activatorTester(
if (hasSecond) if (hasSecond)
TestIntent2: TestAction(onInvoke: (Intent intent) { TestIntent2: TestAction(onInvoke: (Intent intent) {
onInvoke2(intent); onInvoke2(intent);
return null;
}), }),
}, },
child: Shortcuts( child: Shortcuts(
......
...@@ -212,7 +212,7 @@ class _Diagonal extends RenderObjectWidget with SlottedMultiChildRenderObjectWid ...@@ -212,7 +212,7 @@ class _Diagonal extends RenderObjectWidget with SlottedMultiChildRenderObjectWid
Iterable<_DiagonalSlot> get slots => _DiagonalSlot.values; Iterable<_DiagonalSlot> get slots => _DiagonalSlot.values;
@override @override
Widget? childForSlot(Object slot) { Widget? childForSlot(_DiagonalSlot slot) {
switch (slot) { switch (slot) {
case _DiagonalSlot.topLeft: case _DiagonalSlot.topLeft:
return topLeft; return topLeft;
......
...@@ -38,6 +38,7 @@ void main() { ...@@ -38,6 +38,7 @@ void main() {
tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.platform, (MethodCall methodCall) async { tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.platform, (MethodCall methodCall) async {
log.add(methodCall); log.add(methodCall);
return null;
}); });
await tester.pumpWidget(Title( await tester.pumpWidget(Title(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment