Skip to content

Commit

Permalink
Merge branch 'master' of github.com:flutter/devtools into shrinkwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
kenzieschmoll committed Jul 14, 2023
2 parents 15d2f5f + 5b08bf3 commit 56d3995
Show file tree
Hide file tree
Showing 15 changed files with 281 additions and 409 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ T getWidgetFromFinder<T>(Finder finder) =>
finder.first.evaluate().first.widget as T;

Finder findLineItemWithText(String text) => find.ancestor(
of: find.selectableTextContaining(text),
of: find.textContaining(text),
matching: find.byType(LineItem),
);

Expand Down
2 changes: 1 addition & 1 deletion packages/devtools_app/lib/devtools.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
// the constant declaration `const String version =`.
// If you change the declaration you must also modify the regex in
// tools/update_version.dart.
const String version = '2.26.0-dev.0';
const String version = '2.26.0-dev.2';
8 changes: 8 additions & 0 deletions packages/devtools_app/lib/src/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ class DevToolsAppState extends State<DevToolsApp> with AutoDisposeMixin {
void initState() {
super.initState();

// TODO(https://github.com/flutter/devtools/issues/6018): Once
// https://github.com/flutter/flutter/issues/129692 is fixed, disable the
// browser's native context menu on secondary-click, and instead use the
// menu provided by Flutter:
// if (kIsWeb) {
// unawaited(BrowserContextMenu.disableContextMenu());
// }

unawaited(ga.setupDimensions());

addAutoDisposeListener(serviceManager.isolateManager.mainIsolate, () {
Expand Down
51 changes: 26 additions & 25 deletions packages/devtools_app/lib/src/screens/debugger/codeview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1054,29 +1054,31 @@ class _LinesState extends State<Lines> with AutoDisposeMixin {
final pausedFrame = widget.selectedFrameNotifier?.value;
final pausedLine = pausedFrame?.line;

return ListView.builder(
controller: widget.scrollController,
physics: const ClampingScrollPhysics(),
itemExtent: CodeView.rowHeight,
itemCount: widget.lines.length,
itemBuilder: (context, index) {
final lineNum = index + 1;
final isPausedLine = pausedLine == lineNum;
return ValueListenableBuilder<int>(
valueListenable: widget.codeViewController.focusLine,
builder: (context, focusLine, _) {
final isFocusedLine = focusLine == lineNum;
return LineItem(
lineContents: widget.lines[index],
pausedFrame: isPausedLine ? pausedFrame : null,
focused: isPausedLine || isFocusedLine,
searchMatches: _searchMatchesForLine(index),
activeSearchMatch:
activeSearch?.position.line == index ? activeSearch : null,
);
},
);
},
return SelectionArea(
child: ListView.builder(
controller: widget.scrollController,
physics: const ClampingScrollPhysics(),
itemExtent: CodeView.rowHeight,
itemCount: widget.lines.length,
itemBuilder: (context, index) {
final lineNum = index + 1;
final isPausedLine = pausedLine == lineNum;
return ValueListenableBuilder<int>(
valueListenable: widget.codeViewController.focusLine,
builder: (context, focusLine, _) {
final isFocusedLine = focusLine == lineNum;
return LineItem(
lineContents: widget.lines[index],
pausedFrame: isPausedLine ? pausedFrame : null,
focused: isPausedLine || isFocusedLine,
searchMatches: _searchMatchesForLine(index),
activeSearchMatch:
activeSearch?.position.line == index ? activeSearch : null,
);
},
);
},
),
);
}

Expand Down Expand Up @@ -1243,9 +1245,8 @@ class _LineItemState extends State<LineItem>
enabled: () => true,
asyncTimeout: 100,
asyncGenerateHoverCardData: _generateHoverCardData,
child: SelectableText.rich(
child: Text.rich(
searchAwareLineContents(),
scrollPhysics: const NeverScrollableScrollPhysics(),
maxLines: 1,
),
);
Expand Down
78 changes: 40 additions & 38 deletions packages/devtools_app/lib/src/shared/console/console.dart
Original file line number Diff line number Diff line change
Expand Up @@ -179,45 +179,47 @@ class _ConsoleOutputState extends State<_ConsoleOutput>
key: _scrollBarKey,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: denseSpacing),
child: ListView.separated(
padding: const EdgeInsets.all(denseSpacing),
itemCount: _currentLines.length + (widget.footer != null ? 1 : 0),
controller: _scroll,
// Scroll physics to try to keep content within view and avoid bouncing.
physics: const ClampingScrollPhysics(
parent: RangeMaintainingScrollPhysics(),
),
separatorBuilder: (_, __) {
return const Divider();
},
itemBuilder: (context, index) {
if (index == _currentLines.length && widget.footer != null) {
return widget.footer!;
}
final line = _currentLines[index];
if (line is TextConsoleLine) {
return SelectableText.rich(
TextSpan(
// TODO(jacobr): consider caching the processed ansi terminal
// codes.
children: processAnsiTerminalCodes(
line.text,
theme.fixedFontStyle,
child: SelectionArea(
child: ListView.separated(
padding: const EdgeInsets.all(denseSpacing),
itemCount: _currentLines.length + (widget.footer != null ? 1 : 0),
controller: _scroll,
// Scroll physics to try to keep content within view and avoid bouncing.
physics: const ClampingScrollPhysics(
parent: RangeMaintainingScrollPhysics(),
),
separatorBuilder: (_, __) {
return const Divider();
},
itemBuilder: (context, index) {
if (index == _currentLines.length && widget.footer != null) {
return widget.footer!;
}
final line = _currentLines[index];
if (line is TextConsoleLine) {
return Text.rich(
TextSpan(
// TODO(jacobr): consider caching the processed ansi terminal
// codes.
children: processAnsiTerminalCodes(
line.text,
theme.fixedFontStyle,
),
),
),
);
} else if (line is VariableConsoleLine) {
return ExpandableVariable(
variable: line.variable,
);
} else {
assert(
false,
'ConsoleLine of unsupported type ${line.runtimeType} encountered',
);
return const SizedBox();
}
},
);
} else if (line is VariableConsoleLine) {
return ExpandableVariable(
variable: line.variable,
);
} else {
assert(
false,
'ConsoleLine of unsupported type ${line.runtimeType} encountered',
);
return const SizedBox();
}
},
),
),
),
);
Expand Down
Loading

0 comments on commit 56d3995

Please sign in to comment.