浏览代码

stash changes

/zxw-devTools
xingweizhu 4 年前
当前提交
2936da39
共有 54 个文件被更改,包括 1049 次插入275 次删除
  1. 4
      com.unity.uiwidgets.devtools/Editor/analytics/provider.cs
  2. 4
      com.unity.uiwidgets.devtools/Editor/analytics/stub_provider.cs
  3. 306
      com.unity.uiwidgets.devtools/Editor/app.cs
  4. 4
      com.unity.uiwidgets.devtools/Editor/config_specific/ide_theme/ide_theme.cs
  5. 4
      com.unity.uiwidgets.devtools/Editor/enum_utils.cs
  6. 4
      com.unity.uiwidgets.devtools/Editor/globals.cs
  7. 4
      com.unity.uiwidgets.devtools/Editor/inspector/diagnostics.cs
  8. 53
      com.unity.uiwidgets.devtools/Editor/inspector/diagnostics_node.cs
  9. 4
      com.unity.uiwidgets.devtools/Editor/inspector/flutter_widget.cs
  10. 4
      com.unity.uiwidgets.devtools/Editor/inspector/inspector_controller.cs
  11. 4
      com.unity.uiwidgets.devtools/Editor/inspector/inspector_data_models.cs
  12. 4
      com.unity.uiwidgets.devtools/Editor/inspector/inspector_screen.cs
  13. 4
      com.unity.uiwidgets.devtools/Editor/inspector/inspector_screen_details_tab.cs
  14. 66
      com.unity.uiwidgets.devtools/Editor/inspector/inspector_service.cs
  15. 4
      com.unity.uiwidgets.devtools/Editor/inspector/inspector_text_style.cs
  16. 4
      com.unity.uiwidgets.devtools/Editor/inspector/inspector_tree.cs
  17. 4
      com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/box/box.cs
  18. 4
      com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/flex/flex.cs
  19. 4
      com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/flex/utils.cs
  20. 4
      com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/layout_explorer.cs
  21. 4
      com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/ui/arrow.cs
  22. 4
      com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/ui/dimension.cs
  23. 4
      com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/ui/free_space.cs
  24. 4
      com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/ui/layout_explorer_widget.cs
  25. 4
      com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/ui/overflow_indicator_painter.cs
  26. 4
      com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/ui/theme.cs
  27. 4
      com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/ui/utils.cs
  28. 4
      com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/ui/widget_constraints.cs
  29. 4
      com.unity.uiwidgets.devtools/Editor/listenable.cs
  30. 4
      com.unity.uiwidgets.devtools/Editor/main.cs
  31. 4
      com.unity.uiwidgets.devtools/Editor/screen.cs
  32. 4
      com.unity.uiwidgets.devtools/Editor/theme.cs
  33. 4
      com.unity.uiwidgets.devtools/Editor/ui/icons.cs
  34. 4
      com.unity.uiwidgets.devtools/Editor/utils.cs
  35. 303
      com.unity.uiwidgets.devtools/Editor/v2/dependencies/nested/nested.cs
  36. 18
      com.unity.uiwidgets.devtools/Editor/v2/dependencies/provider/inherited_provider.cs
  37. 7
      com.unity.uiwidgets.devtools/Editor/v2/dependencies/provider/provider.cs
  38. 7
      com.unity.uiwidgets.devtools/Editor/v2/devtools.cs
  39. 21
      com.unity.uiwidgets.devtools/Editor/v2/main.cs
  40. 216
      com.unity.uiwidgets.devtools/Editor/v2/src/app.cs
  41. 12
      com.unity.uiwidgets.devtools/Editor/v2/src/config_specific/framework_initialize/framework_initialize.cs
  42. 15
      com.unity.uiwidgets.devtools/Editor/v2/src/globals.cs
  43. 20
      com.unity.uiwidgets.devtools/Editor/v2/src/preferences.cs
  44. 61
      com.unity.uiwidgets.devtools/Editor/v2/src/screen.cs
  45. 18
      com.unity.uiwidgets.devtools/Editor/v2/src/service_manager.cs
  46. 11
      com.unity.uiwidgets.devtools/Editor/v2/src/snapshot_screen.cs
  47. 66
      com.unity.uiwidgets.devtools/Editor/v2/src/theme.cs

4
com.unity.uiwidgets.devtools/Editor/analytics/provider.cs


namespace Unity.UIWidgets.DevTools.analytics
/*namespace Unity.UIWidgets.DevTools.analytics
{
public abstract class AnalyticsProvider {
private bool isGtagsEnabled

public abstract void setAllowAnalytics();
public abstract void setDontAllowAnalytics();
}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/analytics/stub_provider.cs


using Unity.UIWidgets.async2;
/*using Unity.UIWidgets.async2;
namespace Unity.UIWidgets.DevTools.analytics
{

}
}*/

306
com.unity.uiwidgets.devtools/Editor/app.cs


