panel.dart 741 B

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