@@ -2,29 +2,29 @@ import 'package:flutter/material.dart';
2
2
import 'package:syncfusion_flutter_charts/charts.dart' ;
3
3
4
4
void main () {
5
- return runApp (ChartApp ());
5
+ return runApp (_ChartApp ());
6
6
}
7
7
8
- class ChartApp extends StatelessWidget {
8
+ class _ChartApp extends StatelessWidget {
9
9
@override
10
10
Widget build (BuildContext context) {
11
11
return MaterialApp (
12
12
title: 'Chart Demo' ,
13
13
theme: ThemeData (primarySwatch: Colors .blue),
14
- home: MyHomePage (),
14
+ home: _MyHomePage (),
15
15
);
16
16
}
17
17
}
18
18
19
- class MyHomePage extends StatefulWidget {
19
+ class _MyHomePage extends StatefulWidget {
20
20
// ignore: prefer_const_constructors_in_immutables
21
- MyHomePage ({Key key}) : super (key: key);
21
+ _MyHomePage ({Key key}) : super (key: key);
22
22
23
23
@override
24
24
_MyHomePageState createState () => _MyHomePageState ();
25
25
}
26
26
27
- class _MyHomePageState extends State <MyHomePage > {
27
+ class _MyHomePageState extends State <_MyHomePage > {
28
28
@override
29
29
Widget build (BuildContext context) {
30
30
return Scaffold (
@@ -39,25 +39,25 @@ class _MyHomePageState extends State<MyHomePage> {
39
39
legend: Legend (isVisible: true ),
40
40
// Enable tooltip
41
41
tooltipBehavior: TooltipBehavior (enable: true ),
42
- series: < ChartSeries <SalesData , String >> [
43
- LineSeries <SalesData , String >(
44
- dataSource: < SalesData > [
45
- SalesData ('Jan' , 35 ),
46
- SalesData ('Feb' , 28 ),
47
- SalesData ('Mar' , 34 ),
48
- SalesData ('Apr' , 32 ),
49
- SalesData ('May' , 40 )
42
+ series: < ChartSeries <_SalesData , String >> [
43
+ LineSeries <_SalesData , String >(
44
+ dataSource: < _SalesData > [
45
+ _SalesData ('Jan' , 35 ),
46
+ _SalesData ('Feb' , 28 ),
47
+ _SalesData ('Mar' , 34 ),
48
+ _SalesData ('Apr' , 32 ),
49
+ _SalesData ('May' , 40 )
50
50
],
51
- xValueMapper: (SalesData sales, _) => sales.year,
52
- yValueMapper: (SalesData sales, _) => sales.sales,
51
+ xValueMapper: (_SalesData sales, _) => sales.year,
52
+ yValueMapper: (_SalesData sales, _) => sales.sales,
53
53
// Enable data label
54
54
dataLabelSettings: DataLabelSettings (isVisible: true ))
55
55
]));
56
56
}
57
57
}
58
58
59
- class SalesData {
60
- SalesData (this .year, this .sales);
59
+ class _SalesData {
60
+ _SalesData (this .year, this .sales);
61
61
62
62
final String year;
63
63
final double sales;
0 commit comments