commit | 119684c92d5b257f9173b1eeb79fd7eb0ea6fe14 | [log] [tgz] |
---|---|---|
author | Parker Lougheed <parlough@gmail.com> | Fri Jul 25 14:31:46 2025 +0800 |
committer | GitHub <noreply@github.com> | Fri Jul 25 14:31:46 2025 +0800 |
tree | f9f70fefe72a8966c485da119e833aa9f4476275 | |
parent | 14543db987baebd1179b63e90e7e971be6c0d09a [diff] |
Avoid conflating concept of duration in `TimeRange` util class (#9325) `TimeRange` represents the range between two `start` and `end` times marked in microseconds (so a duration). However, it stored `start` and `end` as `Duration` as well, resulting in the existence of three durations which was a bit confusing as I worked to understand code using `TimeRange`. Beyond that, `TimeRange` was not immutable so had a concept of being "well formed" (or having both a start and end), resulting in multiple checks for that state and many not-null assertion operations. To maintain the intermediate status and also reduce the necessity of the not-null assertions, split out the intermediate state to a new `TimeRangeBuilder` class with a `build` method that consolidates the not-null assertions to that singular function.
Dart & Flutter DevTools is a suite of performance tools for Dart and Flutter.
For documentation on installing and trying out DevTools, please see our docs.
Contributions welcome! See our contributing page for an overview of how to build and contribute to the project.
By using Dart DevTools, you agree to the Google Terms of Service. To understand how we use data collected from this service, see the Google Privacy Policy.