using System;
/*using System;
using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.async2;

}
}
/*public class OpenAboutAction : StatelessWidget {
////public class OpenAboutAction : StatelessWidget {
public override Widget build(BuildContext context) {
return DevToolsTooltip(
tooltip: "About DevTools",
child: new InkWell(
onTap: () => {
unawaited(showDialog(
context: context,
builder: (context2) => new DevToolsAboutDialog()
));
},
child: new Container(
width: DevToolsScaffold.actionWidgetSize,
height: DevToolsScaffold.actionWidgetSize,
alignment: Alignment.center,
child: new Icon(
Icons.help_outline,
size: actionsIconSize
)
)
)
);
}
}
//// public override Widget build(BuildContext context) {
////return DevToolsTooltip(
////tooltip: "About DevTools",
////child: new InkWell(
////onTap: () => {
////unawaited(showDialog(
////context: context,
////builder: (context2) => new DevToolsAboutDialog()
////));
////},
////child: new Container(
////width: DevToolsScaffold.actionWidgetSize,
////height: DevToolsScaffold.actionWidgetSize,
////alignment: Alignment.center,
////child: new Icon(
////Icons.help_outline,
////size: actionsIconSize
////)
//// )
//// )
//// );
//// }
////}
public class OpenSettingsAction : StatelessWidget {
public override Widget build(BuildContext context) {
return DevToolsTooltip(
tooltip: "Settings",
child: new InkWell(
onTap: () => {
unawaited(showDialog(
context: context,
builder: (context2) => new SettingsDialog()
));
},
child: new Container(
width: DevToolsScaffold.actionWidgetSize,
height: DevToolsScaffold.actionWidgetSize,
alignment: Alignment.center,
child: new Icon(
Icons.settings,
size: actionsIconSize
)
)
)
);
}
}
////public class OpenSettingsAction : StatelessWidget {
////
////public override Widget build(BuildContext context) {
////return DevToolsTooltip(
////tooltip: "Settings",
////child: new InkWell(
//// onTap: () => {
//// unawaited(showDialog(
//// context: context,
//// builder: (context2) => new SettingsDialog()
//// ));
//// },
//// child: new Container(
//// width: DevToolsScaffold.actionWidgetSize,
//// height: DevToolsScaffold.actionWidgetSize,
//// alignment: Alignment.center,
//// child: new Icon(
//// Icons.settings,
//// size: actionsIconSize
//// )
//// )
//// )
////);
//// }
////}
public class DevToolsAboutDialog : StatelessWidget {
////public class DevToolsAboutDialog : StatelessWidget {
public override Widget build(BuildContext context) {
var theme = Theme.of(context);
////public override Widget build(BuildContext context) {
////var theme = Theme.of(context);
List<Widget> widgets = new List<Widget>();
widgets.Add(new SizedBox(height: defaultSpacing));
List<Widget> temp = dialogSubHeader(theme, "Feedback");
foreach (var widget in temp)
{
widgets.Add(widget);
}
widgets.Add(new Wrap(
children: new List<Widget>{
new Text("Encountered an issue? Let us know at "),
_createFeedbackLink(context),
new Text(".")
}
));
////List<Widget> widgets = new List<Widget>();
////widgets.Add(new SizedBox(height: defaultSpacing));
////List<Widget> temp = dialogSubHeader(theme, "Feedback");
////foreach (var widget in temp)
////{
////widgets.Add(widget);
////}
////widgets.Add(new Wrap(
////children: new List<Widget>{
//// new Text("Encountered an issue? Let us know at "),
//// _createFeedbackLink(context),
//// new Text(".")
////}
////));
return DevToolsDialog(
title: dialogTitleText(theme, "About DevTools"),
content: new Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: widgets
),
actions: [
DialogCloseButton(),
],
);
}
Widget _aboutDevTools(BuildContext context) {
return const SelectableText('DevTools version ${devtools.version}');
}
////return DevToolsDialog(
////title: dialogTitleText(theme, "About DevTools"),
////content: new Column(
//// mainAxisSize: MainAxisSize.min,
//// crossAxisAlignment: CrossAxisAlignment.start,
//// children: widgets
//// ),
////actions: [
//// DialogCloseButton(),
//// ],
////);
////}
Widget _createFeedbackLink(BuildContext context) {
const urlPath = 'github.com/flutter/devtools/issues';
final colorScheme = Theme.of(context).colorScheme;
return InkWell(
onTap: () async {
ga.select(devToolsMain, feedback);
////Widget _aboutDevTools(BuildContext context) {
////return const SelectableText('DevTools version ${devtools.version}');
////}
const reportIssuesUrl = 'https://$urlPath';
await launchUrl(reportIssuesUrl, context);
},
child: Text(urlPath, style: linkTextStyle(colorScheme)),
);
}
}
////Widget _createFeedbackLink(BuildContext context) {
////const urlPath = 'github.com/flutter/devtools/issues';
////final colorScheme = Theme.of(context).colorScheme;
////return InkWell(
////onTap: () async {
//// ga.select(devToolsMain, feedback);
////
//// const reportIssuesUrl = 'https://$urlPath';
//// await launchUrl(reportIssuesUrl, context);
////},
////child: Text(urlPath, style: linkTextStyle(colorScheme)),
////);
////}
////}
TODO(kenz): merge the checkbox functionality here with [NotifierCheckbox]
class SettingsDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
return DevToolsDialog(
title: dialogTitleText(Theme.of(context), 'Settings'),
content: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildOption(
label: const Text('Use a dark theme'),
listenable: preferences.darkModeTheme,
toggle: preferences.toggleDarkModeTheme,
),
if (isExternalBuild && isDevToolsServerAvailable)
_buildOption(
label: const Text('Enable analytics'),
listenable: ga.gaEnabledNotifier,
toggle: ga.setAnalyticsEnabled,
),
_buildOption(
label: const Text('Enable VM developer mode'),
listenable: preferences.vmDeveloperModeEnabled,
toggle: preferences.toggleVmDeveloperMode,
),
],
),
actions: [
DialogCloseButton(),
],
);
}
////TODO(kenz): merge the checkbox functionality here with [NotifierCheckbox]
////class SettingsDialog extends StatelessWidget {
////@override
////Widget build(BuildContext context) {
////return DevToolsDialog(
////title: dialogTitleText(Theme.of(context), 'Settings'),
////content: Column(
//// mainAxisSize: MainAxisSize.min,
//// crossAxisAlignment: CrossAxisAlignment.start,
//// children: [
//// _buildOption(
//// label: const Text('Use a dark theme'),
//// listenable: preferences.darkModeTheme,
//// toggle: preferences.toggleDarkModeTheme,
//// ),
//// if (isExternalBuild && isDevToolsServerAvailable)
//// _buildOption(
//// label: const Text('Enable analytics'),
//// listenable: ga.gaEnabledNotifier,
//// toggle: ga.setAnalyticsEnabled,
//// ),
//// _buildOption(
//// label: const Text('Enable VM developer mode'),
//// listenable: preferences.vmDeveloperModeEnabled,
//// toggle: preferences.toggleVmDeveloperMode,
//// ),
//// ],
//// ),
////actions: [
//// DialogCloseButton(),
//// ],
////);
////}
Widget _buildOption({
Text label,
ValueListenable<bool> listenable,
Function(bool) toggle,
}) {
return InkWell(
onTap: () => toggle(!listenable.value),
child: Row(
children: [
ValueListenableBuilder<bool>(
valueListenable: listenable,
builder: (context, value, _) {
return Checkbox(
value: value,
onChanged: toggle,
);
},
),
label,
],
),
);
}*/
}
////Widget _buildOption({
////Text label,
////ValueListenable<bool> listenable,
////Function(bool) toggle,
////}) {
////return InkWell(
////onTap: () => toggle(!listenable.value),
////child: Row(
//// children: [
//// ValueListenableBuilder<bool>(
//// valueListenable: listenable,
//// builder: (context, value, _) {
//// return Checkbox(
//// value: value,
//// onChanged: toggle,
//// );
//// },
//// ),
//// label,
//// ],
//// ),
////);
////}
}*/

