您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
53 行
1.4 KiB
53 行
1.4 KiB
using System.Collections.Generic;
|
|
using Unity.UIWidgets.foundation;
|
|
using Unity.UIWidgets.widgets;
|
|
|
|
namespace Unity.UIWidgets.material {
|
|
public class GridTile : StatelessWidget {
|
|
public GridTile(
|
|
Key key = null,
|
|
Widget header = null,
|
|
Widget footer = null,
|
|
Widget child = null) : base(key: key) {
|
|
D.assert(child != null);
|
|
this.header = header;
|
|
this.footer = footer;
|
|
this.child = child;
|
|
}
|
|
|
|
public readonly Widget header;
|
|
|
|
public readonly Widget footer;
|
|
|
|
public readonly Widget child;
|
|
|
|
public override Widget build(BuildContext context) {
|
|
if (header == null && footer == null) {
|
|
return child;
|
|
}
|
|
|
|
List<Widget> children = new List<Widget> {
|
|
Positioned.fill(
|
|
child: child)
|
|
};
|
|
if (header != null) {
|
|
children.Add(new Positioned(
|
|
top: 0.0f,
|
|
left: 0.0f,
|
|
right: 0.0f,
|
|
child: header));
|
|
}
|
|
|
|
if (footer != null) {
|
|
children.Add(new Positioned(
|
|
left: 0.0f,
|
|
bottom: 0.0f,
|
|
right: 0.0f,
|
|
child: footer));
|
|
}
|
|
|
|
return new Stack(
|
|
children: children);
|
|
}
|
|
}
|
|
}
|