From 17ddfb1b42f90f1c104e3f67dad1918c39dd8089 Mon Sep 17 00:00:00 2001 From: MH Johnson Date: Tue, 13 Aug 2019 17:36:44 -0400 Subject: [PATCH] make RawChip.selected non-nullable (#37556) --- packages/flutter/lib/src/material/chip.dart | 14 +++++++------- packages/flutter/test/material/chip_test.dart | 16 +++++++++++++++- .../flutter/test/material/chip_theme_test.dart | 5 ++--- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/packages/flutter/lib/src/material/chip.dart b/packages/flutter/lib/src/material/chip.dart index ca321bac12..35b901c4c2 100644 --- a/packages/flutter/lib/src/material/chip.dart +++ b/packages/flutter/lib/src/material/chip.dart @@ -1285,8 +1285,8 @@ class RawChip extends StatefulWidget /// The [onPressed] and [onSelected] callbacks must not both be specified at /// the same time. /// - /// The [label], [isEnabled], and [clipBehavior] arguments must not be null. - /// The [pressElevation] and [elevation] must be null or non-negative. + /// The [label], [isEnabled], [selected], and [clipBehavior] arguments must + /// not be null. The [pressElevation] and [elevation] must be null or non-negative. /// Typically, [pressElevation] is greater than [elevation]. const RawChip({ Key key, @@ -1303,7 +1303,7 @@ class RawChip extends StatefulWidget this.onSelected, this.pressElevation, this.tapEnabled = true, - this.selected, + this.selected = false, this.showCheckmark = true, this.isEnabled = true, this.disabledColor, @@ -1319,6 +1319,7 @@ class RawChip extends StatefulWidget this.avatarBorder = const CircleBorder(), }) : assert(label != null), assert(isEnabled != null), + assert(selected != null), assert(clipBehavior != null), assert(pressElevation == null || pressElevation >= 0.0), assert(elevation == null || elevation >= 0.0), @@ -1430,7 +1431,7 @@ class _RawChipState extends State with TickerProviderStateMixin with TickerProviderStateMixin with TickerProviderStateMixin(effectiveLabelStyle?.color, _states); @@ -1665,7 +1665,7 @@ class _RawChipState extends State with TickerProviderStateMixin