buildIconButton method

  1. @protected
Widget buildIconButton(
  1. BuildParameters params
)

Implementation

@protected
Widget buildIconButton(BuildParameters params) {
  Widget icon;
  if (params.widgets["icon"] != null) {
    icon = builder.buildWidget(params.context, params.widgets["icon"],
        params.state, params.parentContext);
  } else {
    icon = Icon(IconData(parseInt(params.props["iconCode"]),
        fontFamily: 'MaterialIcons'));
  }

  return IconButton(
    key: properties.getKey(params.id),
    icon: icon,
    alignment: params.buildProp("alignment") ?? AlignmentDirectional.center,
    padding: params.buildProp("padding") ?? const EdgeInsets.all(8.0),
    iconSize: parseDouble(params.props["iconSize"], defaultValue: 24.0),
    tooltip: params.props["tooltip"] != null
        ? properties.getText(params.props["tooltip"], "label")
        : null,
    color: tryParseColor(params.props["color"]),
    focusColor: tryParseColor(params.props["focusColor"]),
    hoverColor: tryParseColor(params.props["hoverColor"]),
    splashColor: tryParseColor(params.props["splashColor"]),
    highlightColor: tryParseColor(params.props["highlightColor"]),
    disabledColor: tryParseColor(params.props["disabledColor"]),
    style: params.buildProp("style"),
    constraints: params.buildProp("constraints"),
    onPressed: events.getFunction(params.context, params.actions["onPressed"],
        params.state, params.parentContext),
  );
}