negativeButton property

Widget? get negativeButton

The (optional) widget for the negative button.

This getter returns a styled widget for the negative button based on the provided parameters. If negativeButtonName is provided, it creates a default-styled button; otherwise, it uses negativeButtonWidget.

Implementation

Widget? get negativeButton => negativeButtonName != null
    ? Container(
        key: negativeButtonKey,
        decoration: BoxDecoration(
          color: negativeButtonBackgroundColor ??
              Theme.of(context).colorScheme.background,
          borderRadius: BorderRadius.circular(4.0),
          border: Border.all(
            color: positiveButtonBackgroundColor ??
                Theme.of(context).colorScheme.primary,
            width: 1.0,
          ),
        ),
        padding: const EdgeInsets.symmetric(
          vertical: 8.0,
          horizontal: 20.0,
        ),
        child: Text(
          negativeButtonName!,
          overflow: TextOverflow.ellipsis,
          style: negativeButtonStyle ??
              Theme.of(context).textTheme.titleMedium?.copyWith(
                    color: Theme.of(context).primaryColor,
                  ),
        ),
      )
    : negativeButtonWidget;