responsiveButton static method

Widget responsiveButton(
  1. BuildContext context, {
  2. required Widget child,
  3. required VoidCallback onTap,
  4. double height = 48,
  5. double horizontalPadding = 16,
})

Implementation

static Widget responsiveButton(
    BuildContext context, {
      required Widget child,
      required VoidCallback onTap,
      double height = 48,
      double horizontalPadding = 16,
    }) {
  return SizedBox(
    height: height.h(context),
    child: ElevatedButton(
      onPressed: onTap,
      style: ElevatedButton.styleFrom(
        padding: EdgeInsets.symmetric(
            horizontal: horizontalPadding.s(context)),
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(8.r(context)),
        ),
      ),
      child: child,
    ),
  );
}