您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
48 行
1.5 KiB
48 行
1.5 KiB
using Unity.UIWidgets.foundation;
|
|
using Unity.UIWidgets.painting;
|
|
using Unity.UIWidgets.widgets;
|
|
using Color = Unity.UIWidgets.ui.Color;
|
|
|
|
namespace Unity.UIWidgets.material {
|
|
public class Divider : StatelessWidget {
|
|
public Divider(
|
|
Key key = null,
|
|
double height = 16.0,
|
|
double indent = 0.0,
|
|
Color color = null
|
|
) : base(key) {
|
|
D.assert(height >= 0.0);
|
|
this.height = height;
|
|
this.indent = indent;
|
|
this.color = color;
|
|
}
|
|
|
|
public readonly double height;
|
|
public readonly double indent;
|
|
public readonly Color color;
|
|
|
|
public static BorderSide createBorderSide(BuildContext context, Color color = null, double width = 0.0) {
|
|
return new BorderSide(
|
|
color: Theme.of(context).dividerColor,
|
|
width: width
|
|
);
|
|
}
|
|
|
|
public override Widget build(BuildContext context) {
|
|
return new SizedBox(
|
|
height: height,
|
|
child: new Center(
|
|
child: new Container(
|
|
height: 0.0,
|
|
margin: EdgeInsets.only(left: indent),
|
|
decoration: new BoxDecoration(
|
|
border: new Border(
|
|
bottom: createBorderSide(context, color)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
);
|
|
}
|
|
}
|
|
}
|