4
com.unity.uiwidgets.devtools/Editor/config_specific/ide_theme/ide_theme.cs


using Unity.UIWidgets.ui;
/*using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.DevTools.config_specific.ide_theme
{

public readonly Color foregroundColor;
public readonly float? fontSize;
}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/enum_utils.cs


using System.Collections.Generic;
/*using System.Collections.Generic;
using Unity.UIWidgets.foundation;
namespace Unity.UIWidgets.DevTools

string name(T enumEntry) => _reverseLookupTable[enumEntry];
}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/globals.cs


using System;
/*using System;
using System.Collections.Generic;
namespace Unity.UIWidgets.DevTools

// globals[clazz] = instance;
// }
}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/inspector/diagnostics.cs


using System;
/*using System;
using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.DevTools.inspector;

}
}
}*/

53
com.unity.uiwidgets.devtools/Editor/inspector/diagnostics_node.cs


using System;
/*using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;

Future<string> _createPropertyDocFuture() {
// TODO(jacobr): We need access to the analyzer to support this feature.
/*
if (parent != null) {
DartVmServiceValue vmValue = inspectorService.toDartVmServiceValueForSourceLocation(parent.getValueRef());
if (vmValue == null) {
return null;
}
return inspectorService.getPropertyLocation(vmValue.getInstanceRef(), getName())
.thenApplyAsync((XSourcePosition sourcePosition) -> {
if (sourcePosition != null) {
final VirtualFile file = sourcePosition.getFile();
final int offset = sourcePosition.getOffset();
////
////if (parent != null) {
////DartVmServiceValue vmValue = inspectorService.toDartVmServiceValueForSourceLocation(parent.getValueRef());
////if (vmValue == null) {
////return null;
////}
////return inspectorService.getPropertyLocation(vmValue.getInstanceRef(), getName())
//// .thenApplyAsync((XSourcePosition sourcePosition) -> {
////if (sourcePosition != null) {
////final VirtualFile file = sourcePosition.getFile();
////final int offset = sourcePosition.getOffset();
final Project project = getProject(file);
if (project != null) {
final List<HoverInformation> hovers =
DartAnalysisServerService.getInstance(project).analysis_getHover(file, offset);
if (!hovers.isEmpty()) {
return hovers.get(0).getDartdoc();
}
}
}
return 'Unable to find property source';
});
});
}
*/
////final Project project = getProject(file);
////if (project != null) {
////final List<HoverInformation> hovers =
////DartAnalysisServerService.getInstance(project).analysis_getHover(file, offset);
////if (!hovers.isEmpty()) {
////return hovers.get(0).getDartdoc();
////}
////}
////}
////return 'Unable to find property source';
////});
////});
////}
return Future.value("Unable to find property source").to<string>();
}

public readonly int line;
public readonly int column;
}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/inspector/flutter_widget.cs


