import 'package:flutter/material.dart';

class ColoredContainer extends StatefulWidget {
  ColoredContainer({Key? key, this.child, this.containerColor,this.containerGradient,this.width,this.height,this.padding,this.margin})
      : super(key: key);

  final Color? containerColor;
  final Gradient? containerGradient;
  final double? width;
  final double? height;
  final Widget? child;
  EdgeInsetsGeometry? padding;
  EdgeInsetsGeometry? margin;

  @override
  State<ColoredContainer> createState() => _ColoredContainerState();
}

class _ColoredContainerState extends State<ColoredContainer> {
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: widget.padding,
      margin: widget.margin,
      width: widget.width,
      height: widget.height,
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(10.0),
        color: widget.containerColor,
        gradient: widget.containerGradient
      ),
      child: Padding(
        padding: const EdgeInsets.all(10.00),
        child: widget.child,
      ),
    );
  }
}
