Container With Rounded Border

How to use?

child parameter is mendatory.

const ContainerWithRoundedBorder(child: Text('Hello'),);

change borderRadius.

const ContainerWithRoundedBorder(
    borderRadius: 20,
    child: Text('Hello'),

change background color of container.

final ContainerWithRoundedBorder(
    child: const Text('Hello'),

change container padding.

const ContainerWithRoundedBorder(
    padding: allPadding16,
    child: Text('Hello'),

change container height and width.

const ContainerWithRoundedBorder(
    height: 100,
    width: 100,
    child: Text('Hello'),

Source code

import 'package:flutter/material.dart';
import 'package:team/vaahextendflutter/helpers/constants.dart';

class ContainerWithRoundedBorder extends StatelessWidget {
  final EdgeInsets padding;
  final double? width;
  final double? height;
  final double borderRadius;
  final Color color;
  final Widget child;

  const ContainerWithRoundedBorder({
    this.padding = allPadding24,
    this.borderRadius = defaultPadding,
    this.color = Colors.white,
    required this.child,

  Widget build(BuildContext context) {
    return Container(
      width: width,
      height: height,
      padding: padding,
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(borderRadius),
        color: color,
      child: child,

Copyright © 2024