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:
@@ -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,
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user