Skip to content

Commit 8205e55

Browse files
Committed null safety changes
1 parent e33a448 commit 8205e55

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/main.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ChartApp extends StatelessWidget {
2121

2222
class MyHomePage extends StatefulWidget {
2323
// ignore: prefer_const_constructors_in_immutables
24-
MyHomePage({Key key}) : super(key: key);
24+
MyHomePage({Key? key}) : super(key: key);
2525

2626
@override
2727
_MyHomePageState createState() => _MyHomePageState();
@@ -53,12 +53,12 @@ class _MyHomePageState extends State<MyHomePage> {
5353
if (args.pointIndex == 2) {
5454
//Tooltip with X and Y positions of data points
5555
args.header = 'x : y';
56-
args.text = '${args.locationX.floor()} : ${args.locationY.floor()}';
56+
args.text = '${args.locationX!.floor()} : ${args.locationY!.floor()}';
5757
}
5858
if(args.pointIndex == 3) {
5959
//Tooltip with formatted DateTime values
60-
List<CartesianChartPoint<dynamic>> chartdata = args.dataPoints;
61-
args.header = DateFormat('d MMM yyyy').format(chartdata[3].x);
60+
List<dynamic>? chartdata = args.dataPoints;
61+
args.header = DateFormat('d MMM yyyy').format(chartdata![3].x);
6262
args.text = '${chartdata[3].y}';
6363
}
6464
},

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
1818
version: 1.0.0+1
1919

2020
environment:
21-
sdk: ">=2.7.0 <3.0.0"
21+
sdk: ">=2.12.0 <3.0.0"
2222

2323
dependencies:
2424
flutter:
@@ -28,7 +28,7 @@ dependencies:
2828
# The following adds the Cupertino Icons font to your application.
2929
# Use with the CupertinoIcons class for iOS style icons.
3030
cupertino_icons: ^0.1.3
31-
syncfusion_flutter_charts: ^18.1.46
31+
syncfusion_flutter_charts: ^19.1.55+1
3232

3333
dev_dependencies:
3434
flutter_test:

0 commit comments

Comments
 (0)