positiveButton property

Widget? get positiveButton

The (optional) widget for the positive button.

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

Implementation

Widget? get positiveButton => positiveButtonName != null
    ? Container(
        key: positiveButtonKey,
        decoration: BoxDecoration(
          color: positiveButtonBackgroundColor ??
              Theme.of(context).colorScheme.primary,
          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(
          positiveButtonName!,
          overflow: TextOverflow.ellipsis,
          style: positiveButtonStyle ??
              Theme.of(context).textTheme.titleMedium?.copyWith(
                    color: Colors.white,
                  ),
        ),
      )
    : positiveButtonWidget;