浏览代码

revert changes in package com.unity.uiwdisgets

/zxw-devTools
guanghuispark 3 年前
当前提交
3423bdc2
共有 8 个文件被更改,包括 165 次插入36 次删除
  1. 22
      com.unity.uiwidgets.devtools/Editor/v2/src/inspector/inspector_screen.cs
  2. 8
      com.unity.uiwidgets.devtools/Editor/v2/src/inspector/inspector_tree.cs
  3. 12
      com.unity.uiwidgets.devtools/Editor/v2/src/inspector/inspector_tree_flutter.cs
  4. 3
      com.unity.uiwidgets/Runtime/widgets/focus_manager.cs
  5. 11
      com.unity.uiwidgets/Runtime/widgets/ticker_provider.cs
  6. 4
      com.unity.uiwidgets/Runtime/widgets/value_listenable_builder.cs
  7. 69
      com.unity.uiwidgets.devtools/Editor/v2/src/CollapsibleAnimationMixin.mixin.gen.cs
  8. 72
      com.unity.uiwidgets.devtools/Editor/v2/src/CollapsibleAnimationMixin.mixin.njk

22
com.unity.uiwidgets.devtools/Editor/v2/src/inspector/inspector_screen.cs


children: new List<Widget>
{
new SizedBox(width: ThemeUtils.denseSpacing),
// new Container(
// height: 36,// Theme.of(context).buttonTheme.height,
// child: new OutlineButton(
// onPressed: _refreshInspector,
// child: new MaterialIconLabel(
// Icons.refresh,
// "Refresh Tree",
// includeTextWidth: 750
// )
// )
// ),
new Container(
height: Theme.of(context).buttonTheme.height + 0.01f,
child: new OutlineButton(
onPressed: _refreshInspector,
child: new MaterialIconLabel(
Icons.refresh,
"Refresh Tree",
includeTextWidth: 750
)
)
),
new Spacer()
}),
new SizedBox(height: ThemeUtils.denseRowSpacing),

