implicit-casts:false in examples (#45805)
This commit is contained in:
committed by
GitHub
parent
c6fe7bb9e1
commit
ec0842e0d3
@@ -48,7 +48,7 @@ void main() {
|
||||
subrow.add(RenderSolidColorBox(const Color(0x7FCCFFFF), desiredSize: const Size(30.0, 40.0)));
|
||||
row.add(subrow);
|
||||
table.add(row);
|
||||
final FlexParentData rowParentData = row.parentData;
|
||||
final FlexParentData rowParentData = row.parentData as FlexParentData;
|
||||
rowParentData.flex = 1;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ void main() {
|
||||
row.add(RenderSolidColorBox(const Color(0xFFCCCCFF), desiredSize: const Size(160.0, 60.0)));
|
||||
row.mainAxisAlignment = justify;
|
||||
table.add(row);
|
||||
final FlexParentData rowParentData = row.parentData;
|
||||
final FlexParentData rowParentData = row.parentData as FlexParentData;
|
||||
rowParentData.flex = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,11 +31,11 @@ class SectorConstraints extends Constraints {
|
||||
final double maxDeltaTheta;
|
||||
|
||||
double constrainDeltaRadius(double deltaRadius) {
|
||||
return deltaRadius.clamp(minDeltaRadius, maxDeltaRadius);
|
||||
return deltaRadius.clamp(minDeltaRadius, maxDeltaRadius) as double;
|
||||
}
|
||||
|
||||
double constrainDeltaTheta(double deltaTheta) {
|
||||
return deltaTheta.clamp(minDeltaTheta, maxDeltaTheta);
|
||||
return deltaTheta.clamp(minDeltaTheta, maxDeltaTheta) as double;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -100,14 +100,14 @@ abstract class RenderSector extends RenderObject {
|
||||
// RenderSectors always use SectorParentData subclasses, as they need to be
|
||||
// able to read their position information for painting and hit testing.
|
||||
@override
|
||||
SectorParentData get parentData => super.parentData;
|
||||
SectorParentData get parentData => super.parentData as SectorParentData;
|
||||
|
||||
SectorDimensions getIntrinsicDimensions(SectorConstraints constraints, double radius) {
|
||||
return SectorDimensions.withConstraints(constraints);
|
||||
}
|
||||
|
||||
@override
|
||||
SectorConstraints get constraints => super.constraints;
|
||||
SectorConstraints get constraints => super.constraints as SectorConstraints;
|
||||
|
||||
@override
|
||||
void debugAssertDoesMeetConstraints() {
|
||||
@@ -208,7 +208,7 @@ class RenderSectorWithChildren extends RenderDecoratedSector with ContainerRende
|
||||
while (child != null) {
|
||||
if (child.hitTest(result, radius: radius, theta: theta))
|
||||
return;
|
||||
final SectorChildListParentData childParentData = child.parentData;
|
||||
final SectorChildListParentData childParentData = child.parentData as SectorChildListParentData;
|
||||
child = childParentData.previousSibling;
|
||||
}
|
||||
}
|
||||
@@ -218,7 +218,7 @@ class RenderSectorWithChildren extends RenderDecoratedSector with ContainerRende
|
||||
RenderSector child = lastChild;
|
||||
while (child != null) {
|
||||
visitor(child);
|
||||
final SectorChildListParentData childParentData = child.parentData;
|
||||
final SectorChildListParentData childParentData = child.parentData as SectorChildListParentData;
|
||||
child = childParentData.previousSibling;
|
||||
}
|
||||
}
|
||||
@@ -282,7 +282,7 @@ class RenderSectorRing extends RenderSectorWithChildren {
|
||||
final SectorDimensions childDimensions = child.getIntrinsicDimensions(innerConstraints, childRadius);
|
||||
innerTheta += childDimensions.deltaTheta;
|
||||
remainingDeltaTheta -= childDimensions.deltaTheta;
|
||||
final SectorChildListParentData childParentData = child.parentData;
|
||||
final SectorChildListParentData childParentData = child.parentData as SectorChildListParentData;
|
||||
child = childParentData.nextSibling;
|
||||
if (child != null) {
|
||||
innerTheta += paddingTheta;
|
||||
@@ -316,7 +316,7 @@ class RenderSectorRing extends RenderSectorWithChildren {
|
||||
child.layout(innerConstraints, parentUsesSize: true);
|
||||
innerTheta += child.deltaTheta;
|
||||
remainingDeltaTheta -= child.deltaTheta;
|
||||
final SectorChildListParentData childParentData = child.parentData;
|
||||
final SectorChildListParentData childParentData = child.parentData as SectorChildListParentData;
|
||||
child = childParentData.nextSibling;
|
||||
if (child != null) {
|
||||
innerTheta += paddingTheta;
|
||||
@@ -335,7 +335,7 @@ class RenderSectorRing extends RenderSectorWithChildren {
|
||||
RenderSector child = firstChild;
|
||||
while (child != null) {
|
||||
context.paintChild(child, offset);
|
||||
final SectorChildListParentData childParentData = child.parentData;
|
||||
final SectorChildListParentData childParentData = child.parentData as SectorChildListParentData;
|
||||
child = childParentData.nextSibling;
|
||||
}
|
||||
}
|
||||
@@ -396,7 +396,7 @@ class RenderSectorSlice extends RenderSectorWithChildren {
|
||||
final SectorDimensions childDimensions = child.getIntrinsicDimensions(innerConstraints, childRadius);
|
||||
childRadius += childDimensions.deltaRadius;
|
||||
remainingDeltaRadius -= childDimensions.deltaRadius;
|
||||
final SectorChildListParentData childParentData = child.parentData;
|
||||
final SectorChildListParentData childParentData = child.parentData as SectorChildListParentData;
|
||||
child = childParentData.nextSibling;
|
||||
childRadius += padding;
|
||||
remainingDeltaRadius -= padding;
|
||||
@@ -427,7 +427,7 @@ class RenderSectorSlice extends RenderSectorWithChildren {
|
||||
child.layout(innerConstraints, parentUsesSize: true);
|
||||
childRadius += child.deltaRadius;
|
||||
remainingDeltaRadius -= child.deltaRadius;
|
||||
final SectorChildListParentData childParentData = child.parentData;
|
||||
final SectorChildListParentData childParentData = child.parentData as SectorChildListParentData;
|
||||
child = childParentData.nextSibling;
|
||||
childRadius += padding;
|
||||
remainingDeltaRadius -= padding;
|
||||
@@ -445,7 +445,7 @@ class RenderSectorSlice extends RenderSectorWithChildren {
|
||||
while (child != null) {
|
||||
assert(child.parentData is SectorChildListParentData);
|
||||
context.paintChild(child, offset);
|
||||
final SectorChildListParentData childParentData = child.parentData;
|
||||
final SectorChildListParentData childParentData = child.parentData as SectorChildListParentData;
|
||||
child = childParentData.nextSibling;
|
||||
}
|
||||
}
|
||||
@@ -638,7 +638,7 @@ class SectorHitTestEntry extends HitTestEntry {
|
||||
super(target);
|
||||
|
||||
@override
|
||||
RenderSector get target => super.target;
|
||||
RenderSector get target => super.target as RenderSector;
|
||||
|
||||
/// The radius component of the hit test position in the local coordinates of
|
||||
/// [target].
|
||||
|
||||
@@ -65,7 +65,7 @@ class RenderDots extends RenderBox {
|
||||
@override
|
||||
void handleEvent(PointerEvent event, BoxHitTestEntry entry) {
|
||||
if (event is PointerDownEvent) {
|
||||
final Color color = _kColors[event.pointer.remainder(_kColors.length)];
|
||||
final Color color = _kColors[event.pointer.remainder(_kColors.length) as int];
|
||||
_dots[event.pointer] = Dot(color: color)..update(event);
|
||||
// We call markNeedsPaint to indicate that our painting commands have
|
||||
// changed and that paint needs to be called before displaying a new frame
|
||||
@@ -126,7 +126,7 @@ void main() {
|
||||
//
|
||||
// We use the StackParentData of the paragraph to position the text in the top
|
||||
// left corner of the screen.
|
||||
final StackParentData paragraphParentData = paragraph.parentData;
|
||||
final StackParentData paragraphParentData = paragraph.parentData as StackParentData;
|
||||
paragraphParentData
|
||||
..top = 40.0
|
||||
..left = 20.0;
|
||||
|
||||
@@ -44,7 +44,7 @@ class Calculator {
|
||||
}
|
||||
);
|
||||
try {
|
||||
final List<dynamic> result = decoder.convert(_data);
|
||||
final List<dynamic> result = decoder.convert(_data) as List<dynamic>;
|
||||
final int n = result.length;
|
||||
onResultListener('Decoded $n results');
|
||||
} catch (e, stack) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:flutter/rendering.dart';
|
||||
|
||||
import '../rendering/src/sector_layout.dart';
|
||||
|
||||
RenderBox initCircle() {
|
||||
RenderBoxToRenderSectorAdapter initCircle() {
|
||||
return RenderBoxToRenderSectorAdapter(
|
||||
innerRadius: 25.0,
|
||||
child: RenderSectorRing(padding: 0.0),
|
||||
@@ -54,7 +54,7 @@ class SectorAppState extends State<SectorApp> {
|
||||
int index = 0;
|
||||
while (index < actualSectorSizes.length && index < wantedSectorSizes.length && actualSectorSizes[index] == wantedSectorSizes[index])
|
||||
index += 1;
|
||||
final RenderSectorRing ring = sectors.child;
|
||||
final RenderSectorRing ring = sectors.child as RenderSectorRing;
|
||||
while (index < actualSectorSizes.length) {
|
||||
ring.remove(ring.lastChild);
|
||||
actualSectorSizes.removeLast();
|
||||
@@ -67,7 +67,7 @@ class SectorAppState extends State<SectorApp> {
|
||||
}
|
||||
}
|
||||
|
||||
static RenderBox initSector(Color color) {
|
||||
static RenderBoxToRenderSectorAdapter initSector(Color color) {
|
||||
final RenderSectorRing ring = RenderSectorRing(padding: 1.0);
|
||||
ring.add(RenderSolidColor(const Color(0xFF909090), desiredDeltaTheta: kTwoPi * 0.15));
|
||||
ring.add(RenderSolidColor(const Color(0xFF909090), desiredDeltaTheta: kTwoPi * 0.15));
|
||||
|
||||
@@ -11,7 +11,7 @@ import '../rendering/src/solid_color_box.dart';
|
||||
void addFlexChildSolidColor(RenderFlex parent, Color backgroundColor, { int flex = 0 }) {
|
||||
final RenderSolidColorBox child = RenderSolidColorBox(backgroundColor);
|
||||
parent.add(child);
|
||||
final FlexParentData childParentData = child.parentData;
|
||||
final FlexParentData childParentData = child.parentData as FlexParentData;
|
||||
childParentData.flex = flex;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user