panel.dart 799 B

12345678910111213141516171819202122232425262728293031323334
  1. import 'package:flutter/material.dart';
  2. import 'package:vitalapp/consts/styles.dart';
  3. class VPanel extends StatelessWidget {
  4. static const _borderRadius = GlobalStyles.borderRadiusValue;
  5. final Widget child;
  6. final Color? backgroundColor;
  7. final EdgeInsetsGeometry? padding;
  8. const VPanel({
  9. super.key,
  10. required this.child,
  11. this.backgroundColor,
  12. this.padding,
  13. });
  14. @override
  15. Widget build(BuildContext context) {
  16. return Container(
  17. // height: 150,
  18. padding:
  19. padding ?? const EdgeInsets.symmetric(horizontal: 14, vertical: 8),
  20. alignment: Alignment.center,
  21. decoration: BoxDecoration(
  22. color: backgroundColor ?? Colors.white,
  23. borderRadius: const BorderRadius.all(_borderRadius),
  24. ),
  25. child: child,
  26. );
  27. }
  28. }