您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

28 行
988 B

using Unity.UIWidgets.foundation;
using Unity.UIWidgets.rendering;
namespace Unity.UIWidgets.widgets {
public delegate Widget OrientationWidgetBuilder(BuildContext context, Orientation orientation);
public class OrientationBuilder : StatelessWidget {
public OrientationBuilder(
OrientationWidgetBuilder builder,
Key key = null
) : base(key: key) {
D.assert(builder != null);
this.builder = builder;
}
public readonly OrientationWidgetBuilder builder;
Widget _buildWithConstraints(BuildContext context, BoxConstraints constraints) {
Orientation orientation =
constraints.maxWidth > constraints.maxHeight ? Orientation.landscape : Orientation.portrait;
return builder(context, orientation);
}
public override Widget build(BuildContext context) {
return new LayoutBuilder(builder: _buildWithConstraints);
}
}
}