change expand icon to use default icon colors (#21328)
This commit is contained in:
@@ -321,6 +321,19 @@ class Colors {
|
|||||||
/// but with different opacities.
|
/// but with different opacities.
|
||||||
static const Color white70 = Color(0xB3FFFFFF);
|
static const Color white70 = Color(0xB3FFFFFF);
|
||||||
|
|
||||||
|
/// White with 54% opacity.
|
||||||
|
///
|
||||||
|
/// 
|
||||||
|
///
|
||||||
|
/// See also:
|
||||||
|
///
|
||||||
|
/// * [ExpandIcon], which uses this color for dark themes.
|
||||||
|
/// * [Theme.of], which allows you to select colors from the current theme
|
||||||
|
/// rather than hard-coding colors in your build methods.
|
||||||
|
/// * [white, white30, white12, white10], which are variants on this color
|
||||||
|
/// but with different opacities.
|
||||||
|
static const Color white54 = Color(0x8AFFFFFF);
|
||||||
|
|
||||||
/// White with 32% opacity.
|
/// White with 32% opacity.
|
||||||
///
|
///
|
||||||
/// Used for disabled radio buttons and the text of disabled flat buttons in dark themes.
|
/// Used for disabled radio buttons and the text of disabled flat buttons in dark themes.
|
||||||
|
|||||||
@@ -110,13 +110,14 @@ class _ExpandIconState extends State<ExpandIcon> with SingleTickerProviderStateM
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
assert(debugCheckHasMaterial(context));
|
assert(debugCheckHasMaterial(context));
|
||||||
final MaterialLocalizations localizations = MaterialLocalizations.of(context);
|
final MaterialLocalizations localizations = MaterialLocalizations.of(context);
|
||||||
|
final ThemeData theme = Theme.of(context);
|
||||||
final String onTapHint = widget.isExpanded ? localizations.expandedIconTapHint : localizations.collapsedIconTapHint;
|
final String onTapHint = widget.isExpanded ? localizations.expandedIconTapHint : localizations.collapsedIconTapHint;
|
||||||
|
|
||||||
return new Semantics(
|
return new Semantics(
|
||||||
onTapHint: widget.onPressed == null ? null : onTapHint,
|
onTapHint: widget.onPressed == null ? null : onTapHint,
|
||||||
child: new IconButton(
|
child: new IconButton(
|
||||||
padding: widget.padding,
|
padding: widget.padding,
|
||||||
color: Colors.black38,
|
color: theme.brightness == Brightness.dark ? Colors.white54 : Colors.black54,
|
||||||
onPressed: widget.onPressed == null ? null : _handlePressed,
|
onPressed: widget.onPressed == null ? null : _handlePressed,
|
||||||
icon: new RotationTransition(
|
icon: new RotationTransition(
|
||||||
turns: _iconTurns,
|
turns: _iconTurns,
|
||||||
|
|||||||
Reference in New Issue
Block a user