Format with dartfmt

This commit is contained in:
Victor Choueiri 2018-03-21 02:38:05 +02:00 committed by Victor Choueiri
parent 1c846b4e21
commit ae85badc74
3 changed files with 20 additions and 12 deletions

View File

@ -26,7 +26,8 @@ class AnimatedCircularChart extends StatefulWidget {
this.startAngle = _kStartAngle,
this.holeLabel,
this.labelStyle,
}) : assert(size != null),
})
: assert(size != null),
super(key: key);
/// The size of the bounding box this chart will be constrained to.
@ -201,10 +202,10 @@ class AnimatedCircularChartState extends State<AnimatedCircularChart>
void _updateLabelPainter() {
if (widget.holeLabel != null) {
TextStyle _labelStyle = widget.labelStyle ?? Theme.of(context).textTheme.body2;
TextStyle _labelStyle =
widget.labelStyle ?? Theme.of(context).textTheme.body2;
_labelPainter
..text = new TextSpan(
style: _labelStyle, text: widget.holeLabel)
..text = new TextSpan(style: _labelStyle, text: widget.holeLabel)
..textDirection = Directionality.of(context)
..textScaleFactor = MediaQuery.of(context).textScaleFactor
..layout();

View File

@ -11,13 +11,13 @@ class CircularChart {
CircularChart(this.stacks, this.chartType);
final List<CircularChartStack> stacks;
final CircularChartType chartType;
factory CircularChart.empty({@required CircularChartType chartType}) {
return new CircularChart(<CircularChartStack>[], chartType);
}
final List<CircularChartStack> stacks;
final CircularChartType chartType;
factory CircularChart.fromData({
@required Size size,
@required List<CircularStackEntry> data,
@ -60,6 +60,8 @@ class CircularChartTween extends Tween<CircularChart> {
final MergeTween<CircularChartStack> _stacksTween;
@override
CircularChart lerp(double t) =>
new CircularChart(_stacksTween.lerp(t), begin.chartType);
CircularChart lerp(double t) => new CircularChart(
_stacksTween.lerp(t),
begin.chartType,
);
}

View File

@ -9,7 +9,12 @@ const double _kMaxAngle = 360.0;
class CircularChartStack implements MergeTweenable<CircularChartStack> {
CircularChartStack(
this.rank, this.radius, this.width, this.startAngle, this.segments);
this.rank,
this.radius,
this.width,
this.startAngle,
this.segments,
);
final int rank;
final double radius;
@ -30,8 +35,8 @@ class CircularChartStack implements MergeTweenable<CircularChartStack> {
? 100.0
: entries.fold(
0.0,
(double prev, CircularSegmentEntry element) =>
prev + element.value);
(double prev, CircularSegmentEntry element) => prev + element.value,
);
double previousSweepAngle = 0.0;
List<CircularChartSegment> segments =