chip method

Widget chip({
  1. required Color backgroundColor,
  2. double? width,
  3. double? height,
  4. Alignment? alignment,
  5. double borderWidth = 1,
  6. double radius = 12,
  7. Color borderColor = Colors.transparent,
  8. EdgeInsets padding = const EdgeInsets.symmetric(horizontal: 8, vertical: 6),
  9. EdgeInsetsGeometry? margin,
  10. BoxConstraints? constraints,
})

Implementation

Widget chip({
  required Color backgroundColor,
  double? width,
  double? height,
  Alignment? alignment,
  double borderWidth = 1,
  double radius = 12,
  Color borderColor = Colors.transparent,
  EdgeInsets padding = const EdgeInsets.symmetric(horizontal: 8, vertical: 6),
  EdgeInsetsGeometry? margin,
  BoxConstraints? constraints,
}) => Container(
  clipBehavior: Clip.hardEdge,
  constraints: constraints,
  width: width,
  height: height,
  padding: padding,
  margin: margin,
  alignment: alignment,
  decoration: BoxDecoration(
    color: backgroundColor,
    borderRadius: BorderRadius.circular(radius),
    border: Border.all(color: borderColor, width: borderWidth),
  ),
  child: this,
);