Add missing parameter to TableBorder.symmetric, and improve class constructors (#144279)

Originally, my aim was just to refactor (as per usual), but while messing around with the `TableBorder.symmetric` constructor, I realized that `borderRadius` was missing!

This pull request makes a few class constructors more efficient, and it fixes #144277 by adding the missing parameter.

<br>
This commit is contained in:
Nate
2024-03-04 13:20:19 -07:00
committed by GitHub
parent 1d7f4a9afa
commit 1a0dc8f1e1
36 changed files with 195 additions and 356 deletions

View File

@@ -22,14 +22,12 @@ class LayerTree extends Result {
/// Creates a [LayerTree] object with the given string representation.
const LayerTree(this.tree);
/// Deserializes the result from JSON.
LayerTree.fromJson(Map<String, dynamic> json) : tree = json['tree'] as String;
/// String representation of the layer tree.
final String? tree;
/// Deserializes the result from JSON.
static LayerTree fromJson(Map<String, dynamic> json) {
return LayerTree(json['tree'] as String);
}
@override
Map<String, dynamic> toJson() => <String, dynamic>{
'tree': tree,

View File

@@ -11,13 +11,9 @@ const String kUIThreadVsyncProcessEvent = 'VsyncProcessCallback';
///
/// `RefreshRate` is the time between the start of a vsync pulse and the target time of that vsync.
class RefreshRateSummary {
/// Creates a [RefreshRateSummary] given the timeline events.
factory RefreshRateSummary({required List<TimelineEvent> vsyncEvents}) {
return RefreshRateSummary._(refreshRates: _computeRefreshRates(vsyncEvents));
}
RefreshRateSummary._({required List<double> refreshRates}) {
RefreshRateSummary({required List<TimelineEvent> vsyncEvents}) {
final List<double> refreshRates = _computeRefreshRates(vsyncEvents);
_numberOfTotalFrames = refreshRates.length;
for (final double refreshRate in refreshRates) {
if ((refreshRate - 30).abs() < _kErrorMargin) {

View File

@@ -10,11 +10,7 @@ class Timeline {
/// and loaded in Chrome for visual inspection.
///
/// See https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview
factory Timeline.fromJson(Map<String, dynamic> json) {
return Timeline._(json, _parseEvents(json));
}
Timeline._(this.json, this.events);
Timeline.fromJson(this.json) : events = _parseEvents(json);
/// The original timeline JSON.
final Map<String, dynamic> json;