From f51d36301ae85663d743cfee75a4c2d1e8ff34ca Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Fri, 15 May 2020 16:28:00 -0700 Subject: [PATCH] null-annotate native calls in lib/ui/semantics.dart (flutter/engine#18436) Also covers counterparts of these calls in web_ui. --- engine/src/flutter/lib/ui/semantics.dart | 12 ++++++++---- .../src/flutter/lib/web_ui/lib/src/ui/semantics.dart | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/engine/src/flutter/lib/ui/semantics.dart b/engine/src/flutter/lib/ui/semantics.dart index 508e001925..c0b32450fb 100644 --- a/engine/src/flutter/lib/ui/semantics.dart +++ b/engine/src/flutter/lib/ui/semantics.dart @@ -793,24 +793,28 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { /// For overridden standard actions, `overrideId` corresponds with a /// [SemanticsAction.index] value. For custom actions this argument should not be /// provided. - void updateCustomAction({int id, String label, String hint, int overrideId = -1}) { + void updateCustomAction({/*required*/ int/*!*/ id, String/*?*/ label, String/*?*/ hint, int/*!*/ overrideId = -1}) { assert(id != null); assert(overrideId != null); _updateCustomAction(id, label, hint, overrideId); } - void _updateCustomAction(int id, String label, String hint, int overrideId) native 'SemanticsUpdateBuilder_updateCustomAction'; + void _updateCustomAction( + int/*!*/ id, + String/*?*/ label, + String/*?*/ hint, + int/*!*/ overrideId) native 'SemanticsUpdateBuilder_updateCustomAction'; /// Creates a [SemanticsUpdate] object that encapsulates the updates recorded /// by this object. /// /// The returned object can be passed to [Window.updateSemantics] to actually /// update the semantics retained by the system. - SemanticsUpdate build() { + SemanticsUpdate/*!*/ build() { final SemanticsUpdate semanticsUpdate = SemanticsUpdate._(); _build(semanticsUpdate); return semanticsUpdate; } - void _build(SemanticsUpdate outSemanticsUpdate) native 'SemanticsUpdateBuilder_build'; + void _build(SemanticsUpdate/*!*/ outSemanticsUpdate) native 'SemanticsUpdateBuilder_build'; } /// An opaque object representing a batch of semantics updates. diff --git a/engine/src/flutter/lib/web_ui/lib/src/ui/semantics.dart b/engine/src/flutter/lib/web_ui/lib/src/ui/semantics.dart index b04c644bc8..a2a02b4387 100644 --- a/engine/src/flutter/lib/web_ui/lib/src/ui/semantics.dart +++ b/engine/src/flutter/lib/web_ui/lib/src/ui/semantics.dart @@ -725,7 +725,7 @@ class SemanticsUpdateBuilder { } void updateCustomAction( - {int id, String label, String hint, int overrideId = -1}) { + {/*required*/ int/*!*/ id, String/*?*/ label, String/*?*/ hint, int/*!*/ overrideId = -1}) { // TODO(yjbanov): implement. } @@ -734,7 +734,7 @@ class SemanticsUpdateBuilder { /// /// The returned object can be passed to [Window.updateSemantics] to actually /// update the semantics retained by the system. - SemanticsUpdate build() { + SemanticsUpdate/*!*/ build() { return SemanticsUpdate._( nodeUpdates: _nodeUpdates, );