From 5a197c4e9e81d20893bb2836e9d80efa9171f88e Mon Sep 17 00:00:00 2001 From: Pascal Welsch Date: Mon, 23 Dec 2024 15:41:31 +0100 Subject: [PATCH] Remove WidgetInspector due to breaking API change Related https://github.com/flutter/flutter/pull/158219 --- lib/src/core/support/not_a_widgets_app.dart | 62 ++++++++++++++++----- 1 file changed, 48 insertions(+), 14 deletions(-) diff --git a/lib/src/core/support/not_a_widgets_app.dart b/lib/src/core/support/not_a_widgets_app.dart index d79363dd..0efc60b0 100644 --- a/lib/src/core/support/not_a_widgets_app.dart +++ b/lib/src/core/support/not_a_widgets_app.dart @@ -30,20 +30,54 @@ class _NotAWidgetsAppState extends State { 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(