buildBtn method

Widget buildBtn({
  1. Key? key,
  2. required Widget child,
  3. EdgeInsetsGeometry? margin,
  4. BoxDecoration? boxDecoration,
  5. Color? bgColor,
  6. GestureTapCallback? onTap,
})

Implementation

Widget buildBtn(
    {Key? key,
    required Widget child,
    EdgeInsetsGeometry? margin,
    BoxDecoration? boxDecoration,
    Color? bgColor,
    GestureTapCallback? onTap}) {
  return Material(
    key: key,
    color: Colors.transparent,
    child: Container(
      margin: margin ?? const EdgeInsets.only(),
      child: Ink(
          decoration: boxDecoration ??
              BoxDecoration(borderRadius: BorderRadius.circular(0.h), color: bgColor ?? Colors.white),
          child: InkWell(
            onTap: this
                ? () {
                    onTap?.call();
                  }
                : null,
            borderRadius: (boxDecoration?.borderRadius ?? BorderRadius.circular(0.h)) as BorderRadius,
            child: child,
          )),
    ),
  );
}