Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 401
Add support for displaying coverage in CodeView#4700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -18,7 +18,7 @@ import 'debugger_controller.dart'; | ||
| class DebuggingControls extends StatefulWidget { | ||
| const DebuggingControls({Key? key}) : super(key: key); | ||
| static const minWidthBeforeScaling = 1300.0; | ||
| static const minWidthBeforeScaling = 1600.0; | ||
| @override | ||
| _DebuggingControlsState createState() => _DebuggingControlsState(); | ||
| @@ -53,6 +53,8 @@ class _DebuggingControlsState extends State<DebuggingControls> | ||
| _stepButtons(canStep: canStep), | ||
| const SizedBox(width: denseSpacing), | ||
| BreakOnExceptionsControl(controller: controller), | ||
| const SizedBox(width: denseSpacing), | ||
| CodeCoverageToggle(controller: controller), | ||
| const Expanded(child: SizedBox(width: denseSpacing)), | ||
| _librariesButton(), | ||
| ], | ||
| @@ -138,6 +140,58 @@ class _DebuggingControlsState extends State<DebuggingControls> | ||
| } | ||
| } | ||
| class CodeCoverageToggle extends StatelessWidget { | ||
| const CodeCoverageToggle({ | ||
| super.key, | ||
| required this.controller, | ||
| }); | ||
| final DebuggerController controller; | ||
| @override | ||
| Widget build(BuildContext context) { | ||
| return RoundedOutlinedBorder( | ||
| child: ValueListenableBuilder<bool>( | ||
| valueListenable: controller.codeViewController.showCodeCoverage, | ||
| builder: (context, selected, _) { | ||
| final isInSmallMode = MediaQuery.of(context).size.width < | ||
| DebuggingControls.minWidthBeforeScaling; | ||
| return Row( | ||
| children: [ | ||
| ToggleButton( | ||
| label: isInSmallMode ? null : 'Show Coverage', | ||
| message: 'Show code coverage', | ||
| icon: Codicons.checklist, | ||
| isSelected: selected, | ||
| outlined: false, | ||
| shape: const RoundedRectangleBorder( | ||
| ||
| borderRadius: BorderRadius.only( | ||
| topLeft: Radius.circular(4), | ||
| bottomLeft: Radius.circular(4), | ||
| ), | ||
| ), | ||
| onPressed: controller.codeViewController.toggleShowCodeCoverage, | ||
| ), | ||
| LeftBorder( | ||
| child: IconLabelButton( | ||
| label: '', | ||
| tooltip: 'Refresh code coverage statistics', | ||
| outlined: false, | ||
| onPressed: selected | ||
| ? controller.codeViewController.refreshCodeCoverage | ||
| : null, | ||
| minScreenWidthForTextBeforeScaling: 20000, | ||
| icon: Icons.refresh, | ||
| ), | ||
| ), | ||
| ], | ||
| ); | ||
| }, | ||
| ), | ||
| ); | ||
| } | ||
| } | ||
| class BreakOnExceptionsControl extends StatelessWidget { | ||
| const BreakOnExceptionsControl({ | ||
| Key? key, | ||
Uh oh!
There was an error while loading. Please reload this page.


Uh oh!
There was an error while loading. Please reload this page.