using System;
/*using System;
using System.Collections.Generic;
using Unity.UIWidgets.DevTools.ui;
using Unity.UIWidgets.foundation;

}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/inspector/inspector_controller.cs


using System;
/*using System;
using System.Collections.Generic;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.DevTools.inspector;

);
}
}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/inspector/inspector_data_models.cs


using System;
/*using System;
using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.DevTools;

}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/inspector/inspector_screen.cs


using System;
/*using System;
using System.Collections.Generic;
using Unity.UIWidgets.DevTools.inspector;
using Unity.UIWidgets.DevTools.ui;

}
}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/inspector/inspector_screen_details_tab.cs


using System;
/*using System;
using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;

}
}
}*/

66
com.unity.uiwidgets.devtools/Editor/inspector/inspector_service.cs


using System;
/*using System;
using System.Collections.Generic;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.DevTools.inspector;

return invokeServiceMethodReturningNode('getRootRenderObject');
}
/* TODO(jacobr): this probably isn't needed.
Future<List<DiagnosticsPathNode>> getParentChain(DiagnosticsNode target) async {
if (disposed) return null;
if (useDaemonApi) {
return parseDiagnosticsPathDaemon(invokeServiceMethodDaemon('getParentChain', target.getValueRef()));
}
else {
return parseDiagnosticsPathObservatory(invokeServiceMethodObservatory('getParentChain', target.getValueRef()));
}
});
}
//// TODO(jacobr): this probably isn't needed.
////Future<List<DiagnosticsPathNode>> getParentChain(DiagnosticsNode target) async {
////if (disposed) return null;
////if (useDaemonApi) {
////return parseDiagnosticsPathDaemon(invokeServiceMethodDaemon('getParentChain', target.getValueRef()));
////}
////else {
////return parseDiagnosticsPathObservatory(invokeServiceMethodObservatory('getParentChain', target.getValueRef()));
////}
////});
////}
Future<List<DiagnosticsPathNode>> parseDiagnosticsPathObservatory(Future<InstanceRef> instanceRefFuture) {
return nullIfDisposed(() -> instanceRefFuture.thenComposeAsync(this::parseDiagnosticsPathObservatory));
}
////Future<List<DiagnosticsPathNode>> parseDiagnosticsPathObservatory(Future<InstanceRef> instanceRefFuture) {
////return nullIfDisposed(() -> instanceRefFuture.thenComposeAsync(this::parseDiagnosticsPathObservatory));
////}
Future<List<DiagnosticsPathNode>> parseDiagnosticsPathObservatory(InstanceRef pathRef) {
return nullIfDisposed(() -> instanceRefToJson(pathRef).thenApplyAsync(this::parseDiagnosticsPathHelper));
}
////Future<List<DiagnosticsPathNode>> parseDiagnosticsPathObservatory(InstanceRef pathRef) {
////return nullIfDisposed(() -> instanceRefToJson(pathRef).thenApplyAsync(this::parseDiagnosticsPathHelper));
////}
Future<List<DiagnosticsPathNode>> parseDiagnosticsPathDaemon(Future<JsonElement> jsonFuture) {
return nullIfDisposed(() -> jsonFuture.thenApplyAsync(this::parseDiagnosticsPathHelper));
}
////Future<List<DiagnosticsPathNode>> parseDiagnosticsPathDaemon(Future<JsonElement> jsonFuture) {
////return nullIfDisposed(() -> jsonFuture.thenApplyAsync(this::parseDiagnosticsPathHelper));
////}
////List<DiagnosticsPathNode> parseDiagnosticsPathHelper(JsonElement jsonElement) {
////return nullValueIfDisposed(() -> {
////final JsonArray jsonArray = jsonElement.getAsJsonArray();
////final List<DiagnosticsPathNode> pathNodes = new List<>();
////for (JsonElement element : jsonArray) {
////pathNodes.add(new DiagnosticsPathNode(element.getAsJsonObject(), this));
////}
////return pathNodes;
////});
////}
List<DiagnosticsPathNode> parseDiagnosticsPathHelper(JsonElement jsonElement) {
return nullValueIfDisposed(() -> {
final JsonArray jsonArray = jsonElement.getAsJsonArray();
final List<DiagnosticsPathNode> pathNodes = new List<>();
for (JsonElement element : jsonArray) {
pathNodes.add(new DiagnosticsPathNode(element.getAsJsonObject(), this));
}
return pathNodes;
});
}
*/
Future<RemoteDiagnosticsNode> getSelection(
RemoteDiagnosticsNode previousSelection,

// }
// }
}
}*/

4
com.unity.uiwidgets.devtools/Editor/inspector/inspector_text_style.cs


using uiwidgets;
/*using uiwidgets;
using Unity.UIWidgets.material;
using Unity.UIWidgets.ui;
using TextStyle = Unity.UIWidgets.painting.TextStyle;

fontStyle: FontStyle.italic
));
}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/inspector/inspector_tree.cs


using System;
/*using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

}
}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/box/box.cs


using System;
/*using System;
using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.DevTools.inspector.layout_explorer.ui;

);
}
}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/flex/flex.cs


using System;
/*using System;
using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.animation;

}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/flex/utils.cs


using System;
/*using System;
using System.Collections.Generic;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.DevTools.inspector.layout_explorer.ui;

}
*/

4
com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/layout_explorer.cs


