buildSelectItem method

Widget buildSelectItem({
  1. required BoxDecoration decoration,
  2. double? height,
  3. bool isSelected = false,
  4. Color textColor = Colors.white,
  5. double? textSize,
  6. GestureTapCallback? onTap,
  7. EdgeInsetsGeometry? padding,
})

Implementation

Widget buildSelectItem(
    {required BoxDecoration decoration,
    double? height,
    bool isSelected = false,
    Color textColor = Colors.white,
    double? textSize,
    GestureTapCallback? onTap,
    EdgeInsetsGeometry? padding}) {
  return Material(
    color: Colors.transparent,
    child: Ink(
      decoration: decoration,
      child: InkWell(
        onTap: () => onTap?.call(),
        child: Container(
          height: height ?? 32.h,
          padding: padding ?? EdgeInsets.symmetric(horizontal: 32.h),
          child: Row(
            mainAxisSize: MainAxisSize.min,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              Container(
                constraints: BoxConstraints(maxWidth: 100.w),
                child: Text(this,
                    textAlign: TextAlign.center,
                    maxLines: 1,
                    overflow: TextOverflow.ellipsis,
                    style: TextStyle(fontSize: textSize ?? 14.sp, color: textColor)),
              )
            ],
          ),
        ),
      ),
    ),
  );
}