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

pull/925/head
Brett Morgan 4 years ago committed by GitHub
parent d14e79b833
commit 8932e60976
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -38,10 +38,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class DomainA11yExploreBarChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const DomainA11yExploreBarChart(this.seriesList, {this.animate, Key key})
const DomainA11yExploreBarChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [BarChart] with sample data and no transition.

@ -22,8 +22,12 @@ class AppConfig {
final ThemeData theme;
final bool showPerformanceOverlay;
AppConfig(
{this.appName, this.appLink, this.theme, this.showPerformanceOverlay});
AppConfig({
required this.appName,
required this.appLink,
required this.theme,
required this.showPerformanceOverlay,
});
}
/// The default configuration of the app.

@ -36,10 +36,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
/// RTL.flipAxisLocations is set.
class BarChartWithSecondaryAxis extends StatelessWidget {
static const secondaryMeasureAxisId = 'secondaryMeasureAxisId';
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const BarChartWithSecondaryAxis(this.seriesList, {this.animate, Key key})
const BarChartWithSecondaryAxis(this.seriesList, {this.animate, Key? key})
: super(key: key);
factory BarChartWithSecondaryAxis.withSampleData() {

@ -30,10 +30,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
/// RTL.flipAxisLocations is set.
class BarChartWithSecondaryAxisOnly extends StatelessWidget {
static const secondaryMeasureAxisId = 'secondaryMeasureAxisId';
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const BarChartWithSecondaryAxisOnly(this.seriesList, {this.animate, Key key})
const BarChartWithSecondaryAxisOnly(this.seriesList, {this.animate, Key? key})
: super(key: key);
factory BarChartWithSecondaryAxisOnly.withSampleData() {

@ -22,10 +22,10 @@ import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
class CustomAxisTickFormatters extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, DateTime>> seriesList;
final bool? animate;
const CustomAxisTickFormatters(this.seriesList, {this.animate, Key key})
const CustomAxisTickFormatters(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [TimeSeriesChart] with sample data and no transition.

@ -26,10 +26,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
/// There are many axis styling options in the SmallTickRenderer allowing you
/// to customize the font, tick lengths, and offsets.
class CustomFontSizeAndColor extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const CustomFontSizeAndColor(this.seriesList, {this.animate, Key key})
const CustomFontSizeAndColor(this.seriesList, {this.animate, Key? key})
: super(key: key);
factory CustomFontSizeAndColor.withSampleData() {

@ -25,10 +25,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class CustomMeasureTickCount extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, DateTime>> seriesList;
final bool? animate;
const CustomMeasureTickCount(this.seriesList, {this.animate, Key key})
const CustomMeasureTickCount(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [TimeSeriesChart] with sample data and no transition.

@ -29,10 +29,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
/// Note: primary and secondary may flip left and right positioning when
/// RTL.flipAxisLocations is set.
class FlippedVerticalAxis extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const FlippedVerticalAxis(this.seriesList, {this.animate, Key key})
const FlippedVerticalAxis(this.seriesList, {this.animate, Key? key})
: super(key: key);
factory FlippedVerticalAxis.withSampleData() {

@ -21,10 +21,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class GridlineDashPattern extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, DateTime>> seriesList;
final bool? animate;
const GridlineDashPattern(this.seriesList, {this.animate, Key key})
const GridlineDashPattern(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [TimeSeriesChart] with sample data and no transition.

@ -22,10 +22,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
/// Example of hiding both axis.
class HiddenTicksAndLabelsAxis extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const HiddenTicksAndLabelsAxis(this.seriesList, {this.animate, Key key})
const HiddenTicksAndLabelsAxis(this.seriesList, {this.animate, Key? key})
: super(key: key);
factory HiddenTicksAndLabelsAxis.withSampleData() {

@ -36,11 +36,11 @@ import 'package:charts_flutter/flutter.dart' as charts;
/// RTL.flipAxisLocations is set.
class HorizontalBarChartWithSecondaryAxis extends StatelessWidget {
static const secondaryMeasureAxisId = 'secondaryMeasureAxisId';
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const HorizontalBarChartWithSecondaryAxis(this.seriesList,
{this.animate, Key key})
{this.animate, Key? key})
: super(key: key);
factory HorizontalBarChartWithSecondaryAxis.withSampleData() {

@ -26,10 +26,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class IntegerOnlyMeasureAxis extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, DateTime>> seriesList;
final bool? animate;
const IntegerOnlyMeasureAxis(this.seriesList, {this.animate, Key key})
const IntegerOnlyMeasureAxis(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [TimeSeriesChart] with sample data and no transition.

@ -28,10 +28,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class DisjointMeasureAxisLineChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const DisjointMeasureAxisLineChart(this.seriesList, {this.animate, Key key})
const DisjointMeasureAxisLineChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [LineChart] with sample data and no transition.
@ -263,8 +263,8 @@ class DisjointMeasureAxisLineChart extends StatelessWidget {
/// Sample linear data type.
class LinearClicks {
final int year;
final int clickCount;
final double clickRate;
final int? clickCount;
final double? clickRate;
LinearClicks(this.year, {this.clickCount, this.clickRate});
}

@ -23,10 +23,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
/// Example of using a custom primary measure replacing the renderSpec with one
/// that aligns the text under the tick and left justifies.
class MeasureAxisLabelAlignment extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const MeasureAxisLabelAlignment(this.seriesList, {this.animate, Key key})
const MeasureAxisLabelAlignment(this.seriesList, {this.animate, Key? key})
: super(key: key);
factory MeasureAxisLabelAlignment.withSampleData() {

@ -22,10 +22,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class NonzeroBoundMeasureAxis extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, DateTime>> seriesList;
final bool? animate;
const NonzeroBoundMeasureAxis(this.seriesList, {this.animate, Key key})
const NonzeroBoundMeasureAxis(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [TimeSeriesChart] with sample data and no transition.

@ -29,10 +29,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class NumericInitialViewport extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const NumericInitialViewport(this.seriesList, {this.animate, Key key})
const NumericInitialViewport(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [LineChart] with sample data and no transition.

@ -29,10 +29,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class OrdinalInitialViewport extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const OrdinalInitialViewport(this.seriesList, {this.animate, Key key})
const OrdinalInitialViewport(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [BarChart] with sample data and no transition.

@ -27,10 +27,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
/// There are many axis styling options in the SmallTickRenderer allowing you
/// to customize the font, tick lengths, and offsets.
class ShortTickLengthAxis extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const ShortTickLengthAxis(this.seriesList, {this.animate, Key key})
const ShortTickLengthAxis(this.seriesList, {this.animate, Key? key})
: super(key: key);
factory ShortTickLengthAxis.withSampleData() {

@ -34,10 +34,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
/// For datetime axis, the [StaticDateTimeTickProviderSpec] can be used by
/// passing in a list of ticks defined with [TickSpec] of datetime.
class StaticallyProvidedTicks extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const StaticallyProvidedTicks(this.seriesList, {this.animate, Key key})
const StaticallyProvidedTicks(this.seriesList, {this.animate, Key? key})
: super(key: key);
factory StaticallyProvidedTicks.withSampleData() {

@ -21,10 +21,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class CustomRoundedBars extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const CustomRoundedBars(this.seriesList, {this.animate, Key key})
const CustomRoundedBars(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [BarChart] with custom rounded bars.

@ -21,10 +21,10 @@ import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
class GroupedBarChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const GroupedBarChart(this.seriesList, {this.animate, Key key})
const GroupedBarChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
factory GroupedBarChart.withSampleData() {

@ -23,10 +23,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
/// Example of a grouped bar chart with three series, each rendered with
/// different fill colors.
class GroupedFillColorBarChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const GroupedFillColorBarChart(this.seriesList, {this.animate, Key key})
const GroupedFillColorBarChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
factory GroupedFillColorBarChart.withSampleData() {

@ -21,11 +21,11 @@ import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
class GroupedBarSingleTargetLineChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const GroupedBarSingleTargetLineChart(this.seriesList,
{this.animate, Key key})
{this.animate, Key? key})
: super(key: key);
factory GroupedBarSingleTargetLineChart.withSampleData() {

@ -21,10 +21,10 @@ import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
class GroupedStackedBarChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const GroupedStackedBarChart(this.seriesList, {this.animate, Key key})
const GroupedStackedBarChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
factory GroupedStackedBarChart.withSampleData() {

@ -25,11 +25,11 @@ import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
class GroupedStackedWeightPatternBarChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const GroupedStackedWeightPatternBarChart(this.seriesList,
{this.animate, Key key})
{this.animate, Key? key})
: super(key: key);
factory GroupedStackedWeightPatternBarChart.withSampleData() {

@ -21,10 +21,10 @@ import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
class GroupedBarTargetLineChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const GroupedBarTargetLineChart(this.seriesList, {this.animate, Key key})
const GroupedBarTargetLineChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
factory GroupedBarTargetLineChart.withSampleData() {

@ -21,10 +21,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class HorizontalBarChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const HorizontalBarChart(this.seriesList, {this.animate, Key key})
const HorizontalBarChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [BarChart] with sample data and no transition.

@ -21,10 +21,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class HorizontalBarLabelChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const HorizontalBarLabelChart(this.seriesList, {this.animate, Key key})
const HorizontalBarLabelChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [BarChart] with sample data and no transition.

@ -21,10 +21,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class HorizontalBarLabelCustomChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const HorizontalBarLabelCustomChart(this.seriesList, {this.animate, Key key})
const HorizontalBarLabelCustomChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [BarChart] with sample data and no transition.

@ -25,11 +25,11 @@ import 'package:charts_flutter/flutter.dart' as charts;
/// The second series of bars is rendered with a pattern by defining a
/// fillPatternFn mapping function.
class HorizontalPatternForwardHatchBarChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const HorizontalPatternForwardHatchBarChart(this.seriesList,
{this.animate, Key key})
{this.animate, Key? key})
: super(key: key);
factory HorizontalPatternForwardHatchBarChart.withSampleData() {

@ -24,10 +24,10 @@ import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
class PatternForwardHatchBarChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const PatternForwardHatchBarChart(this.seriesList, {this.animate, Key key})
const PatternForwardHatchBarChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
factory PatternForwardHatchBarChart.withSampleData() {

@ -21,10 +21,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class SimpleBarChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const SimpleBarChart(this.seriesList, {this.animate, Key key})
const SimpleBarChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [BarChart] with sample data and no transition.

@ -22,10 +22,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
/// Example of a Spark Bar by hiding both axis, reducing the chart margins.
class SparkBar extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const SparkBar(this.seriesList, {this.animate, Key key}) : super(key: key);
const SparkBar(this.seriesList, {this.animate, Key? key}) : super(key: key);
factory SparkBar.withSampleData() {
return SparkBar(

@ -21,10 +21,10 @@ import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
class StackedBarChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const StackedBarChart(this.seriesList, {this.animate, Key key})
const StackedBarChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a stacked [BarChart] with sample data and no transition.

@ -23,10 +23,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
/// Example of a stacked bar chart with three series, each rendered with
/// different fill colors.
class StackedFillColorBarChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const StackedFillColorBarChart(this.seriesList, {this.animate, Key key})
const StackedFillColorBarChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
factory StackedFillColorBarChart.withSampleData() {

@ -21,10 +21,10 @@ import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
class StackedHorizontalBarChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const StackedHorizontalBarChart(this.seriesList, {this.animate, Key key})
const StackedHorizontalBarChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a stacked [BarChart] with sample data and no transition.

@ -21,10 +21,10 @@ import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
class StackedBarTargetLineChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const StackedBarTargetLineChart(this.seriesList, {this.animate, Key key})
const StackedBarTargetLineChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a stacked [BarChart] with sample data and no transition.

@ -23,10 +23,10 @@ import 'package:flutter/material.dart';
/// A series of [ChartTitle] behaviors are used to render titles, one per
/// margin.
class ChartTitleLine extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const ChartTitleLine(this.seriesList, {this.animate, Key key})
const ChartTitleLine(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [LineChart] with sample data and no transition.

@ -48,10 +48,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class InitialHintAnimation extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const InitialHintAnimation(this.seriesList, {this.animate, Key key})
const InitialHintAnimation(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [BarChart] with sample data and no transition.

@ -31,10 +31,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class InitialSelection extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const InitialSelection(this.seriesList, {this.animate, Key key})
const InitialSelection(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [BarChart] with initial selection behavior.

@ -24,10 +24,10 @@ import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
class PercentOfDomainBarChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const PercentOfDomainBarChart(this.seriesList, {this.animate, Key key})
const PercentOfDomainBarChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a stacked [BarChart] with sample data and no transition.

@ -25,11 +25,11 @@ import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
class PercentOfDomainByCategoryBarChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const PercentOfDomainByCategoryBarChart(this.seriesList,
{this.animate, Key key})
{this.animate, Key? key})
: super(key: key);
factory PercentOfDomainByCategoryBarChart.withSampleData() {

@ -22,10 +22,10 @@ import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
class PercentOfSeriesBarChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const PercentOfSeriesBarChart(this.seriesList, {this.animate, Key key})
const PercentOfSeriesBarChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a stacked [BarChart] with sample data and no transition.

@ -19,10 +19,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class SelectionBarHighlight extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const SelectionBarHighlight(this.seriesList, {this.animate, Key key})
const SelectionBarHighlight(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [BarChart] with sample data and no transition.

@ -33,10 +33,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class SelectionCallbackExample extends StatefulWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, DateTime>> seriesList;
final bool? animate;
const SelectionCallbackExample(this.seriesList, {this.animate, Key key})
const SelectionCallbackExample(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [charts.TimeSeriesChart] with sample data and no transition.
@ -130,8 +130,8 @@ class SelectionCallbackExample extends StatefulWidget {
}
class _SelectionCallbackState extends State<SelectionCallbackExample> {
DateTime _time;
Map<String, num> _measures;
DateTime? _time;
Map<String?, num?>? _measures;
// Listens to the underlying selection changes, and updates the information
// relevant to building the primitive legend like information under the
@ -139,8 +139,8 @@ class _SelectionCallbackState extends State<SelectionCallbackExample> {
_onSelectionChanged(charts.SelectionModel model) {
final selectedDatum = model.selectedDatum;
DateTime time;
final measures = <String, num>{};
DateTime? time;
final measures = <String?, num?>{};
// We get the model that updated with a list of [SeriesDatum] which is
// simply a pair of series & datum.
@ -185,7 +185,7 @@ class _SelectionCallbackState extends State<SelectionCallbackExample> {
padding: const EdgeInsets.only(top: 5.0),
child: Text(_time.toString())));
}
_measures?.forEach((String series, num value) {
_measures?.forEach((String? series, num? value) {
children.add(Text('$series: $value'));
});

@ -19,10 +19,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class SelectionLineHighlight extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const SelectionLineHighlight(this.seriesList, {this.animate, Key key})
const SelectionLineHighlight(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [LineChart] with sample data and no transition.

@ -19,11 +19,11 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class SelectionLineHighlightCustomShape extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const SelectionLineHighlightCustomShape(this.seriesList,
{this.animate, Key key})
{this.animate, Key? key})
: super(key: key);
/// Creates a [LineChart] with sample data and no transition.

@ -38,10 +38,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class SelectionScatterPlotHighlight extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const SelectionScatterPlotHighlight(this.seriesList, {this.animate, Key key})
const SelectionScatterPlotHighlight(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [ScatterPlotChart] with sample data and no transition.
@ -225,9 +225,9 @@ class LinearSales {
final int year;
final int sales;
final double radius;
final String shape;
final charts.Color fillColor;
final double strokeWidth;
final String? shape;
final charts.Color? fillColor;
final double? strokeWidth;
LinearSales(this.year, this.sales, this.radius, this.shape, this.fillColor,
this.strokeWidth);

@ -29,10 +29,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class SelectionUserManaged extends StatefulWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const SelectionUserManaged(this.seriesList, {this.animate, Key key})
const SelectionUserManaged(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [BarChart] with sample data and no transition.

@ -33,10 +33,10 @@ import 'package:flutter/scheduler.dart';
/// [Slider.moveSliderToDomain] can be called to programmatically position the
/// slider. This is useful for synchronizing the slider with external elements.
class SliderLine extends StatefulWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const SliderLine(this.seriesList, {this.animate, Key key}) : super(key: key);
const SliderLine(this.seriesList, {this.animate, Key? key}) : super(key: key);
/// Creates a [LineChart] with sample data and no transition.
factory SliderLine.withSampleData() {
@ -103,9 +103,9 @@ class SliderLine extends StatefulWidget {
}
class _SliderCallbackState extends State<SliderLine> {
num _sliderDomainValue;
String _sliderDragState;
Point<int> _sliderPosition;
num? _sliderDomainValue;
String? _sliderDragState;
Point<int>? _sliderPosition;
// Handles callbacks when the user drags the slider.
_onSliderChange(Point<int> point, dynamic domain, String roleId,
@ -119,7 +119,7 @@ class _SliderCallbackState extends State<SliderLine> {
});
}
SchedulerBinding.instance.addPostFrameCallback(rebuild);
SchedulerBinding.instance!.addPostFrameCallback(rebuild);
}
@override
@ -175,7 +175,7 @@ class _SliderCallbackState extends State<SliderLine> {
children.add(Padding(
padding: const EdgeInsets.only(top: 5.0),
child: Text(
'Slider position: ${_sliderPosition.x}, ${_sliderPosition.y}')));
'Slider position: ${_sliderPosition!.x}, ${_sliderPosition!.y}')));
}
if (_sliderDragState != null) {
children.add(Padding(

@ -22,10 +22,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class SlidingViewportOnSelection extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const SlidingViewportOnSelection(this.seriesList, {this.animate, Key key})
const SlidingViewportOnSelection(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [BarChart] with sample data and no transition.

@ -27,10 +27,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class DateTimeComboLinePointChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, DateTime>> seriesList;
final bool? animate;
const DateTimeComboLinePointChart(this.seriesList, {this.animate, Key key})
const DateTimeComboLinePointChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [TimeSeriesChart] with sample data and no transition.

@ -22,10 +22,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class NumericComboLineBarChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const NumericComboLineBarChart(this.seriesList, {this.animate, Key key})
const NumericComboLineBarChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [LineChart] with sample data and no transition.

@ -27,10 +27,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class NumericComboLinePointChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const NumericComboLinePointChart(this.seriesList, {this.animate, Key key})
const NumericComboLinePointChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [LineChart] with sample data and no transition.

@ -22,10 +22,10 @@ import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
class OrdinalComboBarLineChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const OrdinalComboBarLineChart(this.seriesList, {this.animate, Key key})
const OrdinalComboBarLineChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
factory OrdinalComboBarLineChart.withSampleData() {

@ -22,10 +22,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class ScatterPlotComboLineChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const ScatterPlotComboLineChart(this.seriesList, {this.animate, Key key})
const ScatterPlotComboLineChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [ScatterPlotChart] with sample data and no transition.

@ -21,9 +21,9 @@ class GalleryDrawer extends StatelessWidget {
final ValueChanged<bool> onShowPerformanceOverlayChanged;
const GalleryDrawer(
{Key key,
this.showPerformanceOverlay,
this.onShowPerformanceOverlayChanged})
{Key? key,
required this.showPerformanceOverlay,
required this.onShowPerformanceOverlayChanged})
: super(key: key);
@override
@ -40,7 +40,7 @@ class GalleryDrawer extends StatelessWidget {
selected: showPerformanceOverlay,
trailing: Checkbox(
value: showPerformanceOverlay,
onChanged: (bool value) {
onChanged: (bool? value) {
onShowPerformanceOverlayChanged(!showPerformanceOverlay);
},
),

@ -20,17 +20,17 @@ typedef GalleryWidgetBuilder = Widget Function();
/// Helper to build gallery.
class GalleryScaffold extends StatefulWidget {
/// The widget used for leading in a [ListTile].
final Widget listTileIcon;
final Widget? listTileIcon;
final String title;
final String subtitle;
final GalleryWidgetBuilder childBuilder;
const GalleryScaffold(
{this.listTileIcon,
this.title,
this.subtitle,
this.childBuilder,
Key key})
required this.title,
required this.subtitle,
required this.childBuilder,
Key? key})
: super(key: key);
/// Gets the gallery

@ -51,12 +51,10 @@ class Home extends StatelessWidget {
final legendsGalleries = legends.buildGallery();
Home(
{Key key,
this.showPerformanceOverlay,
@required this.onShowPerformanceOverlayChanged})
: super(key: key) {
assert(onShowPerformanceOverlayChanged != null);
}
{Key? key,
required this.showPerformanceOverlay,
required this.onShowPerformanceOverlayChanged})
: super(key: key);
@override
Widget build(BuildContext context) {

@ -21,10 +21,11 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class RTLBarChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const RTLBarChart(this.seriesList, {this.animate, Key key}) : super(key: key);
const RTLBarChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [BarChart] with sample data and no transition.
factory RTLBarChart.withSampleData() {

@ -21,10 +21,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class RTLLineChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const RTLLineChart(this.seriesList, {this.animate, Key key})
const RTLLineChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [LineChart] with sample data and no transition.

@ -32,10 +32,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class RTLLineSegments extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const RTLLineSegments(this.seriesList, {this.animate, Key key})
const RTLLineSegments(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [LineChart] with sample data and no transition.
@ -242,7 +242,7 @@ class RTLLineSegments extends StatelessWidget {
class LinearSales {
final int year;
final int sales;
final List<int> dashPattern;
final List<int>? dashPattern;
final double strokeWidthPx;
LinearSales(this.year, this.sales, this.dashPattern, this.strokeWidthPx);

@ -21,10 +21,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class RTLSeriesLegend extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const RTLSeriesLegend(this.seriesList, {this.animate, Key key})
const RTLSeriesLegend(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [BarChart] with sample data and no transition.

@ -25,10 +25,10 @@ import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
class DatumLegendOptions extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, int>> seriesList;
final bool? animate;
const DatumLegendOptions(this.seriesList, {this.animate, Key key})
const DatumLegendOptions(this.seriesList, {this.animate, Key? key})
: super(key: key);
factory DatumLegendOptions.withSampleData() {

@ -29,9 +29,9 @@ import 'package:charts_flutter/flutter.dart' as charts;
/// Also shows the option to provide a custom measure formatter.
class DatumLegendWithMeasures extends StatelessWidget {
final List<charts.Series<LinearSales, int>> seriesList;
final bool animate;
final bool? animate;
const DatumLegendWithMeasures(this.seriesList, {this.animate, Key key})
const DatumLegendWithMeasures(this.seriesList, {this.animate, Key? key})
: super(key: key);
factory DatumLegendWithMeasures.withSampleData() {
@ -110,7 +110,7 @@ class DatumLegendWithMeasures extends StatelessWidget {
legendDefaultMeasure: charts.LegendDefaultMeasure.firstValue,
// 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';
},
),

@ -21,10 +21,10 @@ import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
class DefaultHiddenSeriesLegend extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const DefaultHiddenSeriesLegend(this.seriesList, {this.animate, Key key})
const DefaultHiddenSeriesLegend(this.seriesList, {this.animate, Key? key})
: super(key: key);
factory DefaultHiddenSeriesLegend.withSampleData() {

@ -30,11 +30,11 @@ class IconRenderer extends charts.CustomSymbolRenderer {
@override
Widget build(BuildContext context,
{Size size, Color color, bool enabled = true}) {
{Size? size, Color? color, bool enabled = true}) {
// Lighten the color if the symbol is not enabled
// Example: If user has tapped on a Series deselecting it.
if (!enabled) {
color = color.withOpacity(0.26);
color = color!.withOpacity(0.26);
}
return SizedBox.fromSize(
@ -43,10 +43,10 @@ class IconRenderer extends charts.CustomSymbolRenderer {
}
class LegendWithCustomSymbol extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const LegendWithCustomSymbol(this.seriesList, {this.animate, Key key})
const LegendWithCustomSymbol(this.seriesList, {this.animate, Key? key})
: super(key: key);
factory LegendWithCustomSymbol.withSampleData() {

@ -25,10 +25,10 @@ import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
class LegendOptions extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const LegendOptions(this.seriesList, {this.animate, Key key})
const LegendOptions(this.seriesList, {this.animate, Key? key})
: super(key: key);
factory LegendOptions.withSampleData() {

@ -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';
},
),

@ -21,10 +21,10 @@ import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
class SimpleDatumLegend extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, int>> seriesList;
final bool? animate;
const SimpleDatumLegend(this.seriesList, {this.animate, Key key})
const SimpleDatumLegend(this.seriesList, {this.animate, Key? key})
: super(key: key);
factory SimpleDatumLegend.withSampleData() {

@ -21,10 +21,10 @@ import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
class SimpleSeriesLegend extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const SimpleSeriesLegend(this.seriesList, {this.animate, Key key})
const SimpleSeriesLegend(this.seriesList, {this.animate, Key? key})
: super(key: key);
factory SimpleSeriesLegend.withSampleData() {

@ -22,10 +22,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class LineAnimationZoomChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const LineAnimationZoomChart(this.seriesList, {this.animate, Key key})
const LineAnimationZoomChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [LineChart] with sample data and no transition.

@ -21,10 +21,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class AreaAndLineChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const AreaAndLineChart(this.seriesList, {this.animate, Key key})
const AreaAndLineChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [LineChart] with sample data and no transition.

@ -22,10 +22,10 @@ import 'package:flutter/material.dart';
/// Example of a line chart rendered with dash patterns.
class DashPatternLineChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const DashPatternLineChart(this.seriesList, {this.animate, Key key})
const DashPatternLineChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [LineChart] with sample data and no transition.

@ -21,10 +21,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class LineLineAnnotationChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const LineLineAnnotationChart(this.seriesList, {this.animate, Key key})
const LineLineAnnotationChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [LineChart] with sample data and line annotations.

@ -21,10 +21,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class PointsLineChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const PointsLineChart(this.seriesList, {this.animate, Key key})
const PointsLineChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [LineChart] with sample data and no transition.

@ -21,10 +21,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class LineRangeAnnotationChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const LineRangeAnnotationChart(this.seriesList, {this.animate, Key key})
const LineRangeAnnotationChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [LineChart] with sample data and range annotations.

@ -22,10 +22,11 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class LineRangeAnnotationMarginChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const LineRangeAnnotationMarginChart(this.seriesList, {this.animate, Key key})
const LineRangeAnnotationMarginChart(this.seriesList,
{this.animate, Key? key})
: super(key: key);
/// Creates a [LineChart] with sample data and range annotations.

@ -32,10 +32,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class SegmentsLineChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const SegmentsLineChart(this.seriesList, {this.animate, Key key})
const SegmentsLineChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [LineChart] with sample data and no transition.
@ -227,7 +227,7 @@ class SegmentsLineChart extends StatelessWidget {
class LinearSales {
final int year;
final int sales;
final List<int> dashPattern;
final List<int>? dashPattern;
final double strokeWidthPx;
LinearSales(this.year, this.sales, this.dashPattern, this.strokeWidthPx);

@ -21,10 +21,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class SimpleLineChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const SimpleLineChart(this.seriesList, {this.animate, Key key})
const SimpleLineChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [LineChart] with sample data and no transition.

@ -25,10 +25,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class SimpleNullsLineChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const SimpleNullsLineChart(this.seriesList, {this.animate, Key key})
const SimpleNullsLineChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [LineChart] with sample data and no transition.
@ -174,7 +174,7 @@ class SimpleNullsLineChart extends StatelessWidget {
/// Sample linear data type.
class LinearSales {
final int year;
final int sales;
final int? sales;
LinearSales(this.year, this.sales);
}

@ -21,10 +21,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class StackedAreaLineChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const StackedAreaLineChart(this.seriesList, {this.animate, Key key})
const StackedAreaLineChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [LineChart] with sample data and no transition.

@ -25,11 +25,11 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class StackedAreaCustomColorLineChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const StackedAreaCustomColorLineChart(this.seriesList,
{this.animate, Key key})
{this.animate, Key? key})
: super(key: key);
/// Creates a [LineChart] with sample data and no transition.

@ -34,10 +34,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class StackedAreaNullsLineChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const StackedAreaNullsLineChart(this.seriesList, {this.animate, Key key})
const StackedAreaNullsLineChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [LineChart] with sample data and no transition.
@ -186,7 +186,7 @@ class StackedAreaNullsLineChart extends StatelessWidget {
/// Sample linear data type.
class LinearSales {
final int year;
final int sales;
final int? sales;
LinearSales(this.year, this.sales);
}

@ -19,7 +19,7 @@ import 'home.dart';
/// The main gallery app widget.
class GalleryApp extends StatefulWidget {
const GalleryApp({Key key}) : super(key: key);
const GalleryApp({Key? key}) : super(key: key);
@override
GalleryAppState createState() => GalleryAppState();

@ -22,10 +22,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class DonutAutoLabelChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, int>> seriesList;
final bool? animate;
const DonutAutoLabelChart(this.seriesList, {this.animate, Key key})
const DonutAutoLabelChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [PieChart] with sample data and no transition.

@ -21,10 +21,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class DonutPieChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, int>> seriesList;
final bool? animate;
const DonutPieChart(this.seriesList, {this.animate, Key key})
const DonutPieChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [PieChart] with sample data and no transition.

@ -22,10 +22,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class GaugeChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, String>> seriesList;
final bool? animate;
const GaugeChart(this.seriesList, {this.animate, Key key}) : super(key: key);
const GaugeChart(this.seriesList, {this.animate, Key? key}) : super(key: key);
/// Creates a [PieChart] with sample data and no transition.
factory GaugeChart.withSampleData() {

@ -21,10 +21,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class PieOutsideLabelChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, int>> seriesList;
final bool? animate;
const PieOutsideLabelChart(this.seriesList, {this.animate, Key key})
const PieOutsideLabelChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [PieChart] with sample data and no transition.

@ -22,10 +22,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class PartialPieChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, int>> seriesList;
final bool? animate;
const PartialPieChart(this.seriesList, {this.animate, Key key})
const PartialPieChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [PieChart] with sample data and no transition.

@ -21,10 +21,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class SimplePieChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, int>> seriesList;
final bool? animate;
const SimplePieChart(this.seriesList, {this.animate, Key key})
const SimplePieChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [PieChart] with sample data and no transition.

@ -22,10 +22,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class ScatterPlotAnimationZoomChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const ScatterPlotAnimationZoomChart(this.seriesList, {this.animate, Key key})
const ScatterPlotAnimationZoomChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [ScatterPlotChart] with sample data and no transition.

@ -26,10 +26,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class BucketingAxisScatterPlotChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const BucketingAxisScatterPlotChart(this.seriesList, {this.animate, Key key})
const BucketingAxisScatterPlotChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [ScatterPlotChart] with sample data and no transition.

@ -21,11 +21,11 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class ComparisonPointsScatterPlotChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const ComparisonPointsScatterPlotChart(this.seriesList,
{this.animate, Key key})
{this.animate, Key? key})
: super(key: key);
/// Creates a [ScatterPlotChart] with sample data and no transition.

@ -32,10 +32,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class ShapesScatterPlotChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const ShapesScatterPlotChart(this.seriesList, {this.animate, Key key})
const ShapesScatterPlotChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [ScatterPlotChart] with sample data and no transition.
@ -196,9 +196,9 @@ class LinearSales {
final int year;
final int sales;
final double radius;
final String shape;
final charts.Color fillColor;
final double strokeWidth;
final String? shape;
final charts.Color? fillColor;
final double? strokeWidth;
LinearSales(this.year, this.sales, this.radius, this.shape, this.fillColor,
this.strokeWidth);

@ -21,10 +21,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class SimpleScatterPlotChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, num>> seriesList;
final bool? animate;
const SimpleScatterPlotChart(this.seriesList, {this.animate, Key key})
const SimpleScatterPlotChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [ScatterPlotChart] with sample data and no transition.

@ -24,10 +24,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class TimeSeriesConfidenceInterval extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, DateTime>> seriesList;
final bool? animate;
const TimeSeriesConfidenceInterval(this.seriesList, {this.animate, Key key})
const TimeSeriesConfidenceInterval(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [TimeSeriesChart] with sample data and no transition.

@ -23,10 +23,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class EndPointsAxisTimeSeriesChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, DateTime>> seriesList;
final bool? animate;
const EndPointsAxisTimeSeriesChart(this.seriesList, {this.animate, Key key})
const EndPointsAxisTimeSeriesChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [TimeSeriesChart] with sample data and no transition.

@ -28,10 +28,10 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class TimeSeriesLineAnnotationChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, DateTime>> seriesList;
final bool? animate;
const TimeSeriesLineAnnotationChart(this.seriesList, {this.animate, Key key})
const TimeSeriesLineAnnotationChart(this.seriesList, {this.animate, Key? key})
: super(key: key);
/// Creates a [TimeSeriesChart] with sample data and no transition.

@ -28,10 +28,11 @@ import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
class TimeSeriesRangeAnnotationChart extends StatelessWidget {
final List<charts.Series> seriesList;
final bool animate;
final List<charts.Series<dynamic, DateTime>> seriesList;
final bool? animate;
const TimeSeriesRangeAnnotationChart(this.seriesList, {this.animate, Key key})
const TimeSeriesRangeAnnotationChart(this.seriesList,
{this.animate, Key? key})
: super(key: key);
/// Creates a [TimeSeriesChart] with sample data and no transition.

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save