horizontalDivider method

Widget horizontalDivider({
  1. double? width,
  2. double? height,
  3. Color? color,
})

Creates a horizontal divider widget with the specified width, height, and color.

The width parameter specifies the width of the divider. If null, the default width is used. The height parameter specifies the height of the divider. If null, the default height is used. The color parameter specifies the color of the divider. If null, the default color is used.

Example usage:

horizontalDivider(width: 100.0, height: 2.0, color: Colors.grey);

Implementation

Widget horizontalDivider({double? width, double? height, Color? color}) {
  return Container(
    height: height ?? 2,
    width: width ?? MediaQuery.sizeOf(this).width,
    margin: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 4.0),
    color: color ?? Colors.black,
  );
}