1
0
mirror of https://github.com/flutter/samples.git synced 2026-07-12 12:02:31 +00:00

web/charts: Migrate to null safety (#921)

This commit is contained in:
Brett Morgan
2021-10-08 16:39:37 +11:00
committed by GitHub
parent d14e79b833
commit 8932e60976
106 changed files with 355 additions and 346 deletions

View File

@@ -29,10 +29,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
///
/// Also shows the option to provide a custom measure formatter.
class LegendWithMeasures extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const LegendWithMeasures(this.seriesList, {this.animate, Key key})
const LegendWithMeasures(this.seriesList, {this.animate, Key? key})
: super(key: key);
factory LegendWithMeasures.withSampleData() {
@@ -153,7 +153,7 @@ class LegendWithMeasures extends StatelessWidget {
showMeasures: true,
// Optionally provide a measure formatter to format the measure value.
// If none is specified the value is formatted as a decimal.
measureFormatter: (num value) {
measureFormatter: (num? value) {
return value == null ? '-' : '${value}k';
},
),