using Unity.UIWidgets.DevTools.inspector.layout_explorer.box;
/*using Unity.UIWidgets.DevTools.inspector.layout_explorer.box;
using Unity.UIWidgets.DevTools.inspector.layout_explorer.flex;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.rendering;

}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/ui/arrow.cs


using System.Collections.Generic;
/*using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;

}
}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/ui/dimension.cs


using Unity.UIWidgets.material;
/*using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;

return text;
}
}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/ui/free_space.cs


using System.Collections.Generic;
/*using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;

}
}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/ui/layout_explorer_widget.cs


using System;
/*using System;
using System.Collections.Generic;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;

}
}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/ui/overflow_indicator_painter.cs


using System.Collections.Generic;
/*using System.Collections.Generic;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;

}
}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/ui/theme.cs


using uiwidgets;
/*using uiwidgets;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;

}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/ui/utils.cs


using System;
/*using System;
using System.Collections.Generic;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.DevTools;

}
}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/inspector/layout_explorer/ui/widget_constraints.cs


using System.Collections.Generic;
/*using System.Collections.Generic;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.widgets;

}
}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/listenable.cs


using Unity.UIWidgets.foundation;
/*using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;

public T value => _value; // public override T value => _value;
}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/main.cs


using Unity.UIWidgets.DevTools.analytics;
/*using Unity.UIWidgets.DevTools.analytics;
using Unity.UIWidgets.DevTools.config_specific.ide_theme;
using Unity.UIWidgets.Editor;
using Unity.UIWidgets.widgets;

ui_.runApp(new DevToolsApp(appUtils.defaultScreens, ideTheme, stub_provider.analyticsProvider));
}
}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/screen.cs


using System;
/*using System;
using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.async2;

}
}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/theme.cs


using System;
/*using System;
using uiwidgets;
using Unity.UIWidgets.DevTools.config_specific.ide_theme;
using Unity.UIWidgets.DevTools.inspector.layout_explorer.ui;

// }
}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/ui/icons.cs


using System;
/*using System;
using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.DevTools.ui;

public static readonly IconData dashboard = new IconData(61733, fontFamily: "Octicons");
public static readonly IconData pulse = new IconData(61823, fontFamily: "Octicons");
}
}
}*/

4
com.unity.uiwidgets.devtools/Editor/utils.cs


using System.Collections.Generic;
/*using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;

}
}
}
}*/

