|
|
|
|
|
|
return buttonTheme; |
|
|
|
} |
|
|
|
|
|
|
|
public override bool updateShouldNotify(InheritedWidget oldWidget) => |
|
|
|
this.data != ((ButtonTheme) oldWidget).data; |
|
|
|
public override bool updateShouldNotify(InheritedWidget oldWidget) { |
|
|
|
return this.data != ((ButtonTheme) oldWidget).data; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public EdgeInsets padding { |
|
|
|
get { |
|
|
|
if (this._padding != null) |
|
|
|
if (this._padding != null) { |
|
|
|
} |
|
|
|
|
|
|
|
switch (this.textTheme) { |
|
|
|
case ButtonTextTheme.normal: |
|
|
|
case ButtonTextTheme.accent: |
|
|
|
|
|
|
|
|
|
|
public ShapeBorder shape { |
|
|
|
get { |
|
|
|
if (this._shape != null) |
|
|
|
if (this._shape != null) { |
|
|
|
} |
|
|
|
|
|
|
|
switch (this.textTheme) { |
|
|
|
case ButtonTextTheme.normal: |
|
|
|
case ButtonTextTheme.accent: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Color getDisabledTextColor(MaterialButton button) { |
|
|
|
if (button.disabledTextColor != null) |
|
|
|
if (button.disabledTextColor != null) { |
|
|
|
} |
|
|
|
|
|
|
|
if (button.disabledColor != null) |
|
|
|
if (button.disabledColor != null) { |
|
|
|
if (this._disabledColor != null) |
|
|
|
} |
|
|
|
|
|
|
|
if (this._disabledColor != null) { |
|
|
|
} |
|
|
|
|
|
|
|
return this._getDisabledColor(button); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
if (fillColor != null) |
|
|
|
if (fillColor != null) { |
|
|
|
} |
|
|
|
|
|
|
|
// todo xingwei.zhu: uncomment these when FlatButton & OutlineButton & RaisedButton are ready
|
|
|
|
// if (button is FlatButton || button is OutlineButton)
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public Color getTextColor(MaterialButton button) { |
|
|
|
if (!button.enabled) |
|
|
|
if (!button.enabled) { |
|
|
|
} |
|
|
|
if (button.textColor != null) |
|
|
|
if (button.textColor != null) { |
|
|
|
} |
|
|
|
|
|
|
|
switch (this.getTextTheme(button)) { |
|
|
|
case ButtonTextTheme.normal: |
|
|
|
|
|
|
bool fillIsDark = fillColor != null |
|
|
|
? ThemeData.estimateBrightnessForColor(fillColor) == Brightness.dark |
|
|
|
: this.getBrightness(button) == Brightness.dark; |
|
|
|
if (fillIsDark) |
|
|
|
if (fillIsDark) { |
|
|
|
} |
|
|
|
|
|
|
|
// todo xingwei.zhu: uncomment these when FlatButton & OutlineButton are ready
|
|
|
|
// if (button is FlatButton || button is OutlineButton)
|
|
|
|
// return this.colorScheme.primary;
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public Color getSplashColor(MaterialButton button) { |
|
|
|
if (button.splashColor != null) |
|
|
|
if (button.splashColor != null) { |
|
|
|
} |
|
|
|
|
|
|
|
// todo xingwei.zhu: uncomment these when FlatButton & OutlineButton & RaisedButton are ready
|
|
|
|
// if (this._splashColor != null && (button is RaisedButton || button is OutlineButton)) {
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public Color getHighlightColor(MaterialButton button) { |
|
|
|
if (button.highlightColor != null) |
|
|
|
if (button.highlightColor != null) { |
|
|
|
} |
|
|
|
|
|
|
|
switch (this.getTextTheme(button)) { |
|
|
|
case ButtonTextTheme.normal: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public double getElevation(MaterialButton button) { |
|
|
|
if (button.elevation != null) |
|
|
|
if (button.elevation != null) { |
|
|
|
} |
|
|
|
|
|
|
|
// todo xingwei.zhu: uncomment these when FlatButton are ready
|
|
|
|
// if (button is FlatButton)
|
|
|
|
// return 0.0;
|
|
|
|
|
|
|
|
|
|
|
public double getHighlightElevation(MaterialButton button) { |
|
|
|
if (button.highlightElevation != null) |
|
|
|
if (button.highlightElevation != null) { |
|
|
|
} |
|
|
|
|
|
|
|
// todo xingwei.zhu: uncomment these when FlatButton & OutlineButton are ready
|
|
|
|
// if (button is FlatButton)
|
|
|
|
// return 0.0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public double getDisabledElevation(MaterialButton button) { |
|
|
|
if (button.disabledElevation != null) |
|
|
|
if (button.disabledElevation != null) { |
|
|
|
} |
|
|
|
|
|
|
|
if (button.padding != null) |
|
|
|
if (button.padding != null) { |
|
|
|
} |
|
|
|
if (this._padding != null) |
|
|
|
if (this._padding != null) { |
|
|
|
} |
|
|
|
|
|
|
|
switch (this.getTextTheme(button)) { |
|
|
|
case ButtonTextTheme.normal: |
|
|
|
|
|
|
return button.animationDuration ?? Constants.kThemeChangeDuration; |
|
|
|
} |
|
|
|
|
|
|
|
public BoxConstraints getConstraints(MaterialButton button) => this.constraints; |
|
|
|
public BoxConstraints getConstraints(MaterialButton button) { |
|
|
|
return this.constraints; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public MaterialTapTargetSize getMaterialTapTargetSize(MaterialButton button) { |
|
|
|