@@ -647,21 +647,19 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 {
647647 /// reading direction of all these strings is given by `textDirection` .
648648 ///
649649 /// The fields `textSelectionBase` and `textSelectionExtent` describe the
650- /// currently selected text within `value` . A value of -1 indicates no
651- /// current text selection base or extent.
650+ /// currently selected text within `value` .
652651 ///
653- /// The field `maxValueLength` is used to indicate that an editable text
654- /// field has a limit on the number of characters entered. If it is -1 there
655- /// is no limit on the number of characters entered. The field
652+ /// The field `maxValueLength` is used to indicate that an editable text field
653+ /// has a limit on the number of characters entered. If it is -1 there is
654+ /// no limit on the number of characters entered. The field
656655 /// `currentValueLength` indicates how much of that limit has already been
657- /// used up. When `maxValueLength` is >= 0 , `currentValueLength` must also be
658- /// >= 0, otherwise it should be specified to be -1 .
656+ /// used up. When `maxValueLength` is set , `currentValueLength` must also be
657+ /// set .
659658 ///
660659 /// The field `platformViewId` references the platform view, whose semantics
661660 /// nodes will be added as children to this node. If a platform view is
662- /// specified, `childrenInHitTestOrder` and `childrenInTraversalOrder` must
663- /// be empty. A value of -1 indicates that this node is not associated with a
664- /// platform view.
661+ /// specified, `childrenInHitTestOrder` and `childrenInTraversalOrder` must be
662+ /// empty.
665663 ///
666664 /// For scrollable nodes `scrollPosition` describes the current scroll
667665 /// position in logical pixel. `scrollExtentMax` and `scrollExtentMin`
@@ -685,61 +683,39 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 {
685683 /// z-direction starting at `elevation` . Basically, in the z-direction the
686684 /// node starts at `elevation` above the parent and ends at `elevation` +
687685 /// `thickness` above the parent.
688- // TODO(cbracken): https://github.com/flutter/flutter/issues/57720
689686 void updateNode ({
690- /*required*/ int /*!*/ id,
691- /*required*/ int /*!*/ flags,
692- /*required*/ int /*!*/ actions,
693- /*required*/ int /*!*/ maxValueLength,
694- /*required*/ int /*!*/ currentValueLength,
695- /*required*/ int /*!*/ textSelectionBase,
696- /*required*/ int /*!*/ textSelectionExtent,
697- /*required*/ int /*!*/ platformViewId,
698- /*required*/ int /*!*/ scrollChildren,
699- /*required*/ int /*!*/ scrollIndex,
700- /*required*/ double /*!*/ scrollPosition,
701- /*required*/ double /*!*/ scrollExtentMax,
702- /*required*/ double /*!*/ scrollExtentMin,
703- /*required*/ double /*!*/ elevation,
704- /*required*/ double /*!*/ thickness,
705- /*required*/ Rect /*!*/ rect,
706- /*required*/ String /*!*/ label,
707- /*required*/ String /*!*/ hint,
708- /*required*/ String /*!*/ value,
709- /*required*/ String /*!*/ increasedValue,
710- /*required*/ String /*!*/ decreasedValue,
711- TextDirection /*?*/ textDirection,
712- /*required*/ Float64List /*!*/ transform,
713- /*required*/ Int32List /*!*/ childrenInTraversalOrder,
714- /*required*/ Int32List /*!*/ childrenInHitTestOrder,
715- /*required*/ Int32List /*!*/ additionalActions,
687+ int id,
688+ int flags,
689+ int actions,
690+ int maxValueLength,
691+ int currentValueLength,
692+ int textSelectionBase,
693+ int textSelectionExtent,
694+ int platformViewId,
695+ int scrollChildren,
696+ int scrollIndex,
697+ double scrollPosition,
698+ double scrollExtentMax,
699+ double scrollExtentMin,
700+ double elevation,
701+ double thickness,
702+ Rect rect,
703+ String label,
704+ String hint,
705+ String value,
706+ String increasedValue,
707+ String decreasedValue,
708+ TextDirection textDirection,
709+ Float64List transform,
710+ Int32List childrenInTraversalOrder,
711+ Int32List childrenInHitTestOrder,
712+ Int32List additionalActions,
716713 }) {
717- assert (id != null );
718- assert (flags != null );
719- assert (actions != null );
720- assert (maxValueLength != null );
721- assert (currentValueLength != null );
722- assert (textSelectionBase != null );
723- assert (textSelectionExtent != null );
724- assert (platformViewId != null );
725- assert (scrollChildren != null );
726- assert (scrollIndex != null );
727- assert (scrollPosition != null );
728- assert (scrollExtentMax != null );
729- assert (scrollExtentMin != null );
730- assert (elevation != null );
731- assert (thickness != null );
732- assert (rect != null );
733- assert (label != null );
734- assert (hint != null );
735- assert (value != null );
736- assert (increasedValue != null );
737- assert (decreasedValue != null );
738- assert (transform != null );
739- assert (childrenInTraversalOrder != null );
740- assert (childrenInHitTestOrder != null );
741- assert (additionalActions != null );
742714 assert (_matrix4IsValid (transform));
715+ assert (
716+ scrollChildren == 0 || scrollChildren == null || (scrollChildren > 0 && childrenInHitTestOrder != null ),
717+ 'If a node has scrollChildren, it must have childrenInHitTestOrder' ,
718+ );
743719 _updateNode (
744720 id,
745721 flags,
@@ -773,35 +749,35 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 {
773749 );
774750 }
775751 void _updateNode (
776- int /*!*/ id,
777- int /*!*/ flags,
778- int /*!*/ actions,
779- int /*!*/ maxValueLength,
780- int /*!*/ currentValueLength,
781- int /*!*/ textSelectionBase,
782- int /*!*/ textSelectionExtent,
783- int /*!*/ platformViewId,
784- int /*!*/ scrollChildren,
785- int /*!*/ scrollIndex,
786- double /*!*/ scrollPosition,
787- double /*!*/ scrollExtentMax,
788- double /*!*/ scrollExtentMin,
789- double /*!*/ left,
790- double /*!*/ top,
791- double /*!*/ right,
792- double /*!*/ bottom,
793- double /*!*/ elevation,
794- double /*!*/ thickness,
795- String /*!*/ label,
796- String /*!*/ hint,
797- String /*!*/ value,
798- String /*!*/ increasedValue,
799- String /*!*/ decreasedValue,
800- int /*!*/ textDirection,
801- Float64List /*!*/ transform,
802- Int32List /*!*/ childrenInTraversalOrder,
803- Int32List /*!*/ childrenInHitTestOrder,
804- Int32List /*!*/ additionalActions,
752+ int id,
753+ int flags,
754+ int actions,
755+ int maxValueLength,
756+ int currentValueLength,
757+ int textSelectionBase,
758+ int textSelectionExtent,
759+ int platformViewId,
760+ int scrollChildren,
761+ int scrollIndex,
762+ double scrollPosition,
763+ double scrollExtentMax,
764+ double scrollExtentMin,
765+ double left,
766+ double top,
767+ double right,
768+ double bottom,
769+ double elevation,
770+ double thickness,
771+ String label,
772+ String hint,
773+ String value,
774+ String increasedValue,
775+ String decreasedValue,
776+ int textDirection,
777+ Float64List transform,
778+ Int32List childrenInTraversalOrder,
779+ Int32List childrenInHitTestOrder,
780+ Int32List additionalActions,
805781 ) native 'SemanticsUpdateBuilder_updateNode' ;
806782
807783 /// Update the custom semantics action associated with the given `id` .
0 commit comments