303
com.unity.uiwidgets.devtools/Editor/v2/dependencies/nested/nested.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.widgets;
namespace Unity.UIWidgets.DevTools
{
public class Nested : StatelessWidget
{
public Nested(
Key key = null,
List<SingleChildWidget> children = null,
Widget child = null
) : base(key: key)
{
D.assert(children != null && children.isNotEmpty());
this._children = children;
this._child = child;
}
public readonly List<SingleChildWidget> _children;
public readonly Widget _child;
public override Widget build(BuildContext context)
{
throw new Exception("implemented internally");
}
public override Element createElement()
{
return new _NestedElement(this);
}
}
public class _NestedElement : StatelessElement {
public _NestedElement(Nested widget) : base(widget)
{
}
//SingleChildWidgetElementMixin
_NestedHookElement _parent;
public override void mount(Element parent, object newSlot)
{
if (parent is _NestedHookElement) {
_parent = parent as _NestedHookElement;
}
base.mount(parent, newSlot);
}
public override void activate() {
base.activate();
visitAncestorElements((parent) => {
if (parent is _NestedHookElement) {
_parent = parent as _NestedHookElement;
}
return false;
});
}
//end of SingleChildWidgetElementMixin
public readonly List<_NestedHookElement> nodes = new List<_NestedHookElement>();
Nested nested_widget => base.widget as Nested;
protected override Widget build()
{
_NestedHook nestedHook = null;
var nextNode = _parent?.injectedChild ?? nested_widget._child;
for (int i= nested_widget._children.Count - 1; i >=0 ; i--)
{
var child = nested_widget._children[i];
nextNode = nestedHook = new _NestedHook(
owner: this,
wrappedWidget: child,
injectedChild: nextNode
);
}
if (nestedHook != null) {
foreach (var node in nodes) {
node.wrappedChild = nestedHook.wrappedWidget;
node.injectedChild = nestedHook.injectedChild;
var next = nestedHook.injectedChild;
if (next is _NestedHook) {
nestedHook = next as _NestedHook;
} else {
break;
}
}
}
return nextNode;
}
}
public class _NestedHook : StatelessWidget
{
public _NestedHook(
Widget injectedChild = null,
SingleChildWidget wrappedWidget = null,
_NestedElement owner = null
)
{
D.assert(wrappedWidget != null);
D.assert(owner != null);
this.injectedChild = injectedChild;
this.wrappedWidget = wrappedWidget;
this.owner = owner;
}
public readonly SingleChildWidget wrappedWidget;
public readonly Widget injectedChild;
public readonly _NestedElement owner;
public override Element createElement() => new _NestedHookElement(this);
public override Widget build(BuildContext context) => throw new Exception("handled internally");
}
public class _NestedHookElement : StatelessElement {
public _NestedHookElement(_NestedHook widget) : base(widget){}
_NestedHook nested_widget => base.widget as _NestedHook;
Widget _injectedChild;
internal Widget injectedChild
{
get { return _injectedChild; }
set
{
var previous = _injectedChild;
if (value is _NestedHook &&
previous is _NestedHook &&
Widget.canUpdate(((_NestedHook)value).wrappedWidget, ((_NestedHook)previous).wrappedWidget)) {
return;
}
if (previous != value) {
_injectedChild = value;
visitChildren((e) => e.markNeedsBuild());
}
}
}
SingleChildWidget _wrappedChild;
internal SingleChildWidget wrappedChild
{
get { return _wrappedChild; }
set
{
if (_wrappedChild != value) {
_wrappedChild = value;
markNeedsBuild();
}
}
}
public override void mount(Element parent, object newSlot) {
nested_widget.owner.nodes.Add(this);
_wrappedChild = nested_widget.wrappedWidget;
_injectedChild = nested_widget.injectedChild;
base.mount(parent, newSlot);
}
public override void unmount() {
nested_widget.owner.nodes.Remove(this);
base.unmount();
}
protected override Widget build() {
return wrappedChild;
}
}
public abstract class SingleChildWidget : Widget {
public abstract override Element createElement();
}
public abstract class SingleChildStatelessWidget : StatelessWidget
{
public SingleChildStatelessWidget(Key key = null, Widget child = null) : base(key : key)
{
_child = child;
}
public readonly Widget _child;
protected internal abstract Widget buildWithChild(BuildContext context, Widget child);
public override Widget build(BuildContext context) => buildWithChild(context, _child);
public override Element createElement() {
return new SingleChildStatelessElement(this);
}
}
class SingleChildStatelessElement : StatelessElement {
public SingleChildStatelessElement(SingleChildStatelessWidget widget)
: base(widget)
{
}
//SingleChildWidgetElementMixin
_NestedHookElement _parent;
public override void mount(Element parent, object newSlot)
{
if (parent is _NestedHookElement) {
_parent = parent as _NestedHookElement;
}
base.mount(parent, newSlot);
}
public override void activate() {
base.activate();
visitAncestorElements((parent) => {
if (parent is _NestedHookElement) {
_parent = parent as _NestedHookElement;
}
return false;
});
}
//end of SingleChildWidgetElementMixin
protected override Widget build() {
if (_parent != null) {
return nested_widget.buildWithChild(this, _parent.injectedChild);
}
return base.build();
}
SingleChildStatelessWidget nested_widget =>
base.widget as SingleChildStatelessWidget;
}
public abstract class SingleChildStatefulWidget : StatefulWidget {
public SingleChildStatefulWidget(Key key = null, Widget child = null) : base(key: key)
{
_child = child;
}
public readonly Widget _child;
public override Element createElement() {
return new SingleChildStatefulElement(this);
}
}
public abstract class SingleChildState<T> : State<T> where T : SingleChildStatefulWidget
{
protected internal abstract Widget buildWithChild(BuildContext context, Widget child);
public override Widget build(BuildContext context) => buildWithChild(context, widget._child);
}
public class SingleChildStatefulElement : StatefulElement
{
public SingleChildStatefulElement(SingleChildStatefulWidget widget) : base(widget)
{
}
//SingleChildWidgetElementMixin
_NestedHookElement _parent;
public override void mount(Element parent, object newSlot)
{
if (parent is _NestedHookElement) {
_parent = parent as _NestedHookElement;
}
base.mount(parent, newSlot);
}
public override void activate() {
base.activate();
visitAncestorElements((parent) => {
if (parent is _NestedHookElement) {
_parent = parent as _NestedHookElement;
}
return false;
});
}
//end of SingleChildWidgetElementMixin
SingleChildStatefulWidget nested_widget =>
base.widget as SingleChildStatefulWidget;
SingleChildState<SingleChildStatefulWidget> nested_state =>
base.state as SingleChildState<SingleChildStatefulWidget>;
protected override Widget build() {
if (_parent != null) {
return nested_state.buildWithChild(this, _parent.injectedChild);
}
return base.build();
}
}
}

18
com.unity.uiwidgets.devtools/Editor/v2/dependencies/provider/inherited_provider.cs


using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
namespace Unity.UIWidgets.DevTools
{
delegate bool UpdateShouldNotify<T>(T previous, T current);
delegate T Create<T>(BuildContext context);
delegate void Dispose<T>(BuildContext context, T value);
delegate VoidCallback StartListening<T>(InheritedContext<T> element, T value);
public class InheritedProvider<T> : SingleChildStatelessWidget
{
}
}

7
com.unity.uiwidgets.devtools/Editor/v2/dependencies/provider/provider.cs


namespace Unity.UIWidgets.DevTools
{
public class Privoder<T> : InheritedProvider<T>
{
}
}

7
com.unity.uiwidgets.devtools/Editor/v2/devtools.cs


namespace Unity.UIWidgets.DevTools
{
public static class DevtoolVersion
{
public static string Version = "0.8.0+1";
}
}

21
com.unity.uiwidgets.devtools/Editor/v2/main.cs


using Unity.UIWidgets.DevTools.config_specific.framework_initialize;
using Unity.UIWidgets.Editor;
using Unity.UIWidgets.widgets;
namespace Unity.UIWidgets.DevTools
{
public class Devetool : UIWidgetsEditorPanel
{
protected override void main()
{
var preferences = new PreferencesController();
preferences.init();
FrameworkInitializeUtils.initializeFramework();
ui_.runApp(
new DevToolsApp(defaultScreens, preferences)
);
}
}
}

216
com.unity.uiwidgets.devtools/Editor/v2/src/app.cs


