buildElevatedButton method

Widget buildElevatedButton(
  1. BuildContext context,
  2. OwlnextButtonState state
)

Build the button as a flutter native Elevated button

Implementation

Widget buildElevatedButton(BuildContext context, OwlnextButtonState state) {
  return ElevatedButton(
      style: ElevatedButton.styleFrom(
        minimumSize: state.buttonMinimumSize,
        padding: state.widget.padding,
        foregroundColor: Colors.white,
        backgroundColor: getBackground(context, state),
        shape: RoundedRectangleBorder(
          borderRadius: Artist().defaultBorderRadius,
        ),
        disabledForegroundColor: Colors.white.withOpacity(0.4),
        disabledBackgroundColor: const Color.fromARGB(255, 65, 65, 65).withOpacity(0.4),
        alignment: Alignment.center,
      ),
      onPressed: (state.isProcessing == true || state.widget.enabled == false)
          ? null
          : () {
              state.makeCallback();
            },
      child: state.isProcessing
          ? Align(
              child: OwlnextLoading(
                useTwistedDots: true,
                leftDotColorOverride: state.widget.leftDotColorOverride,
                rightDotColorOverride: state.widget.rightDotColorOverride,
                size: state.widget.loaderSize,
              ),
            )
          : state.widget.child);
}