mirror of
https://github.com/flutter/samples.git
synced 2025-11-10 14:58:34 +00:00
Remove unneeded types (#949)
This commit is contained in:
@@ -153,7 +153,7 @@ class DisjointMeasureAxisLineChart extends StatelessWidget {
|
||||
primaryMeasureAxis: const charts.NumericAxisSpec(
|
||||
tickProviderSpec: charts.StaticNumericTickProviderSpec(
|
||||
// Create the ticks to be used the domain axis.
|
||||
<charts.TickSpec<num>>[
|
||||
[
|
||||
charts.TickSpec(0, label: ''),
|
||||
charts.TickSpec(1, label: ''),
|
||||
charts.TickSpec(2, label: ''),
|
||||
|
||||
@@ -81,7 +81,7 @@ class StaticallyProvidedTicks extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// Create the ticks to be used the domain axis.
|
||||
final staticTicks = <charts.TickSpec<String>>[
|
||||
final staticTicks = [
|
||||
const charts.TickSpec(
|
||||
// Value must match the domain value.
|
||||
'2014',
|
||||
|
||||
@@ -29,7 +29,7 @@ class GalleryDrawer extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Drawer(
|
||||
child: ListView(children: <Widget>[
|
||||
child: ListView(children: [
|
||||
// Performance overlay toggle.
|
||||
ListTile(
|
||||
leading: const Icon(Icons.assessment),
|
||||
|
||||
@@ -57,7 +57,7 @@ class _GalleryScaffoldState extends State<GalleryScaffold> {
|
||||
appBar: AppBar(title: Text(widget.title)),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(children: <Widget>[
|
||||
child: Column(children: [
|
||||
SizedBox(height: 250.0, child: widget.childBuilder()),
|
||||
])),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
|
||||
@@ -60,7 +60,7 @@ class CatmullInterpolator implements Interpolator {
|
||||
}
|
||||
|
||||
static void test() {
|
||||
List<Point2D> controlPoints = <Point2D>[];
|
||||
final controlPoints = <Point2D>[];
|
||||
controlPoints.add(Point2D(-1, 1));
|
||||
controlPoints.add(Point2D(0, 1));
|
||||
controlPoints.add(Point2D(1, -1));
|
||||
|
||||
@@ -49,9 +49,9 @@ class LayeredChartState extends State<LayeredChart> {
|
||||
graphHeight = MathUtils.clampedMap(screenRatio, 0.5, 2.5, 50, 150);
|
||||
|
||||
int m = dataToPlot.length;
|
||||
paths = <Path>[];
|
||||
capPaths = <Path>[];
|
||||
maxValues = <double>[];
|
||||
paths = [];
|
||||
capPaths = [];
|
||||
maxValues = [];
|
||||
for (int i = 0; i < m; i++) {
|
||||
int n = dataToPlot[i].series.length;
|
||||
maxValues.add(0);
|
||||
@@ -71,11 +71,11 @@ class LayeredChartState extends State<LayeredChart> {
|
||||
double xWidth = (endX - startX) / numPoints;
|
||||
double capRangeX = capSize * cos(capTheta);
|
||||
double tanCapTheta = tan(capTheta);
|
||||
List<double> curvePoints = <double>[];
|
||||
final curvePoints = <double>[];
|
||||
for (int i = 0; i < m; i++) {
|
||||
List<int> series = dataToPlot[i].series;
|
||||
int n = series.length;
|
||||
List<Point2D> controlPoints = <Point2D>[];
|
||||
final controlPoints = <Point2D>[];
|
||||
controlPoints.add(Point2D(-1, 0));
|
||||
double last = 0;
|
||||
for (int j = 0; j < n; j++) {
|
||||
@@ -135,7 +135,7 @@ class LayeredChartState extends State<LayeredChart> {
|
||||
capPaths[i].lineTo(startX, startY + 1);
|
||||
capPaths[i].close();
|
||||
}
|
||||
labelPainter = <TextPainter>[];
|
||||
labelPainter = [];
|
||||
for (int i = 0; i < dataToPlot.length; i++) {
|
||||
TextSpan span = TextSpan(
|
||||
style: const TextStyle(
|
||||
@@ -148,7 +148,7 @@ class LayeredChartState extends State<LayeredChart> {
|
||||
tp.layout();
|
||||
labelPainter.add(tp);
|
||||
}
|
||||
milestonePainter = <TextPainter>[];
|
||||
milestonePainter = [];
|
||||
for (int i = 0; i < milestones.length; i++) {
|
||||
TextSpan span = TextSpan(
|
||||
style: const TextStyle(
|
||||
|
||||
@@ -48,7 +48,7 @@ class _MainLayoutState extends State<MainLayout> with TickerProviderStateMixin {
|
||||
|
||||
createAnimation(0);
|
||||
|
||||
weekLabels = <WeekLabel>[];
|
||||
weekLabels = [];
|
||||
weekLabels.add(WeekLabel.forDate(DateTime(2019, 2, 26), 'v1.2'));
|
||||
weekLabels.add(WeekLabel.forDate(DateTime(2018, 12, 4), 'v1.0'));
|
||||
// weekLabels.add(WeekLabel.forDate(new DateTime(2018, 9, 19), "Preview 2"));
|
||||
@@ -155,7 +155,7 @@ class _MainLayoutState extends State<MainLayout> with TickerProviderStateMixin {
|
||||
Column mainColumn = Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
children: [
|
||||
Expanded(child: layeredChart),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
|
||||
@@ -20,7 +20,7 @@ class ParticleBackgroundPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(
|
||||
children: <Widget>[
|
||||
children: [
|
||||
Positioned.fill(child: AnimatedBackground()),
|
||||
Positioned.fill(child: Particles(30)),
|
||||
Positioned.fill(child: CenteredText()),
|
||||
|
||||
Reference in New Issue
Block a user