@@ -882,43 +882,47 @@ class TextBox {
882
882
/// characters. For newline characters, the position is fully specified by the
883
883
/// offset alone, and there is no ambiguity.
884
884
///
885
- /// TextAffinity also affects bidirectional text at the interface between LTR
885
+ /// [ TextAffinity] also affects bidirectional text at the interface between LTR
886
886
/// and RTL text. Consider the following string, where the lowercase letters
887
887
/// will be displayed as LTR and the uppercase letters RTL: "helloHELLO". When
888
888
/// rendered, the string would appear visually as "helloOLLEH". An offset of 5
889
- /// would be ambiguous without a corresponding TextAffinity. Looking at the
889
+ /// would be ambiguous without a corresponding [ TextAffinity] . Looking at the
890
890
/// string in code, the offset represents the position just after the "o" and
891
891
/// just before the "H". When rendered, this offset could be either in the
892
892
/// middle of the string to the right of the "o" or at the end of the string to
893
893
/// the right of the "H".
894
894
enum TextAffinity {
895
- /// The position has affinity for the upstream side of the text position, or
895
+ /// The position has affinity for the upstream side of the text position, i.e.
896
896
/// in the direction of the beginning of the string.
897
897
///
898
898
/// In the example of an offset at the place where text is wrapping, upstream
899
899
/// indicates the end of the first line.
900
900
///
901
- /// In the bidirectional text example above, an offset of 5 with TextAffinity
902
- /// upstream would appear in the middle of the rendered text, just to the
903
- /// right of the "o".
901
+ /// In the bidirectional text example "helloHELLO", an offset of 5 with
902
+ /// [TextAffinity] upstream would appear in the middle of the rendered text,
903
+ /// just to the right of the "o". See the definition of [TextAffinity] for the
904
+ /// full example.
904
905
upstream,
905
906
906
- /// The position has affinity for the downstream side of the text position, or
907
- /// in the direction of the end of the string.
907
+ /// The position has affinity for the downstream side of the text position,
908
+ /// i.e. in the direction of the end of the string.
908
909
///
909
910
/// In the example of an offset at the place where text is wrapping,
910
911
/// downstream indicates the beginning of the second line.
911
912
///
912
- /// In the bidirectional text example above, an offset of 5 with TextAffinity
913
- /// downstream would appear at the end of the rendered text, just to the right
914
- /// of the "H".
913
+ /// In the bidirectional text example "helloHELLO", an offset of 5 with
914
+ /// [TextAffinity] downstream would appear at the end of the rendered text,
915
+ /// just to the right of the "H". See the definition of [TextAffinity] for the
916
+ /// full example.
915
917
downstream,
916
918
}
917
919
918
- /// A position in a string of text. A TextPosition can be used to locate a
919
- /// position in a string in code (using the [offset] property), and it can also
920
- /// be used to locate the same position visually in a rendered string of text
921
- /// (using [offset] and, when needed to resolve ambiguity, [affinity] ).
920
+ /// A position in a string of text.
921
+ ///
922
+ /// A TextPosition can be used to locate a position in a string in code (using
923
+ /// the [offset] property), and it can also be used to locate the same position
924
+ /// visually in a rendered string of text (using [offset] and, when needed to
925
+ /// resolve ambiguity, [affinity] ).
922
926
///
923
927
/// The location of an offset in a rendered string is ambiguous in two cases.
924
928
/// One happens when rendered text is forced to wrap. In this case, the offset
0 commit comments