浏览代码

fix test sample.

/main
kg 6 年前
当前提交
3e36490d
共有 2 个文件被更改,包括 15 次插入9 次删除
  1. 9
      Samples/UIWidgetSample/AsScreenSample.cs
  2. 15
      Tests/Editor/Widgets.cs

9
Samples/UIWidgetSample/AsScreenSample.cs


using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using UnityEngine;
using Color = Unity.UIWidgets.ui.Color;
using Image = Unity.UIWidgets.widgets.Image;
using TextStyle = Unity.UIWidgets.painting.TextStyle;

height: 450,
color: CLColors.white,
child: Image.network(
"https://d2ujflorbtfzji.cloudfront.net/banner/5c57178c-4be6-4903-953b-85125bfb7154.jpg",
fit: BoxFit.cover
"https://assetstorev1-prd-cdn.unity3d.com/banner/9716cc07-748c-43cc-8809-10113119c97a.jpg",
fit: BoxFit.cover,
filterMode: FilterMode.Bilinear
)
);
}

45.0f,
36.0f,
true,
"https://d2ujflorbtfzji.cloudfront.net/key-image/46dc65c1-f605-4ccb-97e0-3d60b28cfdfe.jpg"
"https://assetstorev1-prd-cdn.unity3d.com/key-image/76a549ae-de17-4536-bd96-4231ed20dece.jpg"
);
return new Container(
margin: EdgeInsets.only(left: 98),

15
Tests/Editor/Widgets.cs


if (this._selected != selected) {
this._selected = selected;
this._attachRootWidget(null);
this._attachRootWidget(new Container());
}
if (GUILayout.Button("loadLocal")) {

}
void _attachRootWidget(Widget widget) {
this.windowAdapter.attachRootWidget(() => new WidgetsApp(home: widget,
this.windowAdapter.attachRootWidget(() => new WidgetsApp(
home: widget,
navigatorKey: GlobalKey<NavigatorState>.key(),
pageRouteBuilder: (RouteSettings settings, WidgetBuilder builder) =>
new PageRouteBuilder(
settings: settings,

height: 450,
color: CLColors.white,
child: Image.network(
"https://d2ujflorbtfzji.cloudfront.net/banner/5c57178c-4be6-4903-953b-85125bfb7154.jpg",
fit: BoxFit.cover
"https://assetstorev1-prd-cdn.unity3d.com/banner/9716cc07-748c-43cc-8809-10113119c97a.jpg",
fit: BoxFit.cover,
filterMode: FilterMode.Bilinear
)
);
}

45.0f,
36.0f,
true,
"https://d2ujflorbtfzji.cloudfront.net/key-image/46dc65c1-f605-4ccb-97e0-3d60b28cfdfe.jpg"
"https://assetstorev1-prd-cdn.unity3d.com/key-image/76a549ae-de17-4536-bd96-4231ed20dece.jpg"
);
return new Container(
margin: EdgeInsets.only(left: 98),

child: new Container(
color: CLColors.background3,
child: new Transform(
transform: Matrix3.makeRotate(45, px, py),
transform: Matrix3.makeRotate(Mathf.PI/180 * 5, px, py),
child:
new Column(
children: new List<Widget> {

正在加载...
取消
保存