1. 20 Dec, 2023 3 commits
    • LongCatIsLooong's avatar
      Reland `find.textRange.ofSubstring` changes (#140469) · e2e8bcb1
      LongCatIsLooong authored
      Extracted from https://github.com/flutter/flutter/pull/139717 as-is. Landing this change first so we can avoid doing a g3fix.
      e2e8bcb1
    • auto-submit[bot]'s avatar
      Reverts "Make `TextSpan` hit testing precise." (#140468) · 9003f138
      auto-submit[bot] authored
      Reverts flutter/flutter#139717
      Initiated by: LongCatIsLooong
      This change reverts the following previous change:
      Original Description:
      Fixes https://github.com/flutter/flutter/issues/131435, #104594, #43400
      Needs https://github.com/flutter/engine/pull/48774 (to fix the web test failure).
      
      Currently the method we use for text span hit testing `TextPainter.getPositionForOffset` always returns the closest `TextPosition`, even when the given offset is far away from the text. 
      
      The new TextPaintes method tells you the layout bounds (`width =  letterspacing / 2 + x_advance + letterspacing / 2`, `height = font ascent + font descent`) of a character, the PR changes the hit testing implementation such that a TextSpan is only considered hit if the point-down event landed in one of it's character's layout bounds.
      
      Potential issues:
      
      1. In theory since the text is baseline aligned, we should use the max ascent and max descent of each character to calculate the height of the text span's hit-test region, in case some characters in the span have to fall back to a different font, but that will be slower and it typically doesn't make a huge difference. 
      
      This is a breaking change. It also introduces a new finder and a new method `WidgetTester.tapOnText`: `await tester.tapOnText('string to match')` for ease of migration.
      9003f138
    • LongCatIsLooong's avatar
      Make `TextSpan` hit testing precise. (#139717) · ea5b9728
      LongCatIsLooong authored
      Fixes https://github.com/flutter/flutter/issues/131435, #104594, #43400
      Needs https://github.com/flutter/engine/pull/48774 (to fix the web test failure).
      
      Currently the method we use for text span hit testing `TextPainter.getPositionForOffset` always returns the closest `TextPosition`, even when the given offset is far away from the text. 
      
      The new TextPaintes method tells you the layout bounds (`width =  letterspacing / 2 + x_advance + letterspacing / 2`, `height = font ascent + font descent`) of a character, the PR changes the hit testing implementation such that a TextSpan is only considered hit if the point-down event landed in one of it's character's layout bounds.
      
      Potential issues:
      
      1. In theory since the text is baseline aligned, we should use the max ascent and max descent of each character to calculate the height of the text span's hit-test region, in case some characters in the span have to fall back to a different font, but that will be slower and it typically doesn't make a huge difference. 
      
      This is a breaking change. It also introduces a new finder and a new method `WidgetTester.tapOnText`: `await tester.tapOnText('string to match')` for ease of migration.
      ea5b9728
  2. 15 Dec, 2023 1 commit
  3. 03 Nov, 2023 1 commit
  4. 03 May, 2023 1 commit
    • LongCatIsLooong's avatar
      Add `InlineSpan.visitDirectChildren` (#125656) · f704c689
      LongCatIsLooong authored
      I'd like to find out the `fontSize` of a `PlaceholderSpan`, and currently there doesn't seem to be a way to do `TextStyle` cascading in the framework:
      
       `InlineSpan.visitChildren` traverses the entire `InlineSpan` tree using a preorder traversal, and nodes that don't have "content" will be skipped (https://master-api.flutter.dev/flutter/painting/InlineSpan/visitChildren.html): 
      
      > Walks this [InlineSpan](https://master-api.flutter.dev/flutter/painting/InlineSpan-class.html) and any descendants in pre-order and calls visitor for each span that has content.
      
      which makes it impossible to do `TextStyle` cascading in the framework: 
      - `InlineSpan`s with a non-null `TextStyle` but has no content will be skipped
      - `visitChildren` doesn't directly expose the hierarchy, it only gives information about the flattened tree.
      
      This doesn't look like a breaking change, most internal customers are extending `WidgetSpan` which has a concrete implementation of the new method.
      
      Alternatively I could create a fake `ui.ParagraphBuilder` and record the `ui.TextStyle` at the top of the stack when `addPlaceholder` is called. But `ui.TextStyle` properties are not exposed to the framework.
      f704c689
  5. 24 Jun, 2022 1 commit
  6. 20 May, 2022 1 commit
  7. 03 Feb, 2022 1 commit
  8. 08 Oct, 2021 3 commits
  9. 30 Jul, 2021 1 commit
  10. 15 Jul, 2021 1 commit
  11. 14 Jul, 2021 3 commits
  12. 13 Jul, 2021 2 commits
  13. 23 Apr, 2021 1 commit
  14. 25 Mar, 2021 1 commit
  15. 11 Feb, 2021 1 commit
  16. 02 Feb, 2021 1 commit
    • Sam Rawlins's avatar
      Remove "unnecessary" imports. (#75198) · 11609d11
      Sam Rawlins authored
      In each library where an import is removed, the library uses some elements
      provided by the import, BUT there is another import which provides all of the
      same elements, and at least one more which the library uses.
      
      In this change, we remove the imports which can be simply removed in favor of
      the other already present imports.
      
      See https://github.com/dart-lang/sdk/issues/44569 for more information.
      11609d11
  17. 06 Oct, 2020 1 commit
  18. 19 Aug, 2020 3 commits
  19. 11 Jun, 2020 1 commit
  20. 27 Nov, 2019 1 commit
    • Ian Hickson's avatar
      License update (#45373) · 449f4a66
      Ian Hickson authored
      * Update project.pbxproj files to say Flutter rather than Chromium
      
      Also, the templates now have an empty organization so that we don't cause people to give their apps a Flutter copyright.
      
      * Update the copyright notice checker to require a standard notice on all files
      
      * Update copyrights on Dart files. (This was a mechanical commit.)
      
      * Fix weird license headers on Dart files that deviate from our conventions; relicense Shrine.
      
      Some were already marked "The Flutter Authors", not clear why. Their
      dates have been normalized. Some were missing the blank line after the
      license. Some were randomly different in trivial ways for no apparent
      reason (e.g. missing the trailing period).
      
      * Clean up the copyrights in non-Dart files. (Manual edits.)
      
      Also, make sure templates don't have copyrights.
      
      * Fix some more ORGANIZATIONNAMEs
      449f4a66
  21. 28 Oct, 2019 1 commit
  22. 09 Oct, 2019 1 commit
  23. 02 Oct, 2019 1 commit
  24. 30 Sep, 2019 1 commit
  25. 24 Sep, 2019 1 commit
  26. 07 Jun, 2019 2 commits
  27. 06 Jun, 2019 1 commit
  28. 05 Jun, 2019 1 commit
  29. 04 Jun, 2019 1 commit
    • Gary Qian's avatar
      Text inline widgets, TextSpan rework (#33794) · 86862c1e
      Gary Qian authored
      * Merge in changes for inline widgets
      
      * Make analyzer happy, fix tests
      
      * Fix analyzer
      
      * Add missing doc
      
      * Docs on RichText
      
      * Fix analyzer some more
      
      * Remove whitespace at end of line
      
      * Update goldens
      
      * Text fixes
      
      * Analyzer
      86862c1e
  30. 10 Apr, 2019 1 commit