1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 22:09:06 +00:00
This commit is contained in:
Brett Morgan
2022-05-11 12:48:11 -07:00
committed by GitHub
parent fb00d0a102
commit ccd68f34e2
242 changed files with 1719 additions and 1430 deletions

View File

@@ -17,12 +17,12 @@ class LayeredChart extends StatefulWidget {
: super(key: key);
@override
State<StatefulWidget> createState() {
return LayeredChartState();
State<LayeredChart> createState() {
return _LayeredChartState();
}
}
class LayeredChartState extends State<LayeredChart> {
class _LayeredChartState extends State<LayeredChart> {
late List<Path> paths;
late List<Path> capPaths;
late List<double> maxValues;
@@ -167,13 +167,13 @@ class LayeredChartState extends State<LayeredChart> {
return Container(
color: Constants.backgroundColor,
child: CustomPaint(
foregroundPainter: ChartPainter(this, widget.dataToPlot,
foregroundPainter: _ChartPainter(this, widget.dataToPlot,
widget.milestones, 80, 50, 50, 12, 500, widget.animationValue),
child: Container()));
}
}
class ChartPainter extends CustomPainter {
class _ChartPainter extends CustomPainter {
static List<Color?> colors = [
Colors.red[900],
const Color(0xffc4721a),
@@ -208,9 +208,9 @@ class ChartPainter extends CustomPainter {
late Paint linePaint;
late Paint fillPaint;
LayeredChartState state;
_LayeredChartState state;
ChartPainter(
_ChartPainter(
this.state,
this.dataToPlot,
this.milestones,

View File

@@ -22,7 +22,7 @@ class MainLayout extends StatefulWidget {
const MainLayout({Key? key}) : super(key: key);
@override
_MainLayoutState createState() => _MainLayoutState();
State<MainLayout> createState() => _MainLayoutState();
}
class _MainLayoutState extends State<MainLayout> with TickerProviderStateMixin {

View File

@@ -29,12 +29,12 @@ class Timeline extends StatefulWidget {
: super(key: key);
@override
State<StatefulWidget> createState() {
return TimelineState();
State<Timeline> createState() {
return _TimelineState();
}
}
class TimelineState extends State<Timeline> {
class _TimelineState extends State<Timeline> {
HashMap<String, TextPainter> labelPainters = HashMap();
@override
@@ -49,7 +49,7 @@ class TimelineState extends State<Timeline> {
for (var weekLabel in widget.weekLabels) {
labelPainters[weekLabel.label] =
_makeTextPainter(Constants.milestoneTimelineColor, weekLabel.label);
labelPainters[weekLabel.label + '_red'] =
labelPainters['${weekLabel.label}_red'] =
_makeTextPainter(Colors.redAccent, weekLabel.label);
}
}
@@ -79,7 +79,7 @@ class TimelineState extends State<Timeline> {
}
},
child: CustomPaint(
foregroundPainter: TimelinePainter(
foregroundPainter: _TimelinePainter(
this, widget.numWeeks, widget.animationValue, widget.weekLabels),
child: Container(
height: 200,
@@ -106,8 +106,8 @@ class TimelineState extends State<Timeline> {
}
}
class TimelinePainter extends CustomPainter {
TimelineState state;
class _TimelinePainter extends CustomPainter {
_TimelineState state;
late Paint mainLinePaint;
late Paint milestoneLinePaint;
@@ -123,7 +123,7 @@ class TimelinePainter extends CustomPainter {
int yearNumber = 2015;
TimelinePainter(
_TimelinePainter(
this.state, this.numWeeks, this.animationValue, this.weekLabels) {
mainLinePaint = Paint();
mainLinePaint.style = PaintingStyle.stroke;

View File

@@ -47,7 +47,7 @@ packages:
name: flutter_lints
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
version: "2.0.1"
http:
dependency: "direct main"
description:
@@ -75,7 +75,7 @@ packages:
name: lints
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
version: "2.0.0"
material_color_utilities:
dependency: transitive
description:
@@ -138,4 +138,4 @@ packages:
source: hosted
version: "2.1.2"
sdks:
dart: ">=2.14.0 <3.0.0"
dart: ">=2.17.0-206.0.dev <3.0.0"

View File

@@ -1,7 +1,7 @@
name: github_dataviz
environment:
sdk: '>=2.12.0 <3.0.0'
sdk: ">=2.17.0-0 <3.0.0"
dependencies:
flutter:
@@ -10,7 +10,7 @@ dependencies:
http: ^0.13.4
dev_dependencies:
flutter_lints: ^1.0.4
flutter_lints: ^2.0.1
flutter:
assets: