Skip to content

Commit

Permalink
Remove WidgetInspector due to breaking API change
Browse files Browse the repository at this point in the history
  • Loading branch information
passsy committed Dec 23, 2024
1 parent db794e1 commit 5a197c4
Showing 1 changed file with 48 additions and 14 deletions.
62 changes: 48 additions & 14 deletions lib/src/core/support/not_a_widgets_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,54 @@ class _NotAWidgetsAppState extends State<NotAWidgetsApp> {
child: widget.child,
);

// Allow inspection of widgets
// ignore: deprecated_member_use
if (kDebugMode && WidgetsApp.debugShowWidgetInspectorOverride) {
child = WidgetInspector(
selectButtonBuilder: (BuildContext context, void Function() onPressed) {
return FloatingActionButton(
onPressed: onPressed,
mini: true,
child: const Icon(Icons.search),
);
},
child: child,
);
}
// Allow inspection of widgets, use to debug layout issues
// Not part of the codebase since https://github.com/flutter/flutter/pull/158219 introduced a breaking API change.
// Re-enable when we drop support for Flutter v3.27.0
// if (kDebugMode && WidgetsApp.debugShowWidgetInspectorOverride) {
// child = WidgetInspector(
// exitWidgetSelectionButtonBuilder: (
// BuildContext context, {
// required VoidCallback onPressed,
// required GlobalKey key,
// }) {
// final ThemeData theme = Theme.of(context);
// return FloatingActionButton(
// key: key,
// onPressed: onPressed,
// mini: true,
// backgroundColor: theme.colorScheme.onPrimaryContainer,
// foregroundColor: theme.colorScheme.primaryContainer,
// child: const Icon(
// Icons.close,
// semanticLabel: 'Exit Select Widget mode.',
// ),
// );
// },
// moveExitWidgetSelectionButtonBuilder: (
// BuildContext context, {
// required VoidCallback onPressed,
// bool isLeftAligned = true,
// }) {
// final ThemeData theme = Theme.of(context);
// return IconButton(
// color: theme.colorScheme.onPrimaryContainer,
// padding: EdgeInsets.zero,
// iconSize: 32,
// onPressed: onPressed,
// constraints: const BoxConstraints(
// minWidth: 40,
// minHeight: 40,
// ),
// icon: Icon(
// isLeftAligned ? Icons.arrow_right : Icons.arrow_left,
// semanticLabel:
// 'Move "Exit Select Widget mode" button to the ${isLeftAligned ? 'right' : 'left'}.',
// ),
// );
// },
// child: child,
// );
// }

// Any Text requires a directionality
child = Directionality(
Expand Down

0 comments on commit 5a197c4

Please sign in to comment.