1. 20 Sep, 2023 1 commit
    • Greg Spencer's avatar
      Remove 'must not be null' comments from painting and rendering libraries. (#134993) · fe9a2c54
      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 painting and rendering libraries.
      
      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/134992
      - https://github.com/flutter/flutter/pull/134994
      
      ## Tests
       - Documentation only change.
      fe9a2c54
  2. 08 Sep, 2023 1 commit
  3. 19 Jul, 2023 1 commit
    • Greg Price's avatar
      Fix contradictory advice in "detach" docs; cut redundancy in "attach" (#130688) · f0039119
      Greg Price authored
      Fixes #115525.
      
      On [AbstractNode.detach] and its two progeny [RenderNode.detach]
      and [Layer.detach], the docs said both to call the inherited method
      before detaching children, and to end by doing so.  The former
      advice is what's enforced by an assertion in the base implementation,
      so cut out the other.
      
      The corresponding [attach] methods redundantly said twice to
      call the inherited method first, so cut the redundancy.
      Leave in place the version more recently added (in #76021), because
      that PR shows the old version must have been easy to overlook.
      f0039119
  4. 17 Jul, 2023 2 commits
    • Greg Price's avatar
      Make AbstractNode-derived docs more specific on RenderObject et al. (#130689) · 1937ae65
      Greg Price authored
      These methods and/or their docs were recently copied (in #128467 and #128973) from their classes' former shared base class AbstractNode. Their wording was fittingly abstract there, but that abstraction is a bit puzzling for a reader finding them on these more concrete classes and not aware of the AbstractNode history.  So make them more concrete, in similar terms to the other methods around them.
      
      Also copy some useful points between corresponding methods on different classes (like that the parent of the root is null), and try to clean up the prose on [RenderObject.depth].
      
      We focus on the more outward-facing parts of the API, letting methods like `redepthChildren` continue to talk generically about "nodes".
      1937ae65
    • Jason Simmons's avatar
      Skip the iteration in Layer._fireCompositionCallbacks if the callbacks map is empty (#130438) · 7937b1d5
      Jason Simmons authored
      This was showing up as a hot spot in some benchmarks and profiles. This
      function is called frequently during frame builds and often has an empty
      map. There may be significant overhead from obtaining the values
      iterator and cloning it into a list.
      
      See https://github.com/flutter/flutter/issues/130339
      7937b1d5
  5. 14 Jun, 2023 1 commit
  6. 15 May, 2023 1 commit
  7. 02 May, 2023 1 commit
  8. 22 Mar, 2023 1 commit
  9. 31 Jan, 2023 1 commit
  10. 21 Jan, 2023 1 commit
  11. 11 Dec, 2022 1 commit
  12. 23 Nov, 2022 1 commit
  13. 22 Nov, 2022 2 commits
  14. 01 Nov, 2022 2 commits
  15. 28 Sep, 2022 1 commit
    • Greg Spencer's avatar
      Implement Material MenuBar and MenuAnchor (#112239) · 8c271e5c
      Greg Spencer authored
      This implements a MenuBar widget that can render a Material menu bar, and a MenuAnchor widget used to create a cascading menu in a region. The menus are drawn in the overlay, while the menu bar itself is in the regular widget tree. Keyboard traversal works between the two.
      
      This implementation of the MenuBar uses MenuAnchor to create a cascading menu that contains widgets representing the menu items. These menu items can be any kind of widget, but are typically SubmenuButtons that host submenus, or MenuItemButtons that have shortcut hints (but don't actually activate the shortcuts) and don't host submenus.
      
      Cascading menus can be created outside of a MenuBar by using a MenuAnchor. They can be either given a specific location to appear (a coordinate), or they can be located by the MenuAnchor region that wraps the control that opens them.
      
      The developer may also create a MenuController to pass to the various menu primitives (MenuBar or MenuAnchor) to associate menus so that they can be traversed together and closed together. Creating a controller is not required.
      8c271e5c
  16. 20 Sep, 2022 1 commit
  17. 20 Aug, 2022 1 commit
  18. 22 Jul, 2022 1 commit
  19. 25 May, 2022 1 commit
  20. 20 May, 2022 1 commit
  21. 17 May, 2022 1 commit
  22. 12 May, 2022 1 commit
  23. 26 Apr, 2022 1 commit
  24. 14 Apr, 2022 1 commit
  25. 11 Apr, 2022 1 commit
  26. 25 Mar, 2022 1 commit
  27. 18 Mar, 2022 1 commit
  28. 03 Feb, 2022 1 commit
  29. 24 Jan, 2022 1 commit
  30. 12 Jan, 2022 1 commit
  31. 08 Jan, 2022 2 commits
  32. 07 Jan, 2022 1 commit
  33. 12 Dec, 2021 1 commit
  34. 06 Dec, 2021 1 commit
  35. 04 Dec, 2021 1 commit
  36. 28 Oct, 2021 1 commit