您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
45 行
1.5 KiB
45 行
1.5 KiB
using System.Collections.Generic;
|
|
using Unity.UIWidgets.engine2;
|
|
using Unity.UIWidgets.ui;
|
|
using Unity.UIWidgets.widgets;
|
|
using ui_ = Unity.UIWidgets.widgets.ui_;
|
|
|
|
namespace UIWidgetsSample {
|
|
public class PageViewSample : UIWidgetsPanel {
|
|
|
|
protected override void main()
|
|
{
|
|
ui_.runApp(new MyApp());
|
|
}
|
|
|
|
class MyApp : StatelessWidget
|
|
{
|
|
public override Widget build(BuildContext context)
|
|
{
|
|
return new WidgetsApp(
|
|
home: new Container(
|
|
width: 200,
|
|
height: 400,
|
|
child: new PageView(
|
|
children: new List<Widget>() {
|
|
new Container(
|
|
color: new Color(0xFFE91E63)
|
|
),
|
|
new Container(
|
|
color: new Color(0xFF00BCD4)
|
|
),
|
|
new Container(
|
|
color: new Color(0xFF673AB7)
|
|
)
|
|
}
|
|
)),
|
|
pageRouteBuilder: (settings, builder) =>
|
|
new PageRouteBuilder(
|
|
settings: settings,
|
|
pageBuilder: (Buildcontext, animation, secondaryAnimation) => builder(context)
|
|
)
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|