Cell.dart 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/widgets.dart';
  3. import 'package:flutter_screenutil/flutter_screenutil.dart';
  4. class Cell extends StatelessWidget {
  5. const Cell ({
  6. Key? key,
  7. this.header,
  8. required this.child,
  9. this.footer,
  10. this.margin,
  11. }) : super(key: key);
  12. final Widget? header;
  13. final Widget child;
  14. final Widget? footer;
  15. final EdgeInsetsGeometry? margin;
  16. @override
  17. Widget build(BuildContext context) {
  18. return Container(
  19. margin: margin,
  20. padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 0.0),
  21. decoration: const BoxDecoration(
  22. border: Border(
  23. bottom: BorderSide(width: 1.0, color: Color(0x1F000000)),
  24. )
  25. ),
  26. child: Row(
  27. children: [
  28. if (null != header) SizedBox(
  29. width: 53.w,
  30. child: Container(
  31. decoration: const BoxDecoration(
  32. border: Border(
  33. right: BorderSide(width: 1, color: Color(0xFF333333))
  34. )
  35. ),
  36. child: header,
  37. ),
  38. ),
  39. Expanded(child: child,),
  40. if (null != footer) ConstrainedBox (
  41. constraints: BoxConstraints(maxWidth: 94.w),
  42. child: footer,
  43. )
  44. ],
  45. ),
  46. );
  47. }
  48. }