buildByMaterial method

  1. @override
Widget buildByMaterial(
  1. BuildContext context
)

build on material mode

Implementation

@override
Widget buildByMaterial(BuildContext context) {
  final buttonType = valueOf('buttonType', this.buttonType);

  Widget button;

  switch (buttonType) {
    case BaseDialogActionType.filled:
      button = FilledButton(
        onPressed: _handlePressed,
        onLongPress: valueOf('onLongPress', onLongPress),
        style: valueOf('style', style),
        focusNode: valueOf('focusNode', focusNode),
        autofocus: valueOf('autofocus', autofocus),
        clipBehavior: valueOf('clipBehavior', clipBehavior),
        child: valueOf('child', child),
      );
      break;
    case BaseDialogActionType.outlined:
      button = OutlinedButton(
        onPressed: _handlePressed,
        onLongPress: valueOf('onLongPress', onLongPress),
        style: valueOf('style', style),
        focusNode: valueOf('focusNode', focusNode),
        autofocus: valueOf('autofocus', autofocus),
        clipBehavior: valueOf('clipBehavior', clipBehavior),
        child: valueOf('child', child),
      );
      break;
    case BaseDialogActionType.text:
    default:
      button = TextButton(
        onPressed: _handlePressed,
        onLongPress: valueOf('onLongPress', onLongPress),
        style: valueOf('style', style),
        focusNode: valueOf('focusNode', focusNode),
        autofocus: valueOf('autofocus', autofocus),
        clipBehavior: valueOf('clipBehavior', clipBehavior),
        child: valueOf('child', child),
      );
      break;
  }

  if (valueOf('enableLiquidGlass', enableLiquidGlass)) {
    return _wrapWithLiquidGlass(context, button);
  }

  return button;
}