|
|
|
|
|
|
using System.Collections.Generic; |
|
|
|
using uiwidgets; |
|
|
|
using Unity.UIWidgets.engine; |
|
|
|
using Unity.UIWidgets.material; |
|
|
|
using Unity.UIWidgets.widgets; |
|
|
|
using UnityEngine; |
|
|
|
|
|
|
|
namespace UIWidgetsSample.RaycastableScene |
|
|
|
{ |
|
|
|
public class ItemPickerMainUIPanel : UIWidgetsRaycastablePanel |
|
|
|
{ |
|
|
|
protected override void main() |
|
|
|
{ |
|
|
|
ui_.runApp(new ItemPickerMainUI()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public class ItemPickerMainUI : StatelessWidget |
|
|
|
{ |
|
|
|
public override Widget build(BuildContext context) |
|
|
|
{ |
|
|
|
return new MaterialApp( |
|
|
|
home: new Scaffold( |
|
|
|
backgroundColor: Colors.blue.withAlpha(64), |
|
|
|
body: new ItemPickerMainWidget() |
|
|
|
) |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public class ItemPickerMainWidget : StatefulWidget |
|
|
|
{ |
|
|
|
public override State createState() |
|
|
|
{ |
|
|
|
return new ItemPickerMainWidgetState(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public class ItemPickerMainWidgetState : State<ItemPickerMainWidget> |
|
|
|
{ |
|
|
|
public override Widget build(BuildContext context) |
|
|
|
{ |
|
|
|
return new Column( |
|
|
|
children: new List<Widget> |
|
|
|
{ |
|
|
|
buildTop(), |
|
|
|
buildMiddle() |
|
|
|
} |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
private Widget buildTop() |
|
|
|
{ |
|
|
|
return new RaycastableContainer(child: new Container(height: 50f, color: Colors.blue)); |
|
|
|
} |
|
|
|
|
|
|
|
private Widget buildMiddle() |
|
|
|
{ |
|
|
|
return new Expanded(child: new Row( |
|
|
|
children: new List<Widget> |
|
|
|
{ |
|
|
|
buildLeft(), |
|
|
|
new Container() |
|
|
|
} |
|
|
|
)); |
|
|
|
} |
|
|
|
|
|
|
|
private Widget buildLeft() |
|
|
|
{ |
|
|
|
return new RaycastableContainer(child: new Container(width: 100f, color: Colors.green)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |