1. 20 Sep, 2023 1 commit
    • Greg Spencer's avatar
      Remove 'must not be null' comments from various libraries. (#134984) · 8cda3bea
      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 animation, cupertino, foundation, gestures, semantics, and services libraries.  Each of them only had a few, so I lumped them together.
      
      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/134991
      - https://github.com/flutter/flutter/pull/134992
      - https://github.com/flutter/flutter/pull/134993
      - https://github.com/flutter/flutter/pull/134994
      
      ## Tests
       - Documentation only change.
      8cda3bea
  2. 19 Sep, 2023 2 commits
  3. 18 Sep, 2023 3 commits
  4. 24 Aug, 2023 1 commit
  5. 23 Aug, 2023 1 commit
  6. 10 Aug, 2023 1 commit
  7. 09 Aug, 2023 3 commits
  8. 05 Aug, 2023 1 commit
  9. 02 Aug, 2023 1 commit
  10. 26 Jul, 2023 3 commits
  11. 20 Jul, 2023 1 commit
  12. 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
  13. 18 Jul, 2023 1 commit
  14. 17 Jul, 2023 1 commit
  15. 13 Jul, 2023 1 commit
  16. 06 Jul, 2023 1 commit
  17. 23 Jun, 2023 1 commit
  18. 22 Jun, 2023 1 commit
  19. 21 Jun, 2023 1 commit
    • Yegor's avatar
      [framework,web] add FlutterTimeline and semantics benchmarks that use it (#128366) · 07772a3d
      Yegor authored
      ## FlutterTimeline
      
      Add a new class `FlutterTimeline` that's a drop-in replacement for `Timeline` from `dart:developer`. In addition to forwarding invocations of `startSync`, `finishSync`, `timeSync`, and `instantSync` to `dart:developer`, provides the following extra methods that make is easy to collect timings for code blocks on a frame-by-frame basis:
      
      * `debugCollect()` - aggregates timings since the last reset, or since the app launched.
      * `debugReset()` - forgets all data collected since the previous reset, or since the app launched. This allows clearing data from previous frames so timings can be attributed to the current frame.
      * `now` - this was enhanced so that it works on the web by calling `window.performance.now` (in `Timeline` this is a noop in Dart web compilers).
      * `collectionEnabled` - a field that controls whether `FlutterTimeline` stores timings in memory. By default this is disabled to avoid unexpected overhead (although the class is designed for minimal and predictable overhead). Specific benchmarks can enable collection to report to Skia Perf.
      
      ## Semantics benchmarks
      
      Add `BenchMaterial3Semantics` that benchmarks the cost of semantics when constructing a screen full of Material 3 widgets from nothing. It is expected that semantics will have non-trivial cost in this case, but we should strive to keep it much lower than the rendering cost. This is the case already. This benchmark shows that the cost of semantics is <10%.
      
      Add `BenchMaterial3ScrollSemantics` that benchmarks the cost of scrolling a previously constructed screen full of Material 3 widgets. The expectation should be that semantics will have trivial cost, since we're just shifting some widgets around. As of today, the numbers are not great, with semantics taking >50% of frame time, which is what prompted this PR in the first place. As we optimize this, we want to see this number improve.
      07772a3d
  20. 16 Jun, 2023 1 commit
  21. 14 Jun, 2023 1 commit
  22. 05 Jun, 2023 1 commit
  23. 26 May, 2023 1 commit
  24. 16 May, 2023 2 commits
  25. 15 May, 2023 1 commit
  26. 05 May, 2023 1 commit
    • Ian Hickson's avatar
      Minor fixes found while working on blankcanvas (#125751) · a11da307
      Ian Hickson authored
      This PR contains a series of minor changes to address issues that I happened to run into:
      
       - Pretty-print errors triggered when handling events that are pending because of having locked event handling. Previously these were just dumped to the console.
       - Add more documentation for `debugPaintPadding`.
       - Add documentation to `Tween` saying how to implement it.
       - Slight formatting changes in the scrollbar code to align some expressions.
       - Since we convert ScrollMetricsNotifications to ScrollNotifications in various places, provide an explicit API to do this. This will make the behaviour consistent throughout, and makes the code easier to understand. Added a test for this.
       - Clarifications to some of the BindingBase and SchedulerBinding documentation.
       - Clarified some documentation in `flutter_test`'s `Finder` class.
      a11da307
  27. 21 Apr, 2023 1 commit
  28. 18 Apr, 2023 1 commit
    • Srujan Gaddam's avatar
      Remove package:js/dart:js_interop conflicts (#124879) · 6edbc195
      Srujan Gaddam authored
      dart:js_interop and package:js will start conflicting, since they both have an `@JS` annotation. Until we're ready to only use dart:js_interop (which will require updating the SDK constraints of every package), we should hide the `@JS` annotation from dart:js_interop. Due to shadowing, this is the behavior today, so there should be no functional change.
      
      Unblocks https://dart-review.googlesource.com/c/sdk/+/294130/8 and prevents confusing shadowing of dart:js_interop annotations like we do today.
      
      - [Mentioned CL that is unblocked] I listed at least one issue that this PR fixes in the description above.
      - [Need test-exemption] I added new tests to check the change I am making, or this PR is [test-exempt].
      - [Need to run] All existing and new tests are passing.
      6edbc195
  29. 12 Apr, 2023 1 commit
  30. 10 Apr, 2023 1 commit
  31. 23 Mar, 2023 1 commit
  32. 22 Mar, 2023 1 commit