Fix chips constructor docs for callbacks (#143361)

fixes [ActionChip constructor documentation does not match class documentation](https://github.com/flutter/flutter/issues/137964)
This commit is contained in:
Taha Tesser 2024-02-13 21:09:42 +02:00 committed by GitHub
parent 8eea4f175f
commit 2adbc2b8ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 15 deletions

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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].