jld3103
2 years ago
5 changed files with 77 additions and 35 deletions
@ -0,0 +1,36 @@
|
||||
part of '../neon.dart'; |
||||
|
||||
class ImageWrapper extends StatelessWidget { |
||||
const ImageWrapper({ |
||||
required this.child, |
||||
required this.backgroundColor, |
||||
this.width, |
||||
this.height, |
||||
this.borderRadius, |
||||
super.key, |
||||
}); |
||||
|
||||
final Widget child; |
||||
final Color backgroundColor; |
||||
final double? width; |
||||
final double? height; |
||||
final BorderRadius? borderRadius; |
||||
|
||||
@override |
||||
Widget build(BuildContext context) => SizedBox( |
||||
width: width, |
||||
height: height, |
||||
child: DecoratedBox( |
||||
decoration: BoxDecoration( |
||||
color: backgroundColor, |
||||
borderRadius: borderRadius?.add(const BorderRadius.all(Radius.circular(1))), |
||||
), |
||||
child: Center( |
||||
child: ClipRRect( |
||||
borderRadius: borderRadius ?? BorderRadius.zero, |
||||
child: child, |
||||
), |
||||
), |
||||
), |
||||
); |
||||
} |
Loading…
Reference in new issue