浏览代码
Merge branch 'zxw/devTools' of github.com:Unity-Technologies/com.unity.uiwidgets into zxw/devTools
/zxw-devTools
Merge branch 'zxw/devTools' of github.com:Unity-Technologies/com.unity.uiwidgets into zxw/devTools
/zxw-devTools
Xingwei Zhu
3 年前
当前提交
63187185
共有 12 个文件被更改,包括 487 次插入 和 135 次删除
-
4com.unity.uiwidgets.devtools/Editor/v2/src/framework/framework_core.cs
-
4com.unity.uiwidgets.devtools/Editor/v2/src/inspector/diagnostics_node.cs
-
91com.unity.uiwidgets.devtools/Editor/v2/src/inspector/inspector_controller.cs
-
146com.unity.uiwidgets.devtools/Editor/v2/src/inspector/inspector_screen_details_tab.cs
-
264com.unity.uiwidgets.devtools/Editor/v2/src/inspector/inspector_service.cs
-
1com.unity.uiwidgets.devtools/Editor/v2/src/inspector/inspector_tree.cs
-
4com.unity.uiwidgets.devtools/Editor/v2/src/inspector/inspector_tree_flutter.cs
-
24com.unity.uiwidgets.devtools/Editor/v2/src/service_manager.cs
-
34com.unity.uiwidgets.devtools/Editor/v2/src/inspector/layout_explorer/flex/flex.cs
-
50com.unity.uiwidgets.devtools/Editor/v2/src/inspector/layout_explorer/layout_explorer.cs
|
|||
using System.Collections.Generic; |
|||
using Unity.UIWidgets.material; |
|||
using Unity.UIWidgets.rendering; |
|||
using Unity.UIWidgets.DevTools.inspector.layout_explorer; |
|||
using Unity.UIWidgets.painting; |
|||
class InspectorDetailsTabController : StatefulWidget |
|||
class InspectorDetailsTabController : StatefulWidget |
|||
{ |
|||
public InspectorDetailsTabController( |
|||
Widget detailsTree = null, |
|||
Widget actionButtons = null, |
|||
InspectorController controller = null, |
|||
bool? layoutExplorerSupported = null, |
|||
Key key = null |
|||
) : base(key: key) |
|||
public InspectorDetailsTabController( |
|||
Widget detailsTree = null, |
|||
Widget actionButtons = null, |
|||
InspectorController controller = null, |
|||
bool? layoutExplorerSupported = null, |
|||
Key key = null |
|||
) : base(key: key) |
|||
{ |
|||
this.detailsTree = detailsTree; |
|||
this.actionButtons = actionButtons; |
|||
this.controller = controller; |
|||
this.layoutExplorerSupported = layoutExplorerSupported; |
|||
} |
|||
this.detailsTree = detailsTree; |
|||
this.actionButtons = actionButtons; |
|||
this.controller = controller; |
|||
this.layoutExplorerSupported = layoutExplorerSupported; |
|||
} |
|||
public readonly Widget detailsTree; |
|||
public readonly Widget actionButtons; |
|||
public readonly InspectorController controller; |
|||
public readonly bool? layoutExplorerSupported; |
|||
public readonly Widget detailsTree; |
|||
public readonly Widget actionButtons; |
|||
public readonly InspectorController controller; |
|||
public readonly bool? layoutExplorerSupported; |
|||
public override State createState() |
|||
{ |
|||
return new _InspectorDetailsTabControllerState(); |
|||
} |
|||
public override State createState() |
|||
{ |
|||
return new _InspectorDetailsTabControllerState(); |
|||
} |
|||
class _InspectorDetailsTabControllerState : State<InspectorDetailsTabController> |
|||
class _InspectorDetailsTabControllerState : State<InspectorDetailsTabController> |
|||
{ |
|||
private static readonly int _detailsTreeTabIndex = 0; |
|||
TabController _tabControllerWithLayoutExplorer; |
|||
TabController _tabControllerWithoutLayoutExplorer; |
|||
|
|||
|
|||
public override Widget build(BuildContext context) |
|||
public override Widget build(BuildContext context) |
|||
{ |
|||
return new Container(child: new Text("this is a text!")); |
|||
} |
|||
// var tabs = new List<Widget>();
|
|||
// tabs.Add(_buildTab("Details Tree"));
|
|||
// if (widget.layoutExplorerSupported.Value)
|
|||
// {
|
|||
// tabs.Add(_buildTab("Layout Explorer"));
|
|||
// }
|
|||
//
|
|||
// var tabViews = new List<Widget>();
|
|||
// tabViews.Add(widget.detailsTree);
|
|||
// if (widget.layoutExplorerSupported.Value)
|
|||
// {
|
|||
// tabViews.Add(new LayoutExplorerTab(controller: widget.controller));
|
|||
// }
|
|||
//
|
|||
// var _tabController = widget.layoutExplorerSupported.Value
|
|||
// ? _tabControllerWithLayoutExplorer
|
|||
// : _tabControllerWithoutLayoutExplorer;
|
|||
//
|
|||
// var theme = Theme.of(context);
|
|||
// var focusColor = theme.focusColor;
|
|||
// var borderSide = new BorderSide(color: focusColor);
|
|||
// var hasActionButtons = widget.actionButtons != null &&
|
|||
// _tabController.index == _detailsTreeTabIndex;
|
|||
//
|
|||
// return new Column(
|
|||
// children: new List<Widget>
|
|||
// {
|
|||
// new SizedBox(
|
|||
// height: 50.0f,
|
|||
// child: new Row(
|
|||
// crossAxisAlignment: CrossAxisAlignment.end,
|
|||
// children: new List<Widget>
|
|||
// {
|
|||
// new Container(
|
|||
// color: focusColor,
|
|||
// child: new TabBar(
|
|||
// controller: _tabController,
|
|||
// labelColor: theme.textTheme.bodyText1.color,
|
|||
// tabs: tabs,
|
|||
// isScrollable: true
|
|||
// )
|
|||
// ),
|
|||
// new Expanded(
|
|||
// child: new Container(
|
|||
// decoration: new BoxDecoration(border: new Border(bottom: borderSide)),
|
|||
// child: hasActionButtons
|
|||
// ? widget.actionButtons
|
|||
// : new SizedBox()
|
|||
// )
|
|||
// ),
|
|||
// }
|
|||
// )
|
|||
// ),
|
|||
// new Expanded(
|
|||
// child: new Container(
|
|||
// decoration: new BoxDecoration(
|
|||
// border: new Border(
|
|||
// left: borderSide,
|
|||
// bottom: borderSide,
|
|||
// right: borderSide
|
|||
// )
|
|||
// ),
|
|||
// child: new TabBarView(
|
|||
// physics: ThemeUtils.defaultTabBarViewPhysics,
|
|||
// controller: _tabController,
|
|||
// children: tabViews
|
|||
// )
|
|||
// )
|
|||
// )
|
|||
// }
|
|||
// );
|
|||
//
|
|||
// Widget _buildTab(string tabName)
|
|||
// {
|
|||
// return new Tab(
|
|||
// child: new Text(
|
|||
// tabName,
|
|||
// overflow: TextOverflow.ellipsis
|
|||
// )
|
|||
// );
|
|||
// }
|
|||
return new Container(child: new Text("Not Implement yet")); |
|||
|
|||
} |
|||
} |
|
|||
using Unity.UIWidgets.foundation; |
|||
using Unity.UIWidgets.widgets; |
|||
|
|||
namespace Unity.UIWidgets.DevTools.inspector.layout_explorer.flex |
|||
{ |
|||
public class FlexLayoutExplorerWidget : StatefulWidget { |
|||
public FlexLayoutExplorerWidget( |
|||
InspectorController inspectorController, |
|||
Key key = null |
|||
) : base(key: key) |
|||
{ |
|||
this.inspectorController = inspectorController; |
|||
} |
|||
|
|||
public readonly InspectorController inspectorController; |
|||
|
|||
public static bool shouldDisplay(RemoteDiagnosticsNode node) { |
|||
return (node?.isFlex ?? false) || (node?.parent?.isFlex ?? false); |
|||
} |
|||
|
|||
public override State createState() |
|||
{ |
|||
return new _FlexLayoutExplorerWidgetState(); |
|||
} |
|||
} |
|||
|
|||
public class _FlexLayoutExplorerWidgetState : State<FlexLayoutExplorerWidget> |
|||
{ |
|||
public override Widget build(BuildContext context) |
|||
{ |
|||
return new Container(child: new Text("asdfafafa dakfiwejo")); |
|||
} |
|||
} |
|||
} |
|
|||
using Unity.UIWidgets.DevTools.inspector.layout_explorer.flex; |
|||
using Unity.UIWidgets.foundation; |
|||
using Unity.UIWidgets.rendering; |
|||
using Unity.UIWidgets.ui; |
|||
using Unity.UIWidgets.widgets; |
|||
|
|||
namespace Unity.UIWidgets.DevTools.inspector.layout_explorer |
|||
{ |
|||
public class LayoutExplorerTab : StatefulWidget { |
|||
public LayoutExplorerTab(Key key = null, InspectorController controller = null) : base(key: key) |
|||
{ |
|||
this.controller = controller; |
|||
} |
|||
|
|||
public readonly InspectorController controller; |
|||
|
|||
public override State createState() |
|||
{ |
|||
return new _LayoutExplorerTabState(); |
|||
} |
|||
} |
|||
|
|||
public class _LayoutExplorerTabState : State<LayoutExplorerTab> |
|||
{ |
|||
|
|||
InspectorController controller => widget.controller; |
|||
|
|||
RemoteDiagnosticsNode selected => controller?.selectedNode?.diagnostic; |
|||
|
|||
Widget rootWidget(RemoteDiagnosticsNode node) { |
|||
if (FlexLayoutExplorerWidget.shouldDisplay(node)) |
|||
return new FlexLayoutExplorerWidget(controller); |
|||
return new Center( |
|||
child: new Text( |
|||
"Currently, Layout Explorer only supports Flex-based widgets" + |
|||
"(e.g., Row, Column, Flex) or their direct children.", |
|||
textAlign: TextAlign.center, |
|||
overflow: TextOverflow.clip |
|||
) |
|||
); |
|||
} |
|||
|
|||
public override Widget build(BuildContext context) |
|||
{ |
|||
return rootWidget(selected); |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue