diff --git a/packages/flutter/lib/src/material/action_chip.dart b/packages/flutter/lib/src/material/action_chip.dart index e6d9b33b91b..870f4d0e1a6 100644 --- a/packages/flutter/lib/src/material/action_chip.dart +++ b/packages/flutter/lib/src/material/action_chip.dart @@ -81,9 +81,10 @@ enum _ChipVariant { flat, elevated } class ActionChip extends StatelessWidget implements ChipAttributes, TappableChipAttributes, DisabledChipAttributes { /// Create a chip that acts like a button. /// - /// The [label], [onPressed], [autofocus], and [clipBehavior] arguments must - /// not be null. The [pressElevation] and [elevation] must be null or - /// non-negative. Typically, [pressElevation] is greater than [elevation]. + /// The [label], [autofocus], and [clipBehavior] arguments must not be null. + /// When [onPressed] is null, the [ActionChip] will be disabled. The [pressElevation] + /// and [elevation] must be null or non-negative. Typically, [pressElevation] + /// is greater than [elevation]. const ActionChip({ super.key, this.avatar, @@ -114,9 +115,10 @@ class ActionChip extends StatelessWidget implements ChipAttributes, TappableChip /// Create an elevated chip that acts like a button. /// - /// The [label], [onPressed], [autofocus], and [clipBehavior] arguments must - /// not be null. The [pressElevation] and [elevation] must be null or - /// non-negative. Typically, [pressElevation] is greater than [elevation]. + /// The [label], [autofocus], and [clipBehavior] arguments must not be null. + /// When [onPressed] is null, the [ActionChip] will be disabled. The [pressElevation] + /// and [elevation] must be null or non-negative. Typically, [pressElevation] + /// is greater than [elevation]. const ActionChip.elevated({ super.key, this.avatar, diff --git a/packages/flutter/lib/src/material/choice_chip.dart b/packages/flutter/lib/src/material/choice_chip.dart index 2f7d384b276..8db24000cee 100644 --- a/packages/flutter/lib/src/material/choice_chip.dart +++ b/packages/flutter/lib/src/material/choice_chip.dart @@ -59,8 +59,9 @@ class ChoiceChip extends StatelessWidget /// Create a chip that acts like a radio button. /// /// The [label], [selected], [autofocus], and [clipBehavior] arguments must - /// not be null. The [pressElevation] and [elevation] must be null or - /// non-negative. Typically, [pressElevation] is greater than [elevation]. + /// not be null. When [onSelected] is null, the [ChoiceChip] will be disabled. + /// The [pressElevation] and [elevation] must be null or non-negative. Typically, + /// [pressElevation] is greater than [elevation]. const ChoiceChip({ super.key, this.avatar, @@ -98,8 +99,9 @@ class ChoiceChip extends StatelessWidget /// Create an elevated chip that acts like a radio button. /// /// The [label], [selected], [autofocus], and [clipBehavior] arguments must - /// not be null. The [pressElevation] and [elevation] must be null or - /// non-negative. Typically, [pressElevation] is greater than [elevation]. + /// not be null. When [onSelected] is null, the [ChoiceChip] will be disabled. + /// The [pressElevation] and [elevation] must be null or non-negative. Typically, + /// [pressElevation] is greater than [elevation]. const ChoiceChip.elevated({ super.key, this.avatar, diff --git a/packages/flutter/lib/src/material/filter_chip.dart b/packages/flutter/lib/src/material/filter_chip.dart index 289a6e5c7e3..19f623456c1 100644 --- a/packages/flutter/lib/src/material/filter_chip.dart +++ b/packages/flutter/lib/src/material/filter_chip.dart @@ -64,8 +64,9 @@ class FilterChip extends StatelessWidget /// Create a chip that acts like a checkbox. /// /// The [selected], [label], [autofocus], and [clipBehavior] arguments must - /// not be null. The [pressElevation] and [elevation] must be null or - /// non-negative. Typically, [pressElevation] is greater than [elevation]. + /// not be null. When [onSelected] is null, the [FilterChip] will be disabled. + /// The [pressElevation] and [elevation] must be null or non-negative. Typically, + /// [pressElevation] is greater than [elevation]. const FilterChip({ super.key, this.avatar, @@ -107,8 +108,9 @@ class FilterChip extends StatelessWidget /// Create an elevated chip that acts like a checkbox. /// /// The [selected], [label], [autofocus], and [clipBehavior] arguments must - /// not be null. The [pressElevation] and [elevation] must be null or - /// non-negative. Typically, [pressElevation] is greater than [elevation]. + /// not be null. When [onSelected] is null, the [FilterChip] will be disabled. + /// The [pressElevation] and [elevation] must be null or non-negative. Typically, + /// [pressElevation] is greater than [elevation]. const FilterChip.elevated({ super.key, this.avatar, diff --git a/packages/flutter/lib/src/material/input_chip.dart b/packages/flutter/lib/src/material/input_chip.dart index dfe3fe2bfda..8f21484f5a2 100644 --- a/packages/flutter/lib/src/material/input_chip.dart +++ b/packages/flutter/lib/src/material/input_chip.dart @@ -81,7 +81,8 @@ class InputChip extends StatelessWidget /// Creates an [InputChip]. /// /// The [onPressed] and [onSelected] callbacks must not both be specified at - /// the same time. + /// the same time. When both [onPressed] and [onSelected] are null, the chip + /// will be disabled. /// /// The [pressElevation] and [elevation] must be null or non-negative. /// Typically, [pressElevation] is greater than [elevation].