import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

ButtonStyle baseTextButtonStyle({double? radius, Color? bgColor}) {
  return ButtonStyle(
    padding: MaterialStateProperty.all(EdgeInsets.zero),
    tapTargetSize: MaterialTapTargetSize.shrinkWrap,
    backgroundColor: MaterialStateProperty.all(bgColor ?? Colors.white),
    overlayColor: MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) {
      if (states.contains(MaterialState.pressed)) return Colors.black12;
      return Colors.transparent;
    }),
    shape: MaterialStateProperty.all(
      RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(radius ?? 22).r,
      ),
    ),
  );
}