8
com.unity.uiwidgets.devtools/Editor/v2/src/inspector/inspector_tree.cs


}
}
abstract class InspectorTreeController
public abstract class InspectorTreeController
{
public abstract void setState(VoidCallback fn);
public abstract InspectorTreeNode createNode();

public delegate void OnClientActiveChange(bool added);
class InspectorTreeConfig {
public class InspectorTreeConfig {
public InspectorTreeConfig(
bool summaryTree = false,
FlutterTreeType treeType = FlutterTreeType.widget,

}
class InspectorTreeNode
public class InspectorTreeNode
{
bool showLinesToChildren {
get

}
class InspectorTreeRow {
public class InspectorTreeRow {
public InspectorTreeRow(
InspectorTreeNode node = null,
int? index = null,

12
com.unity.uiwidgets.devtools/Editor/v2/src/inspector/inspector_tree_flutter.cs


}
}
class _InspectorTreeRowWidget : StatefulWidget {
public class _InspectorTreeRowWidget : StatefulWidget {
public _InspectorTreeRowWidget(
Key key = null,
InspectorTreeRow row = null,

}
}
class _InspectorTreeRowState : TickerProviderStateMixin<_InspectorTreeRowWidget>
class _InspectorTreeRowState : CollapsibleAnimationMixinTickerProviderStateMixin<_InspectorTreeRowWidget>
{
public override Widget build(BuildContext context)

expandArrowAnimation: expandArrowAnimation,
controller: widget.inspectorTreeState.controller,
onToggle: () => {
// setExpanded(!isExpanded);
setExpanded(!isExpanded);
}
)
);

class InspectorTreeControllerFlutter : InspectorTreeController
public class InspectorTreeControllerFlutter : InspectorTreeController
{
public readonly float rowWidth = 1200;
float _maxIndent;

}
}
class InspectorTree : StatefulWidget
public class InspectorTree : StatefulWidget
{
public InspectorTree(
Key key = null,

}
}
class _InspectorTreeState : State<InspectorTree>
public class _InspectorTreeState : State<InspectorTree>
{
ScrollController _scrollControllerY;
ScrollController _scrollControllerX;

3
com.unity.uiwidgets/Runtime/widgets/focus_manager.cs


$"{(hasPrimaryFocus ? "[PRIMARY FOCUS]" : nullStr)}";
return $"{foundation_.describeIdentity(this)}" + $"{(extraData.isNotEmpty() ? extraData : nullStr)}";
}
}
}
}
public class FocusScopeNode : FocusNode {

11
com.unity.uiwidgets/Runtime/widgets/ticker_provider.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.scheduler;

// in AutomaticKeepAliveClientWithTickerProviderStateMixin, remember to keep the copy up to date
public abstract class TickerProviderStateMixin<T> : State<T>, TickerProvider where T : StatefulWidget {
HashSet<Ticker> _tickers;
public Animation<float> expandArrowAnimation;
public override void initState() {
base.initState();
expandArrowAnimation = new CurvedAnimation(curve: Curves.easeInOutCubic, parent: new AnimationController(
duration: new TimeSpan(0,0,0,0,200),
vsync: this,
value: 0.0f
));
}
public Ticker createTicker(TickerCallback onTick) {
_tickers = _tickers ?? new HashSet<Ticker>();

4
com.unity.uiwidgets/Runtime/widgets/value_listenable_builder.cs


Key key = null,
Widget child = null
) : base(key: key) {
// D.assert(valueListenable != null);
// D.assert(builder != null);
D.assert(valueListenable != null);
D.assert(builder != null);
this.valueListenable = valueListenable;
this.builder = builder;
this.child = child;

69
com.unity.uiwidgets.devtools/Editor/v2/src/CollapsibleAnimationMixin.mixin.gen.cs


using System;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.DevTools.inspector;
using Unity.UIWidgets.widgets;
namespace Unity.UIWidgets.DevTools
{
public abstract class CollapsibleAnimationMixinTickerProviderStateMixin<T> : TickerProviderStateMixin<T> where T : StatefulWidget {
AnimationController expandController;
Animation<float> expandArrowAnimation;
Animation<float> expandCurve;
bool shouldShow()
{
return isExpanded;
}
void onExpandChanged(bool expanded)
{
}
public bool isExpanded
{
get;
}
public override void initState() {
base.initState();
expandArrowAnimation = new CurvedAnimation(curve: Curves.easeInOutCubic, parent: new AnimationController(
duration: new TimeSpan(0,0,0,0,200),
vsync: this,
value: 0.0f
));
}
public override void dispose() {
expandController.dispose();
base.dispose();
}
public void setExpanded(bool expanded) {
setState(() => {
if (expanded) {
expandController.forward();
} else {
expandController.reverse();
}
onExpandChanged(expanded);
});
}
public override void didUpdateWidget(StatefulWidget oldWidget) {
base.didUpdateWidget(oldWidget);
if (isExpanded) {
expandController.forward();
} else {
expandController.reverse();
}
}
}
}

72
com.unity.uiwidgets.devtools/Editor/v2/src/CollapsibleAnimationMixin.mixin.njk


using System;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.DevTools.inspector;
using Unity.UIWidgets.widgets;
namespace Unity.UIWidgets.DevTools
{
{% macro CollapsibleAnimationMixin(with) %}
{% set className = 'CollapsibleAnimationMixin' + with %}
public abstract class {{className | safe}} : {{with | safe}} where T : StatefulWidget {
AnimationController expandController;
Animation<float> expandArrowAnimation;
Animation<float> expandCurve;
bool shouldShow()
{
return isExpanded;
}
void onExpandChanged(bool expanded)
{
}
public bool isExpanded
{
get;
}
public override void initState() {
base.initState();
expandArrowAnimation = new CurvedAnimation(curve: Curves.easeInOutCubic, parent: new AnimationController(
duration: new TimeSpan(0,0,0,0,200),
vsync: this,
value: 0.0f
));
}
public override void dispose() {
expandController.dispose();
base.dispose();
}
public void setExpanded(bool expanded) {
setState(() => {
if (expanded) {
expandController.forward();
} else {
expandController.reverse();
}
onExpandChanged(expanded);
});
}
public override void didUpdateWidget(StatefulWidget oldWidget) {
base.didUpdateWidget(oldWidget);
if (isExpanded) {
expandController.forward();
} else {
expandController.reverse();
}
}
}
{% endmacro %}
{{ CollapsibleAnimationMixin('TickerProviderStateMixin<T>') }}
}
正在加载...
取消
保存