public EdgeInsetsGeometry getPadding(MaterialButton button) { if (button.padding != null) { return(button.padding); } if (button is MaterialButtonWithIconMixin) { return(EdgeInsets.fromLTRB(12.0f, 0.0f, 16.0f, 0.0f)); } if (_padding != null) { return(_padding); } switch (getTextTheme(button)) { case ButtonTextTheme.normal: case ButtonTextTheme.accent: return(EdgeInsets.symmetric(horizontal: 16.0f)); case ButtonTextTheme.primary: return(EdgeInsets.symmetric(horizontal: 24.0f)); } D.assert(false); return(EdgeInsets.zero); }
public Color getSplashColor(MaterialButton button) { if (button.splashColor != null) { return(button.splashColor); } if (_splashColor != null && (button is RaisedButton || button is OutlineButton)) { return(_splashColor); } if (_splashColor != null && button is FlatButton) { switch (getTextTheme(button)) { case ButtonTextTheme.normal: case ButtonTextTheme.accent: return(_splashColor); case ButtonTextTheme.primary: break; } } return(getTextColor(button).withOpacity(0.12f)); }
public Color getFillColor(MaterialButton button) { Color fillColor = button.enabled ? button.color : button.disabledColor; if (fillColor != null) { return(fillColor); } if (button is FlatButton || button is OutlineButton || button.GetType() == typeof(MaterialButton)) { return(null); } if (button.enabled && button is RaisedButton && _buttonColor != null) { return(_buttonColor); } switch (getTextTheme(button)) { case ButtonTextTheme.normal: case ButtonTextTheme.accent: return(button.enabled ? colorScheme.primary : getDisabledFillColor(button)); case ButtonTextTheme.primary: return(button.enabled ? _buttonColor ?? colorScheme.primary : colorScheme.onSurface.withOpacity(0.12f)); } D.assert(false); return(null); }
public Color getSplashColor(MaterialButton button) { if (button.splashColor != null) { return(button.splashColor); } //todo:xingwei.zhu: uncomment these when OutlineButton is ready if (this._splashColor != null && (button is RaisedButton /* || button is OutlineButton*/)) { return(this._splashColor); } if (this._splashColor != null && button is FlatButton) { switch (this.getTextTheme(button)) { case ButtonTextTheme.normal: case ButtonTextTheme.accent: return(this._splashColor); case ButtonTextTheme.primary: break; } } return(this.getTextColor(button).withOpacity(0.12)); }
public float getDisabledElevation(MaterialButton button) { if (button.disabledElevation != null) { return(button.disabledElevation ?? 0.0f); } return(0.0f); }
public Color getDisabledTextColor(MaterialButton button) { if (button.disabledTextColor != null) { return(button.disabledTextColor); } return(this._getDisabledColor(button)); }
public Color getDisabledTextColor(MaterialButton button) { if (button.textColor is IMaterialStateProperty <Color> ) { return(button.textColor); } if (button.disabledTextColor != null) { return(button.disabledTextColor); } return(colorScheme.onSurface.withOpacity(0.38f)); }
public float getElevation(MaterialButton button) { if (button.elevation != null) { return(button.elevation ?? 0.0f); } if (button is FlatButton) { return(0.0f); } return(2.0f); }
Color getDisabledFillColor(MaterialButton button) { if (button.disabledColor != null) { return(button.disabledColor); } if (_disabledColor != null) { return(_disabledColor); } return(colorScheme.onSurface.withOpacity(0.38f)); }
Color getDisabledFillColor(MaterialButton button) { if (button.disabledColor != null) { return(button.disabledColor); } if (this._disabledColor != null) { return(this._disabledColor); } return(this._getDisabledColor(button)); }
public float getHoverElevation(MaterialButton button) { if (button.hoverElevation != null) { return(button.hoverElevation.Value); } if (button is FlatButton) { return(0.0f); } if (button is OutlineButton) { return(0.0f); } return(4.0f); }
public double getHighlightElevation(MaterialButton button) { if (button.highlightElevation != null) { return(button.highlightElevation ?? 0.0); } if (button is FlatButton) { return(0.0); } //todo:xingwei.zhu: uncomment these when OutlineButton are ready // if (button is OutlineButton) // return 2.0; return(8.0); }
public float getHighlightElevation(MaterialButton button) { if (button.highlightElevation != null) { return(button.highlightElevation ?? 0.0f); } if (button is FlatButton) { return(0.0f); } if (button is OutlineButton) { return(2.0f); } return(8.0f); }
public Color getTextColor(MaterialButton button) { if (!button.enabled) { return(this.getDisabledTextColor(button)); } if (button.textColor != null) { return(button.textColor); } switch (this.getTextTheme(button)) { case ButtonTextTheme.normal: return(this.getBrightness(button) == Brightness.dark ? Colors.white : Colors.black87); case ButtonTextTheme.accent: return(this.colorScheme.secondary); case ButtonTextTheme.primary: { Color fillColor = this.getFillColor(button); bool fillIsDark = fillColor != null ? ThemeData.estimateBrightnessForColor(fillColor) == Brightness.dark : this.getBrightness(button) == Brightness.dark; if (fillIsDark) { return(Colors.white); } //todo:xingwei.zhu: uncomment these when OutlineButton are ready if (button is FlatButton /* || button is OutlineButton*/) { return(this.colorScheme.primary); } return(Colors.black); } } D.assert(false); return(null); }
public Color getTextColor(MaterialButton button) { if (!button.enabled) { return(getDisabledTextColor(button)); } if (button.textColor != null) { return(button.textColor); } switch (getTextTheme(button)) { case ButtonTextTheme.normal: return(getBrightness(button) == Brightness.dark ? Colors.white : Colors.black87); case ButtonTextTheme.accent: return(colorScheme.secondary); case ButtonTextTheme.primary: { Color fillColor = getFillColor(button); bool fillIsDark = fillColor != null ? ThemeData.estimateBrightnessForColor(fillColor) == Brightness.dark : getBrightness(button) == Brightness.dark; if (fillIsDark) { return(Colors.white); } if (button is FlatButton || button is OutlineButton) { return(colorScheme.primary); } return(Colors.black); } } D.assert(false); return(null); }
public Color getHighlightColor(MaterialButton button) { if (button.highlightColor != null) { return(button.highlightColor); } switch (getTextTheme(button)) { case ButtonTextTheme.normal: case ButtonTextTheme.accent: return(_highlightColor ?? getTextColor(button).withOpacity(0.16f)); case ButtonTextTheme.primary: return(Colors.transparent); } D.assert(false); return(Colors.transparent); }
public Color getFillColor(MaterialButton button) { Color fillColor = button.enabled ? button.color : button.disabledColor; if (fillColor != null) { return(fillColor); } //todo:xingwei.zhu: uncomment these when OutlineButton are ready if (button is FlatButton /* || button is OutlineButton*/) { return(null); } if (button.enabled && button is RaisedButton && this._buttonColor != null) { return(this._buttonColor); } switch (this.getTextTheme(button)) { case ButtonTextTheme.normal: case ButtonTextTheme.accent: return(button.enabled ? this.colorScheme.primary : this.getDisabledFillColor(button)); case ButtonTextTheme.primary: return(button.enabled ? this._buttonColor ?? this.colorScheme.primary : this.colorScheme.onSurface.withOpacity(0.12)); } D.assert(false); return(null); }
public BoxConstraints getConstraints(MaterialButton button) { return(constraints); }
public MaterialTapTargetSize getMaterialTapTargetSize(MaterialButton button) { return(button.materialTapTargetSize ?? _materialTapTargetSize ?? MaterialTapTargetSize.padded); }
public ShapeBorder getShape(MaterialButton button) { return(button.shape ?? shape); }
public TimeSpan getAnimationDuration(MaterialButton button) { return(button.animationDuration ?? material_.kThemeChangeDuration); }
Color _getDisabledColor(MaterialButton button) { return(this.getBrightness(button) == Brightness.dark ? this.colorScheme.onSurface.withOpacity(0.30f) : this.colorScheme.onSurface.withOpacity(0.38f)); }
public Brightness getBrightness(MaterialButton button) { return(button.colorBrightness ?? colorScheme.brightness); }
public ButtonTextTheme getTextTheme(MaterialButton button) { return(button.textTheme ?? textTheme); }
public Color getFocusColor(MaterialButton button) { return(button.focusColor ?? _focusColor ?? getTextColor(button).withOpacity(0.12f)); }
public Color getHoverColor(MaterialButton button) { return(button.hoverColor ?? _hoverColor ?? getTextColor(button).withOpacity(0.04f)); }