浏览代码

Merge branch 'material' into 'master'

performance overlay support on WidgetApp/MaterialApp

See merge request upm-packages/ui-widgets/com.unity.uiwidgets!99
/main
Shenhua Gu 6 年前
当前提交
d492703b
共有 1 个文件被更改,包括 20 次插入1 次删除
  1. 21
      Runtime/widgets/app.cs

21
Runtime/widgets/app.cs


public readonly Dictionary<string, WidgetBuilder> routes;
public readonly TextStyle textStyle;
public readonly Window window;
public readonly bool showPerformanceoverlay;
public WidgetsApp(
Key key = null,

Dictionary<string, WidgetBuilder> routes = null,
TransitionBuilder builder = null,
TextStyle textStyle = null,
Widget home = null
Widget home = null,
bool showPerformanceOverlay = false
) : base(key) {
routes = routes ?? new Dictionary<string, WidgetBuilder>();
this.window = Window.instance;

this.initialRoute = initialRoute;
this.builder = builder;
this.textStyle = textStyle;
this.showPerformanceoverlay = showPerformanceOverlay;
D.assert(
home == null ||

style: this.widget.textStyle,
child: result
);
}
PerformanceOverlay performanceOverlay = null;
if (this.widget.showPerformanceoverlay) {
performanceOverlay = PerformanceOverlay.allEnabled();
}
if (performanceOverlay != null) {
result = new Stack(
children: new List<Widget> {
result,
new Positioned(top: 0.0f,
left: 0.0f,
right: 0.0f,
child: performanceOverlay)
});
}
D.assert(() => {

正在加载...
取消
保存