Skip to content

Commit 57e8424

Browse files
Focus bounds:
* Fixed bounds rect projection into debugger space * Animated focus bounds movement by default * Added a couple golden tests * Created an example project
1 parent a916020 commit 57e8424

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2115
-15
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Analyze & Test
2+
on:
3+
pull_request:
4+
workflow_dispatch:
5+
6+
jobs:
7+
analysis:
8+
runs-on: ubuntu-latest
9+
steps:
10+
# Checkout the repository
11+
- uses: actions/checkout@v3
12+
13+
# Setup Flutter environment
14+
- uses: subosito/flutter-action@v2
15+
with:
16+
channel: "stable"
17+
18+
# Download all the packages that the app uses
19+
- run: flutter pub get
20+
21+
# Run all tests
22+
- run: flutter analyze
23+
24+
test_goldens:
25+
runs-on: ubuntu-latest
26+
steps:
27+
# Checkout the repository
28+
- uses: actions/checkout@v3
29+
30+
# Setup Flutter environment
31+
- uses: subosito/flutter-action@v2
32+
with:
33+
channel: "stable"
34+
35+
# Download all the packages that the app uses
36+
- run: flutter pub get
37+
38+
# Run all tests
39+
- run: flutter test test_goldens
40+
41+
# Archive golden failures
42+
- uses: actions/upload-artifact@v4
43+
if: failure()
44+
with:
45+
name: golden-failures
46+
path: "**/failures/**/*.png"

.run/Example (debug).run.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="Example (debug)" type="FlutterRunConfigurationType" factoryName="Flutter">
3+
<option name="filePath" value="$PROJECT_DIR$/example/lib/main.dart" />
4+
<method v="2" />
5+
</configuration>
6+
</component>

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 0.1.1
2+
### Aug 9, 2025
3+
* FIX: Debug focus bounds now correctly account for `FocusDebugger` sitting somewhere other than the screen origin.
4+
* FEATURE: Debug focus bounds animate from one widget to another (can be turned off).
5+
* FEATURE: `FocusDebugger` can show/hide focus bounds and focus history, independently.
6+
* ADJUSTMENT: Created an `example` app.
7+
18
## 0.1.0
29
Initial Release:
310
* `FocusDebugger`: A widget that surrounds an entire app and paints focus debugging visuals.

example/.gitignore

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.build/
9+
.buildlog/
10+
.history
11+
.svn/
12+
.swiftpm/
13+
migrate_working_dir/
14+
15+
# IntelliJ related
16+
*.iml
17+
*.ipr
18+
*.iws
19+
.idea/
20+
21+
# The .vscode folder contains launch configuration and tasks you configure in
22+
# VS Code which you may wish to be included in version control, so this line
23+
# is commented out by default.
24+
#.vscode/
25+
26+
# Flutter/Dart/Pub related
27+
**/doc/api/
28+
**/ios/Flutter/.last_build_id
29+
.dart_tool/
30+
.flutter-plugins
31+
.flutter-plugins-dependencies
32+
.pub-cache/
33+
.pub/
34+
/build/
35+
36+
# Symbolication related
37+
app.*.symbols
38+
39+
# Obfuscation related
40+
app.*.map.json
41+
42+
# Android Studio will place build artifacts here
43+
/android/app/debug
44+
/android/app/profile
45+
/android/app/release

example/.metadata

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: "8defaa71a77c16e8547abdbfad2053ce3a6e2d5b"
8+
channel: "stable"
9+
10+
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: 8defaa71a77c16e8547abdbfad2053ce3a6e2d5b
17+
base_revision: 8defaa71a77c16e8547abdbfad2053ce3a6e2d5b
18+
- platform: macos
19+
create_revision: 8defaa71a77c16e8547abdbfad2053ce3a6e2d5b
20+
base_revision: 8defaa71a77c16e8547abdbfad2053ce3a6e2d5b
21+
22+
# User provided section
23+
24+
# List of Local paths (relative to this file) that should be
25+
# ignored by the migrate tool.
26+
#
27+
# Files that are not part of the templates will be ignored by default.
28+
unmanaged_files:
29+
- 'lib/main.dart'
30+
- 'ios/Runner.xcodeproj/project.pbxproj'

example/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Example App
2+
An example app for `flutter_focus_debugger`.

example/analysis_options.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
10+
include: package:flutter_lints/flutter.yaml
11+
12+
linter:
13+
# The lint rules applied to this project can be customized in the
14+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15+
# included above or to enable additional rules. A list of all available lints
16+
# and their documentation is published at https://dart.dev/lints.
17+
#
18+
# Instead of disabling a lint rule for the entire project in the
19+
# section below, it can also be suppressed for a single line of code
20+
# or a specific dart file by using the `// ignore: name_of_lint` and
21+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
22+
# producing the lint.
23+
rules:
24+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
25+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
26+
27+
# Additional information about this file can be found at
28+
# https://dart.dev/guides/language/analysis-options

example/lib/main.dart

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:flutter_focus_debugger/flutter_focus_debugger.dart';
3+
4+
void main() {
5+
runApp(const ExampleApp());
6+
}
7+
8+
class ExampleApp extends StatelessWidget {
9+
const ExampleApp({super.key});
10+
11+
@override
12+
Widget build(BuildContext context) {
13+
return FocusDebugger(
14+
child: MaterialApp(
15+
home: _ExampleScreen(),
16+
theme: ThemeData(brightness: Brightness.dark),
17+
debugShowCheckedModeBanner: false,
18+
),
19+
);
20+
}
21+
}
22+
23+
class _ExampleScreen extends StatefulWidget {
24+
const _ExampleScreen();
25+
26+
@override
27+
State<_ExampleScreen> createState() => _ExampleScreenState();
28+
}
29+
30+
class _ExampleScreenState extends State<_ExampleScreen> {
31+
final _backButtonFocusNode = FocusNode(debugLabel: "Back Button");
32+
final _textFieldFocusNode = FocusNode(debugLabel: "Text Field");
33+
final _buttonFocusNode = FocusNode(debugLabel: "Button");
34+
35+
@override
36+
Widget build(BuildContext context) {
37+
return Scaffold(
38+
appBar: AppBar(
39+
leading: IconButton(
40+
focusNode: _backButtonFocusNode,
41+
onPressed: () {},
42+
icon: Icon(Icons.arrow_back_ios),
43+
),
44+
title: Text("Flutter Focus Debugger"),
45+
),
46+
body: Center(
47+
child: Padding(
48+
padding: const EdgeInsets.all(48),
49+
child: Column(
50+
mainAxisSize: MainAxisSize.min,
51+
spacing: 24,
52+
children: [
53+
TextField(
54+
focusNode: _textFieldFocusNode,
55+
),
56+
ElevatedButton(
57+
focusNode: _buttonFocusNode,
58+
onPressed: () {},
59+
child: Text("Click Me!"),
60+
),
61+
],
62+
),
63+
),
64+
),
65+
);
66+
}
67+
}

example/macos/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Flutter-related
2+
**/Flutter/ephemeral/
3+
**/Pods/
4+
5+
# Xcode-related
6+
**/dgph
7+
**/xcuserdata/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "ephemeral/Flutter-Generated.xcconfig"

0 commit comments

Comments
 (0)