default_circle_image.dart 742 B

1234567891011121314151617181920212223242526272829303132
  1. import 'package:flutter/cupertino.dart';
  2. class DefaultCircleImage extends StatelessWidget {
  3. final Widget image;
  4. final Color bgColor;
  5. final bool center;
  6. final double width;
  7. final double height;
  8. const DefaultCircleImage({
  9. Key? key, required this.image,
  10. required this.bgColor,
  11. this.center = false,
  12. this.width = 45,
  13. this.height = 45
  14. }) : super(key: key);
  15. @override
  16. Widget build(BuildContext context) {
  17. return Container(
  18. width: width,
  19. height: height,
  20. child: center? Center(child: image) : Padding(
  21. padding: const EdgeInsets.all(13.0),
  22. child: image,
  23. ),
  24. decoration: BoxDecoration(
  25. shape: BoxShape.circle,
  26. color: bgColor,
  27. ),
  28. );
  29. }
  30. }