Ejemplo n.º 1
0
        public override Widget build(BuildContext context)
        {
            ThemeData       theme       = Theme.of(context);
            ButtonThemeData buttonTheme = ButtonTheme.of(context);

            return(new RawMaterialButton(
                       onPressed: onPressed,
                       onLongPress: () => onLongPress?.Invoke(),
                       onHighlightChanged: onHighlightChanged,
                       fillColor: buttonTheme.getFillColor(this),
                       textStyle: theme.textTheme.button.copyWith(color: buttonTheme.getTextColor(this)),
                       focusColor: buttonTheme.getFocusColor(this),
                       hoverColor: buttonTheme.getHoverColor(this),
                       highlightColor: buttonTheme.getHighlightColor(this),
                       splashColor: buttonTheme.getSplashColor(this),
                       elevation: buttonTheme.getElevation(this),
                       focusElevation: buttonTheme.getFocusElevation(this),
                       hoverElevation: buttonTheme.getHoverElevation(this),
                       highlightElevation: buttonTheme.getHighlightElevation(this),
                       disabledElevation: buttonTheme.getDisabledElevation(this),
                       padding: buttonTheme.getPadding(this),
                       visualDensity: visualDensity ?? theme.visualDensity,
                       constraints: buttonTheme.getConstraints(this),
                       shape: buttonTheme.getShape(this),
                       clipBehavior: clipBehavior ?? Clip.none,
                       focusNode: focusNode,
                       autofocus: autofocus ?? false,
                       materialTapTargetSize: buttonTheme.getMaterialTapTargetSize(this),
                       animationDuration: buttonTheme.getAnimationDuration(this),
                       child: child
                       ));
        }
Ejemplo n.º 2
0
        public override Widget build(BuildContext context)
        {
            ButtonThemeData buttonTheme = ButtonTheme.of(context);

            return(new _OutlineButton(
                       onPressed: onPressed,
                       onLongPress: onLongPress,
                       brightness: buttonTheme.getBrightness(this),
                       textTheme: textTheme,
                       textColor: buttonTheme.getTextColor(this),
                       disabledTextColor: buttonTheme.getDisabledTextColor(this),
                       color: color,
                       focusColor: buttonTheme.getFocusColor(this),
                       hoverColor: buttonTheme.getHoverColor(this),
                       highlightColor: buttonTheme.getHighlightColor(this),
                       splashColor: buttonTheme.getSplashColor(this),
                       highlightElevation: buttonTheme.getHighlightElevation(this),
                       borderSide: borderSide,
                       disabledBorderColor: disabledBorderColor,
                       highlightedBorderColor: highlightedBorderColor ?? buttonTheme.colorScheme.primary,
                       padding: buttonTheme.getPadding(this),
                       visualDensity: visualDensity,
                       shape: buttonTheme.getShape(this),
                       clipBehavior: clipBehavior,
                       focusNode: focusNode,
                       child: child
                       ));
        }