createBorderSide method

BorderSide createBorderSide (BuildContext context, { Color color, double width: 0.0 })

Computes the BorderSide that represents a divider of the specified color, or, if there is no specified color, of the default ThemeData.dividerColor specified in the ambient Theme.

The width argument can be used to override the default width of the divider border, which is usually 0.0 (a hairline border).

This example uses this method to create a box that has a divider above and below it. This is sometimes useful with lists, for instance, to separate a scrollable section from the rest of the interface.
DecoratedBox(
  decoration: BoxDecoration(
    border: Border(
      top: Divider.createBorderSide(context),
      bottom: Divider.createBorderSide(context),
    ),
  ),
  // child: ...
)

Implementation

static BorderSide createBorderSide(BuildContext context, { Color color, double width = 0.0 }) {
  assert(width != null);
  return BorderSide(
    color: color ?? Theme.of(context).dividerColor,
    width: width,
  );
}