1. 11 Jan, 2024 1 commit
  2. 09 Jan, 2024 1 commit
    • Michael Goderbauer's avatar
      Reapply "Dynamic view sizing" (#140165) (#140918) · 4534a24c
      Michael Goderbauer authored
      This reverts commit
      https://github.com/flutter/flutter/commit/d24c01bd0c41331bd17165e0173b24c5d05d7c0a.
      
      The original change was reverted because it caused some apps to get
      stuck on the splash screen on some phones.
      
      An investigation determined that this was due to a rounding error.
      Example: The device reports a physical size of 1008.0 x 2198.0 with a
      dpr of 1.912500023841858. Flutter would translate that to a logical size
      of 527.0588169589221 x 1149.2810314243163 and use that as the input for
      its layout algorithm. Since the constraints here are tight, the layout
      algorithm would determine that the resulting logical size of the root
      render object must be 527.0588169589221 x 1149.2810314243163.
      Translating this back to physical pixels by applying the dpr resulted in
      a physical size of 1007.9999999999999 x 2198.0 for the frame. Android
      now rejected that frame because it didn't match the expected size of
      1008.0 x 2198.0 and since no frame had been rendered would never take
      down the splash screen.
      
      Prior to dynamically sized views, this wasn't an issue because we would
      hard-code the frame size to whatever the requested size was.
      
      Changes in this PR over the original PR:
      
      * The issue has been fixed now by constraining the calculated physical
      size to the input physical constraints which makes sure that we always
      end up with a size that is acceptable to the operating system.
      * The `ViewConfiguration` was refactored to use the slightly more
      convenient `BoxConstraints` over the `ViewConstraints` to represent
      constraints. Both essentially represent the same thing, but
      `BoxConstraints` are more powerful and we avoid a couple of translations
      between the two by translating the` ViewConstraints` from the
      `FlutterView` to `BoxConstraints` directly when the `ViewConfiguration`
      is created.
      
      All changes over the original PR are contained in the second commit of
      this PR.
      
      Fixes b/316813075
      Part of https://github.com/flutter/flutter/issues/134501.
      4534a24c
  3. 03 Jan, 2024 1 commit
  4. 02 Jan, 2024 2 commits
  5. 28 Dec, 2023 1 commit
    • hhh's avatar
      expose didExceedMaxLines from RenderParagraph (#139962) · b0b0e423
      hhh authored
      I want to build a widget that adds some extra functionality when the inner text overflow. So the problem occurred, I can't find an elegant way to determine if the text is overflowing. 
      So i expose `didExceedMaxLines` from `RenderParagraph`, I think it can make sense. Have there some advice?
      b0b0e423
  6. 20 Dec, 2023 3 commits
    • Michael Goderbauer's avatar
      Remove outdated ignores from framework (#140465) · c4fda233
      Michael Goderbauer authored
      These were not ignoring anything (anymore).
      c4fda233
    • 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
  7. 19 Dec, 2023 1 commit
  8. 14 Dec, 2023 2 commits
  9. 11 Dec, 2023 3 commits
  10. 29 Nov, 2023 1 commit
  11. 28 Nov, 2023 1 commit
  12. 23 Nov, 2023 1 commit
  13. 16 Nov, 2023 1 commit
  14. 10 Nov, 2023 1 commit
  15. 06 Nov, 2023 2 commits
  16. 02 Nov, 2023 1 commit
  17. 28 Oct, 2023 1 commit
  18. 27 Oct, 2023 1 commit
  19. 25 Oct, 2023 1 commit
  20. 24 Oct, 2023 1 commit
    • cui fliter's avatar
      fix some typos (#137144) · c5e71b3e
      cui fliter authored
      *Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.*
      
      fix some typos
      
      *List which issues are fixed by this PR. You must list at least one issue.*
      
      *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
      c5e71b3e
  21. 23 Oct, 2023 2 commits
  22. 22 Oct, 2023 1 commit
    • Todd Volkert's avatar
      Add timeline events for post frame callbacks (#136435) · cb9a3f69
      Todd Volkert authored
      Before this change, long-running post-frame callbacks wouldn't show up in the timeline at all.  This adds a timeline event for post-frame callbacks, with a debug flag that will add timeline events for each individual callback.
      
      #testexempt -- we have no way to test calls to the timeline.
      cb9a3f69
  23. 20 Oct, 2023 1 commit
  24. 18 Oct, 2023 1 commit
  25. 15 Oct, 2023 1 commit
  26. 13 Oct, 2023 1 commit
    • Todd Volkert's avatar
      Make constraints a covariant argument in RenderBox.computeDryLayout() (#136432) · bc688cf0
      Todd Volkert authored
      Some render box subclasses have a specific layout contract that is tightly coupled with other render box subclasses (e.g. two private classes in a local project file). In these cases, it is also possible that they use a constraints object that is a subclass of `BoxConstraints`. To allow for this, this change makes the `constraints` argument to `RenderBox.computeDryLayout()` a covariant argument.
      
      For completeness' sake, this updates the other render objects in the rendering package to also use the covariant keyword for this argument.
      bc688cf0
  27. 11 Oct, 2023 1 commit
  28. 10 Oct, 2023 1 commit
  29. 09 Oct, 2023 1 commit
    • Greg Spencer's avatar
      Update `MediaQuery` documentation to highlight asynchronous nature of size (#135719) · a5e3e785
      Greg Spencer authored
      ## Description
      
      This updates the documentation for `MediaQuery` and `Overlay` to include the following:
      
      - That `MediaQueryData.size` is set asynchronously, and doesn't necessarily reflect the size of the current frame.
      - That the specific `MediaQuery.sizeOf` and related methods are preferred over the more generic `MediaQuery.of`.
      - That the size of the `Overlay` isn't necessarily the size returned by `MediaQueryData.size`
      
      As well as adding some symbol links, and fixing some error in documentation.
      
      ## Tests
       - Documentation only
      a5e3e785
  30. 06 Oct, 2023 2 commits
  31. 29 Sep, 2023 1 commit