2022-08-26 08:11:35 +00:00
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:stackwallet/utilities/constants.dart';
|
|
|
|
|
|
|
|
class RoundedContainer extends StatelessWidget {
|
|
|
|
const RoundedContainer({
|
|
|
|
Key? key,
|
|
|
|
this.child,
|
|
|
|
required this.color,
|
|
|
|
this.padding = const EdgeInsets.all(12),
|
2022-09-16 23:54:46 +00:00
|
|
|
this.radiusMultiplier = 1.0,
|
2022-09-18 17:27:38 +00:00
|
|
|
this.width,
|
|
|
|
this.height,
|
2022-10-10 03:36:43 +00:00
|
|
|
this.borderColor,
|
2023-02-02 21:37:59 +00:00
|
|
|
this.boxShadow,
|
2022-08-26 08:11:35 +00:00
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
final Widget? child;
|
|
|
|
final Color color;
|
|
|
|
final EdgeInsets padding;
|
2022-09-16 23:54:46 +00:00
|
|
|
final double radiusMultiplier;
|
2022-09-18 17:27:38 +00:00
|
|
|
final double? width;
|
|
|
|
final double? height;
|
2022-10-10 03:36:43 +00:00
|
|
|
final Color? borderColor;
|
2023-02-02 21:37:59 +00:00
|
|
|
final List<BoxShadow>? boxShadow;
|
2022-08-26 08:11:35 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Container(
|
2022-09-18 17:27:38 +00:00
|
|
|
width: width,
|
|
|
|
height: height,
|
2022-08-26 08:11:35 +00:00
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: color,
|
|
|
|
borderRadius: BorderRadius.circular(
|
2022-09-16 23:54:46 +00:00
|
|
|
Constants.size.circularBorderRadius * radiusMultiplier,
|
2022-08-26 08:11:35 +00:00
|
|
|
),
|
2022-10-10 03:36:43 +00:00
|
|
|
border: borderColor == null ? null : Border.all(color: borderColor!),
|
2023-02-02 21:37:59 +00:00
|
|
|
boxShadow: boxShadow,
|
2022-08-26 08:11:35 +00:00
|
|
|
),
|
|
|
|
child: Padding(
|
|
|
|
padding: padding,
|
|
|
|
child: child,
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|