flutter_decorated_container 1.0.0

SDKflutter
Platformandroidioswindowslinuxmacosweb

A Customisable Container widget for the dashed border with rounded corner radius and its background color.

flutter_decorated_container

A Customisable widget for the dashed/dotted border around any widget.

Features

  • A Container with special decorated options to make the widget more powerful
    • Dashed border around the container with rounded corner radius
    • Customisable strokeColor for the dashed line
    • Both width and gap of the dash can be customised
    • Background color for the widget.

Usage

With Default values

DecoratedContainer(
  cornerRadius: 16,
  fillColor: Colors.white,
  strokeColor: Colors.red,
  child: Center(child: Text("sample child widget")),
)

With customised values

DecoratedContainer(
  strokeWidth: 3,
  dashSpace: 4,
  dashWidth: 6,
  fillColor: Colors.white,
  cornerRadius: 16,
  strokeColor: Colors.red,
  child: Center(child: Text("sample child widget")),
)

Sample UI:

(as per the app module of /example)

Screenshot_1723913170

Configuration Parameters

Variable NameDefault ValuePurpose
strokeColorColors.greySpecifies the color of the border or stroke around the Container.
backgroundColorColors.whiteSpecifies the color used to fill the inside of the Container.
strokeWidth2.0Defines the thickness of the border or stroke.
dashWidth5.0Specifies the width of each dash in a dashed border.
dashSpace3.0Specifies the space between each dash in a dashed border.
cornerRadiusnullDefines the radius of the corners for rounded shapes. If null, the shape has sharp corners.
paddingnullThis padding is in addition to any padding inherent in the decoration.
marginnullEmpty space to surround the decoration and child.
decorationnullTo actually paint a Decoration at behind the child. Use the backgroundColor property to specify a simple solid color. Dashed/dotted border will be overlapped when this property has values.
decorationPositionDecorationPosition.backgroundDefines the child element as a Widget.By default the decoration paints behind the child.
childnullThe child contained by the container.

Feel free to contribute to this package!! 🙇‍♂️

Always happy if anyone wants to help to improve this package!

If you need any features

Please open an issue so that we can discuss your feature request 🙏