可容纳一个孩子,为后代的分割线指定默认样式。常用于分割线的样式统一,避免一一设置。

相关组件

Divider VerticalDivider

DividerTheme使用

  1. <br />属性参数与Divider类似,可以通过DividerTheme.of获取分割线主题数据,"<br />也可以为DividerTheme【后代】的分割线设置默认样式,包括颜色、粗细、高度等。<br />![image.png](https://cdn.nlark.com/yuque/0/2020/png/326147/1589512179221-9cc79620-a7c3-42ed-a4f4-b6b25e5c2d2f.png#align=left&display=inline&height=156&margin=%5Bobject%20Object%5D&name=image.png&originHeight=156&originWidth=389&size=3001&status=done&style=none&width=389)
import 'package:flutter/material.dart';
class DividerThemeDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return DividerTheme(
      data: DividerThemeData(
        color: Colors.orange,
        thickness: 2,
        space: 10,
        indent: 10,
        endIndent: 10,

      ),
      child: Wrap(
        spacing: 10,
        children: <Widget>[
         Divider(),
         Divider(),
         Divider(),
         Divider(),
         Divider(),
          Container(
            height: 100,
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: <Widget>[
                VerticalDivider(),
                VerticalDivider(),
                VerticalDivider(),
                VerticalDivider(),
                VerticalDivider(),
              ],
            ),
          )
        ],
      ),
    );
  }
}