BaseButton class

BaseButton use CupertinoButton or CupertinoButton.filled by cupertino *** use cupertino = { forceUseMaterial: true } force use MaterialButton or FlatButton or OutlineButton or RaisedButton on cuperitno. use MaterialButton or FlatButton or OutlineButton or RaisedButton by material *** use material = { forceUseCupertino: true } force use CupertinoButton or CupertinoButton.filled on material.

Inheritance

Constructors

BaseButton({Key baseKey, Key key, Color color, VoidCallback onPressed, Color disabledColor, EdgeInsetsGeometry padding, Widget child, double minSize = 44.0, double pressedOpacity = 0.1, BorderRadius borderRadius = const BorderRadius.all(Radius.circular(8.0)), bool filled = false, VoidCallback onLongPress, ValueChanged<bool> onHighlightChanged, ButtonTextTheme textTheme, Color textColor, Color disabledTextColor, Color focusColor, Color hoverColor, Color highlightColor, Color splashColor, Brightness colorBrightness, double elevation, double focusElevation, double highlightElevation, double disabledElevation, VisualDensity visualDensity, ShapeBorder shape, Clip clipBehavior = Clip.none, FocusNode focusNode, bool autofocus = false, MaterialTapTargetSize materialTapTargetSize, Duration animationDuration, double minWidth, double height = 48.0, bool flat = false, bool outline = false, BorderSide borderSide, Color disabledBorderColor, Color highlightedBorderColor, bool raised = false, Map<String, Object> cupertino, Map<String, Object> material})
const
BaseButton.icon({Key baseKey, Key key, Color color, VoidCallback onPressed, Color disabledColor, EdgeInsetsGeometry padding, double minSize = 44.0, double pressedOpacity = 0.4, BorderRadius borderRadius = const BorderRadius.all(Radius.circular(8.0)), bool filled = false, VoidCallback onLongPress, ValueChanged<bool> onHighlightChanged, ButtonTextTheme textTheme, Color textColor, Color disabledTextColor, Color focusColor, Color hoverColor, Color highlightColor, Color splashColor, Brightness colorBrightness, double elevation, double focusElevation, double highlightElevation, double disabledElevation, VisualDensity visualDensity, ShapeBorder shape, Clip clipBehavior = Clip.none, FocusNode focusNode, bool autofocus = false, MaterialTapTargetSize materialTapTargetSize, Duration animationDuration, double minWidth, double height = 48.0, bool flat = false, bool outline = false, BorderSide borderSide, Color disabledBorderColor, Color highlightedBorderColor, bool raised = false, @required Widget icon, Widget label, double interval = 8.0, Map<String, dynamic> cupertino, Map<String, dynamic> material})
CupertinoButton, child is Row(children:icon, label) or MaterialButton, child is Row(children:icon, label) or FlatButton.icon or OutlineButton.icon or RaisedButton.icon

Properties

animationDuration Duration
MaterialButton.animationDuration
final
autofocus bool
MaterialButton.autofocus
final
borderRadius BorderRadius
CupertinoButton.borderRadius
final
borderSide BorderSide
OutlineButton.borderSide
final
child Widget
CupertinoButton.child or MaterialButton.child
final
clipBehavior Clip
MaterialButton.clipBehavior
final
color Color
CupertinoButton.color or MaterialButton.color
final
colorBrightness Brightness
MaterialButton.colorBrightness
final
cupertino Map<String, dynamic>
final, inherited
disabledBorderColor Color
OutlineButton.disabledBorderColor
final
disabledColor Color
CupertinoButton.disabledColor or MaterialButton.disabledColor
final
disabledElevation double
MaterialButton.disabledElevation
final
disabledTextColor Color
MaterialButton.disabledTextColor
final
elevation double
MaterialButton.elevation
final
filled bool
CupertinoButton.filled use CupertinoButton.filled, will ignore the color, use primary color.
final
flat bool
FlatButton use FlatButton
final
focusColor Color
MaterialButton.focusColor
final
focusElevation double
MaterialButton.focusElevation
final
focusNode FocusNode
MaterialButton.focusNode
final
hashCode int
The hash code for this object. [...]
@nonVirtual, read-only, inherited
height double
MaterialButton.height
final
highlightColor Color
MaterialButton.highlightColor
final
highlightedBorderColor Color
OutlineButton.highlightedBorderColor
final
highlightElevation double
MaterialButton.highlightElevation
final
hoverColor Color
MaterialButton.hoverColor
final
key Key
*** general properties start ***
final
material Map<String, dynamic>
final, inherited
materialTapTargetSize MaterialTapTargetSize
MaterialButton.materialTapTargetSize
final
minSize double
*** general properties end *** *** cupertino properties start *** CupertinoButton.minSize
final
minWidth double
MaterialButton.minWidth
final
onHighlightChanged ValueChanged<bool>
MaterialButton.onHighlightChanged
final
onLongPress VoidCallback
*** cupertino properties ened *** *** material properties start *** MaterialButton.onLongPress
final
onPressed VoidCallback
CupertinoButton.onPressed or MaterialButton.onPressed
final
outline bool
OutlineButton use OutlineButton
final
padding EdgeInsetsGeometry
CupertinoButton.padding or MaterialButton.padding
final
pressedOpacity double
CupertinoButton.pressedOpacity
final
raised bool
RaisedButton use RaisedButton
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
shape ShapeBorder
MaterialButton.shape
final
splashColor Color
MaterialButton.splashColor
final
textColor Color
MaterialButton.textColor
final
textTheme ButtonTextTheme
MaterialButton.textTheme
final
visualDensity VisualDensity
MaterialButton.visualDensity
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget. [...]
inherited
buildBefore(BuildContext context) → void
build之前调用
inherited
buildByCupertino(BuildContext context) Widget
*** material properties end ***
override
buildByCupertinoBefore(BuildContext context) → void
buildByCupertino之前调用
inherited
buildByMaterial(BuildContext context) Widget
build on material mode
override
buildByMaterialBefore(BuildContext context) → void
buildByMaterial之前调用
inherited
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree. [...]
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children. [...]
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toDiagnosticsNode({String name, DiagnosticsTreeStyle style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep. [...]
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object. [...]
inherited
toStringDeep({String prefixLineOne = '', String prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants. [...]
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object. [...]
inherited
toStringShort() String
A short, textual description of this widget.
inherited
valueFromCupertino(String key, dynamic value) → dynamic
从cupertino获取key对应的值, 如果为null取value的值, 如果还是null则取material里的值
inherited
valueFromMap(Map<String, dynamic> map, String key, dynamic value) → dynamic
从cupertino获取key对应的值, 如果为null取value的值, 如果还是null则取material里的值
inherited
valueFromMaterial(String key, dynamic value) → dynamic
从material获取key对应的值, 如果为null取value的值, 如果还是null则取cupertino里的值
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
@nonVirtual, inherited