using System;
using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.widgets;
namespace Unity.UIWidgets.DevTools
{
static class AppUtils
{
public static string homeRoute = "/";
public static string snapshotRoute = "/snapshot";
}
class DevToolsApp : StatefulWidget {
public DevToolsApp(List<DevToolsScreen<object>> screens, PreferencesController preferences)
{
this.screens = screens;
this.preferences = preferences;
}
public readonly List<DevToolsScreen<object>> screens;
public readonly PreferencesController preferences;
public override State createState() => new DevToolsAppState();
public static DevToolsAppState of(BuildContext context) {
return context.findAncestorStateOfType<DevToolsAppState>();
}
}
class DevToolsAppState : State<DevToolsApp> {
List<Screen> _screens => widget.screens.Select(s => s.screen).ToList();
PreferencesController preferences => widget.preferences;
public override void initState() {
base.initState();
Globals.serviceManager.isolateManager.onSelectedIsolateChanged.listen((_) => {
setState(() => {
_clearCachedRoutes();
});
});
}
public override void didUpdateWidget(StatefulWidget oldWidget) {
base.didUpdateWidget(oldWidget);
_clearCachedRoutes();
}
/// Generates routes, separating the path from URL query parameters.
Route _generateRoute(RouteSettings settings) {
var uri = settings.name;
var path = uri.isEmpty() ? AppUtils.homeRoute : uri;
var args = settings.arguments as SnapshotArguments;
// Provide the appropriate page route.
if (routes.ContainsKey(path)) {
WidgetBuilder builder = (context) => routes[path](
context,
uri.queryParameters,
args
);
D.assert(() => {
builder = (context) => new _AlternateCheckedModeBanner(
builder: (subContext) => routes[path](
subContext,
uri.queryParameters,
args
)
);
return true;
}());
return new MaterialPageRoute(settings: settings, builder: builder);
}
// Return a page not found.
return new MaterialPageRoute(
settings: settings,
builder: (BuildContext context) => {
return DevToolsScaffold.withChild(
child: new CenteredMessage("'$uri' not found.")
);
}
);
}
/// The routes that the app exposes.
Dictionary<string, UrlParametersBuilder> routes => {
_routes = _routes ?? new Dictionary<string, UrlParametersBuilder>(){
{AppUtils.homeRoute, (_, buildParam, __) => {
if (buildParam.getOrDefault("uri")?.isNotEmpty() ?? false) {
var embed = buildParam["embed"] == "true";
var page = buildParam["page"];
var tabs = embed && page != null
? _visibleScreens().Where((p) => p.screenId == page)
: _visibleScreens();
return new Initializer(
url: buildParam["uri"],
allowConnectionScreenOnDisconnect: !embed,
builder: (_) => _providedControllers(
child: new DevToolsScaffold(
embed: embed,
initialPage: page,
tabs: tabs,
actions: [
if (serviceManager.connectedApp.isFlutterAppNow) ...[
HotReloadButton(),
HotRestartButton(),
],
OpenSettingsAction(),
OpenAboutAction(),
],
),
),
);
} else {
return DevToolsScaffold.withChild(child: ConnectScreenBody());
}
},
snapshotRoute: (_, __, args) => {
return DevToolsScaffold.withChild(
child: _providedControllers(
offline: true,
child: SnapshotScreenBody(args, _screens),
),
);
},
}};
return _routes;
}
Dictionary<string, UrlParametersBuilder> _routes;
void _clearCachedRoutes() {
_routes = null;
}
List<Screen> _visibleScreens() {
var visibleScreens = new List<Screen>();
foreach (var screen in _screens) {
if (screen.conditionalLibrary != null) {
if (Globals.serviceManager.isServiceAvailable &&
Globals.serviceManager
.isolateManager.selectedIsolateAvailable.isCompleted &&
Globals.serviceManager.libraryUriAvailableNow(screen.conditionalLibrary)) {
visibleScreens.Add(screen);
}
} else {
visibleScreens.Add(screen);
}
}
return visibleScreens;
}
Widget _providedControllers(Widget child, bool offline = false)
{
var _providers = widget.screens
.Where((s) =>
s.createController != null && (offline ? s.supportsOffline : true))
.Select((s) => s.controllerProvider);
return new MultiProvider(
providers: _providers,
child: child
);
}
public override Widget build(BuildContext context) {
return new ValueListenableBuilder<bool>(
valueListenable: widget.preferences.darkModeTheme,
builder: (subContext, value, _) => {
return new MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeUtils.themeFor(isDarkTheme: value),
builder: (subsubContext, child) => new Notifications(child: child),
onGenerateRoute: _generateRoute
);
}
);
}
}
class DevToolsScreen<C> {
public DevToolsScreen(
Screen screen,
Func<C> createController,
bool supportsOffline = false
)
{
this.screen = screen;
this.createController = createController;
this.supportsOffline = supportsOffline;
}
public readonly Screen screen;
public readonly Func<C> createController;
public readonly bool supportsOffline;
internal Provider<C> controllerProvider => {
D.assert(createController != null);
return new Provider<C>(create: (_) => createController());
}
}
public delegate Widget UrlParametersBuilder(
BuildContext buildContext,
Dictionary<string, string> route,
SnapshotArguments args
);
}

12
com.unity.uiwidgets.devtools/Editor/v2/src/config_specific/framework_initialize/framework_initialize.cs


