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

class MyCell extends StatelessWidget {
  final Widget head;
  final Widget body;
  final Widget? action;
  final GestureTapCallback? onClick;

  const MyCell(
      {Key? key,
      required this.head,
      required this.body,
      this.action,
      this.onClick})
      : super(key: key);
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onClick,
      child: Container(
        margin: EdgeInsets.fromLTRB(0, 0, 0, 1.h),
        padding: EdgeInsets.symmetric(horizontal: 17.5.w, vertical: 19.h),
        decoration: BoxDecoration(
            color: Colors.white,
            boxShadow: [
          BoxShadow(
              color: const Color(0x1f000000),
              offset: Offset(0, 1.w),
              blurRadius: 0)
        ]),
        child: Row(
          children: [
            Container(
              margin: EdgeInsets.fromLTRB(0, 0, 11.5.w, 0),
              child: head,
            ),
            Expanded(flex: 1, child: body),
            action ?? const Text(''),
          ],
        ),
      ),
    );
  }
}
