widget method

Widget widget(
  1. BuildContext context
)
override

Implementation

widget(context) {
  switch (variant) {
    case _NikuIconButtonVariant.outlined:
      return IconButton.outlined(
        icon: child ?? SizedBox.shrink(),
        onPressed: onPressed ?? null,
        iconSize: iconSize ?? 24,
        visualDensity: visualDensity,
        padding: padding?.value != EdgeInsets.all(8.0)
            ? padding?.value ?? EdgeInsets.all(8.0)
            : const EdgeInsets.all(8.0),
        alignment: alignment ?? Alignment.center,
        splashRadius: splashRadius,
        color: color,
        focusColor: focusColor,
        hoverColor: hoverColor,
        highlightColor: highlightColor,
        splashColor: splashColor,
        disabledColor: disabledColor,
        mouseCursor: mouseCursor ?? SystemMouseCursors.click,
        focusNode: focusNode,
        autofocus: autofocus ?? false,
        tooltip: tooltip,
        enableFeedback: enableFeedback ?? true,
        constraints: constraints?.value,
      );

    case _NikuIconButtonVariant.filledTonal:
      return IconButton.filledTonal(
        icon: child ?? SizedBox.shrink(),
        onPressed: onPressed ?? null,
        iconSize: iconSize ?? 24,
        visualDensity: visualDensity,
        padding: padding?.value != EdgeInsets.all(8.0)
            ? padding?.value ?? EdgeInsets.all(8.0)
            : const EdgeInsets.all(8.0),
        alignment: alignment ?? Alignment.center,
        splashRadius: splashRadius,
        color: color,
        focusColor: focusColor,
        hoverColor: hoverColor,
        highlightColor: highlightColor,
        splashColor: splashColor,
        disabledColor: disabledColor,
        mouseCursor: mouseCursor ?? SystemMouseCursors.click,
        focusNode: focusNode,
        autofocus: autofocus ?? false,
        tooltip: tooltip,
        enableFeedback: enableFeedback ?? true,
        constraints: constraints?.value,
      );

    case _NikuIconButtonVariant.filled:
      return IconButton.filled(
        icon: child ?? SizedBox.shrink(),
        onPressed: onPressed ?? null,
        iconSize: iconSize ?? 24,
        visualDensity: visualDensity,
        padding: padding?.value != EdgeInsets.all(8.0)
            ? padding?.value ?? EdgeInsets.all(8.0)
            : const EdgeInsets.all(8.0),
        alignment: alignment ?? Alignment.center,
        splashRadius: splashRadius,
        color: color,
        focusColor: focusColor,
        hoverColor: hoverColor,
        highlightColor: highlightColor,
        splashColor: splashColor,
        disabledColor: disabledColor,
        mouseCursor: mouseCursor ?? SystemMouseCursors.click,
        focusNode: focusNode,
        autofocus: autofocus ?? false,
        tooltip: tooltip,
        enableFeedback: enableFeedback ?? true,
        constraints: constraints?.value,
      );

    default:
      return IconButton(
        icon: child ?? SizedBox.shrink(),
        onPressed: onPressed ?? null,
        iconSize: iconSize ?? 24,
        visualDensity: visualDensity,
        padding: padding?.value != EdgeInsets.all(8.0)
            ? padding?.value ?? EdgeInsets.all(8.0)
            : const EdgeInsets.all(8.0),
        alignment: alignment ?? Alignment.center,
        splashRadius: splashRadius,
        color: color,
        focusColor: focusColor,
        hoverColor: hoverColor,
        highlightColor: highlightColor,
        splashColor: splashColor,
        disabledColor: disabledColor,
        mouseCursor: mouseCursor ?? SystemMouseCursors.click,
        focusNode: focusNode,
        autofocus: autofocus ?? false,
        tooltip: tooltip,
        enableFeedback: enableFeedback ?? true,
        constraints: constraints?.value,
      );
  }
}