stack_wallet/lib/widgets/rounded_container.dart

43 lines
1 KiB
Dart
Raw Normal View History

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,
this.borderColor,
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;
final Color? borderColor;
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
),
border: borderColor == null ? null : Border.all(color: borderColor!),
2022-08-26 08:11:35 +00:00
),
child: Padding(
padding: padding,
child: child,
),
);
}
}