1. 13 Feb, 2024 1 commit
    • Nate's avatar
      Implementing `switch` expressions in `widgets/` (#143293) · 8eea4f17
      Nate authored
      This PR is the 7ᵗʰ step in the journey to solve issue #136139 and make the entire Flutter repo more readable.
      
      (previous pull requests: #139048, #139882, #141591, #142279, #142634, #142793)
      
      This pull request covers everything in `packages/flutter/lib/src/widgets/`. Most of it should be really straightforward, but there was some refactoring in the `getOffsetToReveal()` function in `two_dimensional_viewport.dart`. I'll add some comments to describe those changes.
      8eea4f17
  2. 07 Feb, 2024 1 commit
  3. 06 Feb, 2024 1 commit
    • Renzo Olivares's avatar
      TextField context menu should fade on scroll on mobile devices (#138313) · 0903bf70
      Renzo Olivares authored
      This change affects Android and iOS devices using the TextField's context menu. After this change the context menu will fade out when scrolling the text and fade in when the scroll ends. 
      
      If the scroll ends and the selection is outside of the view, then the toolbar will be scheduled to show in a future scroll end. This toolbar scheduling can be invalidated if the `TextEditingValue` changed anytime between the scheduling and when the toolbar is ready to be shown.
      
      This change also fixes a regression where the TextField context menu would not fade when the selection handles where not visible.
      
      When using the native browser context menu this behavior is not controlled by Flutter.
      
      https://github.com/flutter/flutter/assets/948037/3f46bcbb-ba6f-456c-8473-e42919b9d572
      
      Fixes #52425
      Fixes #105804
      Fixes #52426
      0903bf70
  4. 02 Feb, 2024 1 commit
  5. 30 Jan, 2024 1 commit
    • Renzo Olivares's avatar
      Fix: selection handles do not inherit color from local `Theme` widget (#142476) · 1daac1b8
      Renzo Olivares authored
      This change uses `CapturedTheme`s to capture the themes from the context the selection handles were built in and wraps the handles with them so they can correctly inherit `Theme`s from local `Theme` widgets.
      
      `CapturedTheme`s only captures `InheritedTheme`s, so this change also makes `_InheritedCupertinoTheme` an `InheritedTheme`. This is so we can capture themes declared under a `CupertinoTheme`, for example `primaryColor` is used as the selection handle color.
      
      Fixes #74890
      1daac1b8
  6. 25 Jan, 2024 1 commit
  7. 23 Jan, 2024 1 commit
  8. 19 Jan, 2024 1 commit
  9. 16 Jan, 2024 1 commit
  10. 03 Jan, 2024 1 commit
  11. 02 Jan, 2024 1 commit
  12. 07 Dec, 2023 1 commit
  13. 09 Nov, 2023 1 commit
    • Renzo Olivares's avatar
      Fix text selection in `SearchAnchor/SearchBar` (#137636) · 3225aa58
      Renzo Olivares authored
      This changes fixes text selection gestures on the search field when using `SearchAnchor`.
      
      Before this change text selection gestures did not work due to an `IgnorePointer` in the widget tree.
      
      This change:
      * Removes the `IgnorePointer` so the underlying `TextField` can receive pointer events.
      * Introduces `TextField.onTapAlwaysCalled` and `TextSelectionGestureDetector.onUserTapAlwaysCalled`, so a user provided on tap callback can be called on consecutive taps. This is so that the user provided on tap callback for `SearchAnchor/SearchBar` that was previously only handled by `InkWell` will still work if a tap occurs in the `TextField`s hit box. The `TextField`s default behavior is maintained outside of the context of `SearchAnchor/SearchBar`.
      
      Fixes https://github.com/flutter/flutter/issues/128332 and #134965
      3225aa58
  14. 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
  15. 06 Oct, 2023 1 commit
  16. 20 Sep, 2023 1 commit
    • Greg Spencer's avatar
      Remove 'must be non-null' and 'must not be null' comments in widgets library (#134992) · 6e5134b0
      Greg Spencer authored
      ## Description
      
      This removes all of the comments that are of the form "so-and-so (must not be null|can ?not be null|must be non-null)" from the cases where those values are defines as non-nullable values.
      
      This PR removes them from the widgets library.
      
      This was done by hand, since it really didn't lend itself to scripting, so it needs to be more than just spot-checked, I think. I was careful to leave any comment that referred to parameters that were nullable, but I may have missed some.
      
      In addition to being no longer relevant after null safety has been made the default, these comments were largely fragile, in that it was easy for them to get out of date, and not be accurate anymore anyhow.
      
      This did create a number of constructor comments which basically say "Creates a [Foo].", but I don't really know how to avoid that in a large scale change, since there's not much you can really say in a lot of cases.  I think we might consider some leniency for constructors to the "Comment must be meaningful" style guidance (which we de facto have already, since there are a bunch of these).
      
      ## Related PRs
      - https://github.com/flutter/flutter/pull/134984
      - https://github.com/flutter/flutter/pull/134991
      - https://github.com/flutter/flutter/pull/134993
      - https://github.com/flutter/flutter/pull/134994
      
      ## Tests
       - Documentation only change.
      6e5134b0
  17. 12 Sep, 2023 1 commit
  18. 17 Aug, 2023 1 commit
  19. 16 Aug, 2023 2 commits
  20. 15 Aug, 2023 1 commit
  21. 19 Jul, 2023 1 commit
  22. 06 Jul, 2023 2 commits
  23. 21 Jun, 2023 1 commit
    • Renzo Olivares's avatar
      Selection area right click behavior should match native (#128224) · b36ef583
      Renzo Olivares authored
      This change updates `SelectableRegion`s right-click gesture to match native platform behavior.
      
      Before: Right-click gesture selects word at position and opens context menu (All Platforms)
      After: 
      - Linux, toggles context menu on/off, and collapses selection when click was not on an active selection (uncollapsed).
      - Windows, Android, Fuchsia, shows context menu at right-clicked position (unless the click is at an active selection).
      - macOS, toggles the context menu if right click was at the same position as the previous / or selects word at position and opens context menu.
      - iOS, selects word at position and opens context menu.
      
      This change also prevents the `copy` menu button from being shown when there is a collapsed selection (nothing to copy).
      
      Fixes #117561
      b36ef583
  24. 20 Jun, 2023 1 commit
  25. 08 Jun, 2023 1 commit
  26. 02 Jun, 2023 1 commit
  27. 15 May, 2023 1 commit
  28. 12 May, 2023 1 commit
  29. 24 Apr, 2023 2 commits
  30. 21 Apr, 2023 2 commits
  31. 20 Apr, 2023 2 commits
  32. 13 Apr, 2023 1 commit
  33. 08 Apr, 2023 1 commit
  34. 06 Apr, 2023 2 commits