|
5 | 5 | import 'dart:async'; |
6 | 6 |
|
7 | 7 | import 'package:devtools_app_shared/ui.dart'; |
| 8 | +import 'package:devtools_app_shared/utils.dart'; |
8 | 9 | import 'package:flutter/material.dart'; |
9 | 10 | import 'package:vm_service/vm_service.dart' hide Stack; |
10 | 11 |
|
11 | 12 | import '../../shared/analytics/analytics.dart' as ga; |
12 | 13 | import '../../shared/analytics/constants.dart' as gac; |
13 | 14 | import '../../shared/feature_flags.dart'; |
14 | 15 | import '../../shared/globals.dart'; |
| 16 | +import '../../shared/managers/banner_messages.dart'; |
15 | 17 | import '../../shared/preferences/preferences.dart'; |
16 | 18 | import '../../shared/primitives/simple_items.dart'; |
17 | 19 | import '../../shared/ui/common_widgets.dart'; |
18 | 20 | import '../../shared/ui/editable_list.dart'; |
| 21 | +import 'inspector_screen.dart'; |
19 | 22 |
|
20 | | -class FlutterInspectorSettingsDialog extends StatelessWidget { |
| 23 | +class FlutterInspectorSettingsDialog extends StatefulWidget { |
21 | 24 | const FlutterInspectorSettingsDialog({super.key}); |
22 | 25 |
|
| 26 | + @override |
| 27 | + State<FlutterInspectorSettingsDialog> createState() => |
| 28 | + _FlutterInspectorSettingsDialogState(); |
| 29 | +} |
| 30 | + |
| 31 | +class _FlutterInspectorSettingsDialogState |
| 32 | + extends State<FlutterInspectorSettingsDialog> |
| 33 | + with AutoDisposeMixin { |
| 34 | + @override |
| 35 | + void initState() { |
| 36 | + super.initState(); |
| 37 | + addAutoDisposeListener(preferences.inspector.legacyInspectorEnabled, () { |
| 38 | + if (!preferences.inspector.legacyInspectorEnabled.value) { |
| 39 | + bannerMessages.removeMessageByKey( |
| 40 | + LegacyInspectorWarningMessage.buildKey(InspectorScreen.id), |
| 41 | + InspectorScreen.id, |
| 42 | + ); |
| 43 | + } |
| 44 | + }); |
| 45 | + } |
| 46 | + |
23 | 47 | @override |
24 | 48 | Widget build(BuildContext context) { |
25 | 49 | final theme = Theme.of(context); |
@@ -74,7 +98,7 @@ class FlutterInspectorSettingsDialog extends StatelessWidget { |
74 | 98 | title: 'Use legacy inspector', |
75 | 99 | description: |
76 | 100 | 'Disable the redesigned Flutter inspector. Please know that ' |
77 | | - 'the legacy inspector may be removed in a future release.', |
| 101 | + 'the legacy inspector will be removed in a future release.', |
78 | 102 | gaItem: gac.inspectorV2Disabled, |
79 | 103 | ), |
80 | 104 | ), |
|
0 commit comments