Unverified Commit 5e506aeb authored by Qun Cheng's avatar Qun Cheng Committed by GitHub

Add missing parameters to `SwitchListTile` (#120115)

* Add missing parameters to SwitchListTile

* Update SwitchListTile doc

* Update doc for existing APIs

* Address comment

* Fix typo

---------
Co-authored-by: 's avatarQun Cheng <quncheng@google.com>
parent 99961267
...@@ -197,7 +197,9 @@ class Switch extends StatelessWidget { ...@@ -197,7 +197,9 @@ class Switch extends StatelessWidget {
/// ``` /// ```
final ValueChanged<bool>? onChanged; final ValueChanged<bool>? onChanged;
/// {@template flutter.material.switch.activeColor}
/// The color to use when this switch is on. /// The color to use when this switch is on.
/// {@endtemplate}
/// ///
/// Defaults to [ColorScheme.secondary]. /// Defaults to [ColorScheme.secondary].
/// ///
...@@ -205,7 +207,9 @@ class Switch extends StatelessWidget { ...@@ -205,7 +207,9 @@ class Switch extends StatelessWidget {
/// state, it will be used instead of this color. /// state, it will be used instead of this color.
final Color? activeColor; final Color? activeColor;
/// {@template flutter.material.switch.activeTrackColor}
/// The color to use on the track when this switch is on. /// The color to use on the track when this switch is on.
/// {@endtemplate}
/// ///
/// Defaults to [ColorScheme.secondary] with the opacity set at 50%. /// Defaults to [ColorScheme.secondary] with the opacity set at 50%.
/// ///
...@@ -215,7 +219,9 @@ class Switch extends StatelessWidget { ...@@ -215,7 +219,9 @@ class Switch extends StatelessWidget {
/// state, it will be used instead of this color. /// state, it will be used instead of this color.
final Color? activeTrackColor; final Color? activeTrackColor;
/// {@template flutter.material.switch.inactiveThumbColor}
/// The color to use on the thumb when this switch is off. /// The color to use on the thumb when this switch is off.
/// {@endtemplate}
/// ///
/// Defaults to the colors described in the Material design specification. /// Defaults to the colors described in the Material design specification.
/// ///
...@@ -225,7 +231,9 @@ class Switch extends StatelessWidget { ...@@ -225,7 +231,9 @@ class Switch extends StatelessWidget {
/// used instead of this color. /// used instead of this color.
final Color? inactiveThumbColor; final Color? inactiveThumbColor;
/// {@template flutter.material.switch.inactiveTrackColor}
/// The color to use on the track when this switch is off. /// The color to use on the track when this switch is off.
/// {@endtemplate}
/// ///
/// Defaults to the colors described in the Material design specification. /// Defaults to the colors described in the Material design specification.
/// ///
...@@ -235,22 +243,30 @@ class Switch extends StatelessWidget { ...@@ -235,22 +243,30 @@ class Switch extends StatelessWidget {
/// used instead of this color. /// used instead of this color.
final Color? inactiveTrackColor; final Color? inactiveTrackColor;
/// {@template flutter.material.switch.activeThumbImage}
/// An image to use on the thumb of this switch when the switch is on. /// An image to use on the thumb of this switch when the switch is on.
/// {@endtemplate}
/// ///
/// Ignored if this switch is created with [Switch.adaptive]. /// Ignored if this switch is created with [Switch.adaptive].
final ImageProvider? activeThumbImage; final ImageProvider? activeThumbImage;
/// {@template flutter.material.switch.onActiveThumbImageError}
/// An optional error callback for errors emitted when loading /// An optional error callback for errors emitted when loading
/// [activeThumbImage]. /// [activeThumbImage].
/// {@endtemplate}
final ImageErrorListener? onActiveThumbImageError; final ImageErrorListener? onActiveThumbImageError;
/// {@template flutter.material.switch.inactiveThumbImage}
/// An image to use on the thumb of this switch when the switch is off. /// An image to use on the thumb of this switch when the switch is off.
/// {@endtemplate}
/// ///
/// Ignored if this switch is created with [Switch.adaptive]. /// Ignored if this switch is created with [Switch.adaptive].
final ImageProvider? inactiveThumbImage; final ImageProvider? inactiveThumbImage;
/// {@template flutter.material.switch.onInactiveThumbImageError}
/// An optional error callback for errors emitted when loading /// An optional error callback for errors emitted when loading
/// [inactiveThumbImage]. /// [inactiveThumbImage].
/// {@endtemplate}
final ImageErrorListener? onInactiveThumbImageError; final ImageErrorListener? onInactiveThumbImageError;
/// {@template flutter.material.switch.thumbColor} /// {@template flutter.material.switch.thumbColor}
......
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