Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 4ce831e

Browse files
authored
null-annotate semantics.dart (#18791)
1 parent c4a2d09 commit 4ce831e

File tree

2 files changed

+91
-89
lines changed

2 files changed

+91
-89
lines changed

lib/ui/semantics.dart

Lines changed: 65 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -650,19 +650,21 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 {
650650
/// reading direction of all these strings is given by `textDirection`.
651651
///
652652
/// The fields `textSelectionBase` and `textSelectionExtent` describe the
653-
/// currently selected text within `value`.
653+
/// currently selected text within `value`. A value of -1 indicates no
654+
/// current text selection base or extent.
654655
///
655-
/// The field `maxValueLength` is used to indicate that an editable text field
656-
/// has a limit on the number of characters entered. If it is -1 there is
657-
/// no limit on the number of characters entered. The field
656+
/// The field `maxValueLength` is used to indicate that an editable text
657+
/// field has a limit on the number of characters entered. If it is -1 there
658+
/// is no limit on the number of characters entered. The field
658659
/// `currentValueLength` indicates how much of that limit has already been
659-
/// used up. When `maxValueLength` is set, `currentValueLength` must also be
660-
/// set.
660+
/// used up. When `maxValueLength` is >= 0, `currentValueLength` must also be
661+
/// >= 0, otherwise it should be specified to be -1.
661662
///
662663
/// The field `platformViewId` references the platform view, whose semantics
663664
/// nodes will be added as children to this node. If a platform view is
664-
/// specified, `childrenInHitTestOrder` and `childrenInTraversalOrder` must be
665-
/// empty.
665+
/// specified, `childrenInHitTestOrder` and `childrenInTraversalOrder` must
666+
/// be empty. A value of -1 indicates that this node is not associated with a
667+
/// platform view.
666668
///
667669
/// For scrollable nodes `scrollPosition` describes the current scroll
668670
/// position in logical pixel. `scrollExtentMax` and `scrollExtentMin`
@@ -687,32 +689,32 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 {
687689
/// node starts at `elevation` above the parent and ends at `elevation` +
688690
/// `thickness` above the parent.
689691
void updateNode({
690-
int id,
691-
int flags,
692-
int actions,
693-
int maxValueLength,
694-
int currentValueLength,
695-
int textSelectionBase,
696-
int textSelectionExtent,
697-
int platformViewId,
698-
int scrollChildren,
699-
int scrollIndex,
700-
double scrollPosition,
701-
double scrollExtentMax,
702-
double scrollExtentMin,
703-
double elevation,
704-
double thickness,
705-
Rect rect,
706-
String label,
707-
String hint,
708-
String value,
709-
String increasedValue,
710-
String decreasedValue,
711-
TextDirection textDirection,
712-
Float64List transform,
713-
Int32List childrenInTraversalOrder,
714-
Int32List childrenInHitTestOrder,
715-
Int32List additionalActions,
692+
/*required*/ int/*!*/ id,
693+
/*required*/ int/*!*/ flags,
694+
/*required*/ int/*!*/ actions,
695+
/*required*/ int/*!*/ maxValueLength,
696+
/*required*/ int/*!*/ currentValueLength,
697+
/*required*/ int/*!*/ textSelectionBase,
698+
/*required*/ int/*!*/ textSelectionExtent,
699+
/*required*/ int/*!*/ platformViewId,
700+
/*required*/ int/*!*/ scrollChildren,
701+
/*required*/ int/*!*/ scrollIndex,
702+
/*required*/ double/*!*/ scrollPosition,
703+
/*required*/ double/*!*/ scrollExtentMax,
704+
/*required*/ double/*!*/ scrollExtentMin,
705+
/*required*/ double/*!*/ elevation,
706+
/*required*/ double/*!*/ thickness,
707+
/*required*/ Rect/*!*/ rect,
708+
/*required*/ String/*!*/ label,
709+
/*required*/ String/*!*/ hint,
710+
/*required*/ String/*!*/ value,
711+
/*required*/ String/*!*/ increasedValue,
712+
/*required*/ String/*!*/ decreasedValue,
713+
TextDirection/*?*/ textDirection,
714+
/*required*/ Float64List/*!*/ transform,
715+
/*required*/ Int32List/*!*/ childrenInTraversalOrder,
716+
/*required*/ Int32List/*!*/ childrenInHitTestOrder,
717+
/*required*/ Int32List/*!*/ additionalActions,
716718
}) {
717719
assert(_matrix4IsValid(transform));
718720
assert(
@@ -752,35 +754,35 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 {
752754
);
753755
}
754756
void _updateNode(
755-
int id,
756-
int flags,
757-
int actions,
758-
int maxValueLength,
759-
int currentValueLength,
760-
int textSelectionBase,
761-
int textSelectionExtent,
762-
int platformViewId,
763-
int scrollChildren,
764-
int scrollIndex,
765-
double scrollPosition,
766-
double scrollExtentMax,
767-
double scrollExtentMin,
768-
double left,
769-
double top,
770-
double right,
771-
double bottom,
772-
double elevation,
773-
double thickness,
774-
String label,
775-
String hint,
776-
String value,
777-
String increasedValue,
778-
String decreasedValue,
779-
int textDirection,
780-
Float64List transform,
781-
Int32List childrenInTraversalOrder,
782-
Int32List childrenInHitTestOrder,
783-
Int32List additionalActions,
757+
int/*!*/ id,
758+
int/*!*/ flags,
759+
int/*!*/ actions,
760+
int/*!*/ maxValueLength,
761+
int/*!*/ currentValueLength,
762+
int/*!*/ textSelectionBase,
763+
int/*!*/ textSelectionExtent,
764+
int/*!*/ platformViewId,
765+
int/*!*/ scrollChildren,
766+
int/*!*/ scrollIndex,
767+
double/*!*/ scrollPosition,
768+
double/*!*/ scrollExtentMax,
769+
double/*!*/ scrollExtentMin,
770+
double/*!*/ left,
771+
double/*!*/ top,
772+
double/*!*/ right,
773+
double/*!*/ bottom,
774+
double/*!*/ elevation,
775+
double/*!*/ thickness,
776+
String/*!*/ label,
777+
String/*!*/ hint,
778+
String/*!*/ value,
779+
String/*!*/ increasedValue,
780+
String/*!*/ decreasedValue,
781+
int/*!*/ textDirection,
782+
Float64List/*!*/ transform,
783+
Int32List/*!*/ childrenInTraversalOrder,
784+
Int32List/*!*/ childrenInHitTestOrder,
785+
Int32List/*!*/ additionalActions,
784786
) native 'SemanticsUpdateBuilder_updateNode';
785787

786788
/// Update the custom semantics action associated with the given `id`.

lib/web_ui/lib/src/ui/semantics.dart

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -667,32 +667,32 @@ class SemanticsUpdateBuilder {
667667
/// The `transform` is a matrix that maps this node's coordinate system into
668668
/// its parent's coordinate system.
669669
void updateNode({
670-
int id,
671-
int flags,
672-
int actions,
673-
int maxValueLength,
674-
int currentValueLength,
675-
int textSelectionBase,
676-
int textSelectionExtent,
677-
int platformViewId,
678-
int scrollChildren,
679-
int scrollIndex,
680-
double scrollPosition,
681-
double scrollExtentMax,
682-
double scrollExtentMin,
683-
double elevation,
684-
double thickness,
685-
Rect rect,
686-
String label,
687-
String hint,
688-
String value,
689-
String increasedValue,
690-
String decreasedValue,
691-
TextDirection textDirection,
692-
Float64List transform,
693-
Int32List childrenInTraversalOrder,
694-
Int32List childrenInHitTestOrder,
695-
Int32List additionalActions,
670+
/*required*/ int/*!*/ id,
671+
/*required*/ int/*!*/ flags,
672+
/*required*/ int/*!*/ actions,
673+
/*required*/ int/*!*/ maxValueLength,
674+
/*required*/ int/*!*/ currentValueLength,
675+
/*required*/ int/*!*/ textSelectionBase,
676+
/*required*/ int/*!*/ textSelectionExtent,
677+
/*required*/ int/*!*/ platformViewId,
678+
/*required*/ int/*!*/ scrollChildren,
679+
/*required*/ int/*!*/ scrollIndex,
680+
/*required*/ double/*!*/ scrollPosition,
681+
/*required*/ double/*!*/ scrollExtentMax,
682+
/*required*/ double/*!*/ scrollExtentMin,
683+
/*required*/ double/*!*/ elevation,
684+
/*required*/ double/*!*/ thickness,
685+
/*required*/ Rect/*!*/ rect,
686+
/*required*/ String/*!*/ label,
687+
/*required*/ String/*!*/ hint,
688+
/*required*/ String/*!*/ value,
689+
/*required*/ String/*!*/ increasedValue,
690+
/*required*/ String/*!*/ decreasedValue,
691+
TextDirection/*?*/ textDirection,
692+
/*required*/ Float64List/*!*/ transform,
693+
/*required*/ Int32List/*!*/ childrenInTraversalOrder,
694+
/*required*/ Int32List/*!*/ childrenInHitTestOrder,
695+
/*required*/ Int32List/*!*/ additionalActions,
696696
}) {
697697
if (transform.length != 16)
698698
throw ArgumentError('transform argument must have 16 entries.');

0 commit comments

Comments
 (0)