using UnityEngine;
namespace Unity.UIWidgets.DevTools.config_specific.framework_initialize
{
public static class FrameworkInitializeUtils
{
public static void initializeFramework()
{
Debug.Log("empty initializeFramework");
}
}
}

15
com.unity.uiwidgets.devtools/Editor/v2/src/globals.cs


using System;
using System.Collections.Generic;
namespace Unity.UIWidgets.DevTools
{
public static class Globals
{
public static bool offlineMode = false;
static Dictionary<Type, object> globals = new Dictionary<Type, object>();
public static ServiceConnectionManager serviceManager =>
globals[typeof(ServiceConnectionManager)] as ServiceConnectionManager;
}
}

20
com.unity.uiwidgets.devtools/Editor/v2/src/preferences.cs


using Unity.UIWidgets.foundation;
using UnityEngine;
namespace Unity.UIWidgets.DevTools
{
public class PreferencesController
{
readonly ValueNotifier<bool> _darkModeTheme = new ValueNotifier<bool>(true);
public ValueListenable<bool> darkModeTheme => _darkModeTheme;
public void init()
{
Debug.Log("PreferencesController: storage not initialized");
}
public void toggleDarkModeTheme(bool useDarkMode) {
_darkModeTheme.value = useDarkMode;
}
}
}

61
com.unity.uiwidgets.devtools/Editor/v2/src/screen.cs


using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.widgets;
namespace Unity.UIWidgets.DevTools
{
public abstract class Screen {
public Screen(
string screenId,
string title = null,
IconData icon = null,
Key tabKey = null,
string conditionalLibrary = null
)
{
this.screenId = screenId;
this.title = title;
this.icon = icon;
this.tabKey = tabKey;
this.conditionalLibrary = conditionalLibrary;
}
public readonly string screenId;
public readonly string title;
public readonly IconData icon;
public readonly Key tabKey;
public readonly string conditionalLibrary;
public bool showIsolateSelector => false;
public string docPageId => null;
Widget buildTab(BuildContext context) {
return new Tab(
key: tabKey,
child: new Row(
children: new List<Widget>{
new Icon(icon, size: ThemeUtils.defaultIconSize),
new Padding(
padding: EdgeInsets.only(left: 8.0f),
child: new Text(title)
),
}
)
);
}
protected abstract Widget build(BuildContext context);
Widget buildStatus(BuildContext context, TextTheme textTheme) {
return null;
}
}
}

18
com.unity.uiwidgets.devtools/Editor/v2/src/service_manager.cs


namespace Unity.UIWidgets.DevTools
{
public class ServiceConnectionManager
{
public ServiceConnectionManager()
{
_isolateManager = new IsolateManager();
}
public IsolateManager isolateManager => _isolateManager;
IsolateManager _isolateManager;
}
public class IsolateManager
{
}
}

11
com.unity.uiwidgets.devtools/Editor/v2/src/snapshot_screen.cs


namespace Unity.UIWidgets.DevTools
{
public class SnapshotArguments {
public SnapshotArguments(string screenId)
{
this.screenId = screenId;
}
public readonly string screenId;
}
}

66
com.unity.uiwidgets.devtools/Editor/v2/src/theme.cs


using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.DevTools
{
public class ThemeUtils
{
public static ThemeData themeFor(bool isDarkTheme) {
return isDarkTheme ? _darkTheme() : _lightTheme();
}
static ThemeData _darkTheme() {
var theme = ThemeData.dark();
return theme.copyWith(
primaryColor: devtoolsGrey[900],
primaryColorDark: devtoolsBlue[700],
primaryColorLight: devtoolsBlue[400],
indicatorColor: devtoolsBlue[400],
accentColor: devtoolsBlue[400],
backgroundColor: devtoolsGrey[600],
toggleableActiveColor: devtoolsBlue[400],
selectedRowColor: devtoolsGrey[600],
buttonTheme: theme.buttonTheme.copyWith(minWidth: buttonMinWidth)
);
}
static ThemeData _lightTheme() {
var theme = ThemeData.light();
return theme.copyWith(
primaryColor: devtoolsBlue[600],
primaryColorDark: devtoolsBlue[700],
primaryColorLight: devtoolsBlue[400],
indicatorColor: Colors.yellowAccent[400],
accentColor: devtoolsBlue[400],
backgroundColor: devtoolsGrey[600],
toggleableActiveColor: devtoolsBlue[400],
selectedRowColor: devtoolsBlue[600],
buttonTheme: theme.buttonTheme.copyWith(minWidth: buttonMinWidth)
);
}
public const float defaultIconSize = 16.0f;
public const float buttonMinWidth = 36.0f;
static ColorSwatch<int> devtoolsGrey = new ColorSwatch<int>(0xFF202124, new Dictionary<int, Color>(){
{900, new Color(0xFF202124)},
{600, new Color(0xFF60646B)},
{100, new Color(0xFFD5D7Da)},
{50, new Color(0xFFEAEBEC)}
});
static ColorSwatch<int> devtoolsYellow = new ColorSwatch<int>(700, new Dictionary<int, Color>(){
{700, new Color(0xFFFFC108)}
});
static ColorSwatch<int> devtoolsBlue = new ColorSwatch<int>(600, new Dictionary<int, Color>(){
{700, new Color(0xFF02569B)},
{600, new Color(0xFF0175C2)},
{400, new Color(0xFF13B9FD)},
});
}
}
正在加载...
取消
保存