Unverified Commit 2adbc2b8 authored by Taha Tesser's avatar Taha Tesser Committed by GitHub

Fix chips constructor docs for callbacks (#143361)

fixes [ActionChip constructor documentation does not match class documentation](https://github.com/flutter/flutter/issues/137964)
parent 8eea4f17
...@@ -81,9 +81,10 @@ enum _ChipVariant { flat, elevated } ...@@ -81,9 +81,10 @@ enum _ChipVariant { flat, elevated }
class ActionChip extends StatelessWidget implements ChipAttributes, TappableChipAttributes, DisabledChipAttributes { class ActionChip extends StatelessWidget implements ChipAttributes, TappableChipAttributes, DisabledChipAttributes {
/// Create a chip that acts like a button. /// Create a chip that acts like a button.
/// ///
/// The [label], [onPressed], [autofocus], and [clipBehavior] arguments must /// The [label], [autofocus], and [clipBehavior] arguments must not be null.
/// not be null. The [pressElevation] and [elevation] must be null or /// When [onPressed] is null, the [ActionChip] will be disabled. The [pressElevation]
/// non-negative. Typically, [pressElevation] is greater than [elevation]. /// and [elevation] must be null or non-negative. Typically, [pressElevation]
/// is greater than [elevation].
const ActionChip({ const ActionChip({
super.key, super.key,
this.avatar, this.avatar,
...@@ -114,9 +115,10 @@ class ActionChip extends StatelessWidget implements ChipAttributes, TappableChip ...@@ -114,9 +115,10 @@ class ActionChip extends StatelessWidget implements ChipAttributes, TappableChip
/// Create an elevated chip that acts like a button. /// Create an elevated chip that acts like a button.
/// ///
/// The [label], [onPressed], [autofocus], and [clipBehavior] arguments must /// The [label], [autofocus], and [clipBehavior] arguments must not be null.
/// not be null. The [pressElevation] and [elevation] must be null or /// When [onPressed] is null, the [ActionChip] will be disabled. The [pressElevation]
/// non-negative. Typically, [pressElevation] is greater than [elevation]. /// and [elevation] must be null or non-negative. Typically, [pressElevation]
/// is greater than [elevation].
const ActionChip.elevated({ const ActionChip.elevated({
super.key, super.key,
this.avatar, this.avatar,
......
...@@ -59,8 +59,9 @@ class ChoiceChip extends StatelessWidget ...@@ -59,8 +59,9 @@ class ChoiceChip extends StatelessWidget
/// Create a chip that acts like a radio button. /// Create a chip that acts like a radio button.
/// ///
/// The [label], [selected], [autofocus], and [clipBehavior] arguments must /// The [label], [selected], [autofocus], and [clipBehavior] arguments must
/// not be null. The [pressElevation] and [elevation] must be null or /// not be null. When [onSelected] is null, the [ChoiceChip] will be disabled.
/// non-negative. Typically, [pressElevation] is greater than [elevation]. /// The [pressElevation] and [elevation] must be null or non-negative. Typically,
/// [pressElevation] is greater than [elevation].
const ChoiceChip({ const ChoiceChip({
super.key, super.key,
this.avatar, this.avatar,
...@@ -98,8 +99,9 @@ class ChoiceChip extends StatelessWidget ...@@ -98,8 +99,9 @@ class ChoiceChip extends StatelessWidget
/// Create an elevated chip that acts like a radio button. /// Create an elevated chip that acts like a radio button.
/// ///
/// The [label], [selected], [autofocus], and [clipBehavior] arguments must /// The [label], [selected], [autofocus], and [clipBehavior] arguments must
/// not be null. The [pressElevation] and [elevation] must be null or /// not be null. When [onSelected] is null, the [ChoiceChip] will be disabled.
/// non-negative. Typically, [pressElevation] is greater than [elevation]. /// The [pressElevation] and [elevation] must be null or non-negative. Typically,
/// [pressElevation] is greater than [elevation].
const ChoiceChip.elevated({ const ChoiceChip.elevated({
super.key, super.key,
this.avatar, this.avatar,
......
...@@ -64,8 +64,9 @@ class FilterChip extends StatelessWidget ...@@ -64,8 +64,9 @@ class FilterChip extends StatelessWidget
/// Create a chip that acts like a checkbox. /// Create a chip that acts like a checkbox.
/// ///
/// The [selected], [label], [autofocus], and [clipBehavior] arguments must /// The [selected], [label], [autofocus], and [clipBehavior] arguments must
/// not be null. The [pressElevation] and [elevation] must be null or /// not be null. When [onSelected] is null, the [FilterChip] will be disabled.
/// non-negative. Typically, [pressElevation] is greater than [elevation]. /// The [pressElevation] and [elevation] must be null or non-negative. Typically,
/// [pressElevation] is greater than [elevation].
const FilterChip({ const FilterChip({
super.key, super.key,
this.avatar, this.avatar,
...@@ -107,8 +108,9 @@ class FilterChip extends StatelessWidget ...@@ -107,8 +108,9 @@ class FilterChip extends StatelessWidget
/// Create an elevated chip that acts like a checkbox. /// Create an elevated chip that acts like a checkbox.
/// ///
/// The [selected], [label], [autofocus], and [clipBehavior] arguments must /// The [selected], [label], [autofocus], and [clipBehavior] arguments must
/// not be null. The [pressElevation] and [elevation] must be null or /// not be null. When [onSelected] is null, the [FilterChip] will be disabled.
/// non-negative. Typically, [pressElevation] is greater than [elevation]. /// The [pressElevation] and [elevation] must be null or non-negative. Typically,
/// [pressElevation] is greater than [elevation].
const FilterChip.elevated({ const FilterChip.elevated({
super.key, super.key,
this.avatar, this.avatar,
......
...@@ -81,7 +81,8 @@ class InputChip extends StatelessWidget ...@@ -81,7 +81,8 @@ class InputChip extends StatelessWidget
/// Creates an [InputChip]. /// Creates an [InputChip].
/// ///
/// The [onPressed] and [onSelected] callbacks must not both be specified at /// 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. /// The [pressElevation] and [elevation] must be null or non-negative.
/// Typically, [pressElevation] is greater than [elevation]. /// Typically, [pressElevation] is greater than [elevation].
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment