Skip to content

Commit c8b2087

Browse files
committed
Add the environment Value section
1 parent 9c8189b commit c8b2087

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

lib/src/utils/debug_utils.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import 'package:intl/intl.dart';
1616
///
1717
/// - [appState]: Represents the app state debug section.
1818
/// - [appConstant]: Represents the app constant debug section.
19+
/// - [environmentValue]: Represents the environment value debug section.
1920
/// - [globalProperty]: Represents the global property debug section.
2021
/// - [authenticatedUser]: Represents the authenticated user debug section.
2122
/// - [widgetClass]: Represents the widget class debug section.
@@ -26,6 +27,7 @@ enum DebugSectionType {
2627
componentParameters,
2728
appState,
2829
appConstants,
30+
environmentValues,
2931
globalProperties,
3032
authenticatedUser,
3133
widgetState,
@@ -158,6 +160,10 @@ void deserializeDebugEvent(String rawEventData) {
158160
variableDebugData.appConstant = AppConstantDebugData()
159161
..fromSerializedBufferString(eventData);
160162
break;
163+
case 'environmentValue':
164+
variableDebugData.environmentValue = EnvironmentValueDebugData()
165+
..fromSerializedBufferString(eventData);
166+
break;
161167
case 'globalProperty':
162168
variableDebugData.globalProperty = GlobalPropertyDebugData()
163169
..fromSerializedBufferString(eventData);
@@ -190,6 +196,7 @@ class VariableDebugData extends ChangeNotifier {
190196
GlobalPropertyDebugData? _globalProperty;
191197
AppStateDebugData? _appState;
192198
AppConstantDebugData? _appConstant;
199+
EnvironmentValueDebugData? _environmentValue;
193200
AuthenticatedUserDebugData? _authenticatedUser;
194201
WidgetClassDebugData? _widgetClass;
195202
String? projectId;
@@ -212,6 +219,12 @@ class VariableDebugData extends ChangeNotifier {
212219
notifyListeners();
213220
}
214221

222+
EnvironmentValueDebugData? get environmentValue => _environmentValue;
223+
set environmentValue(EnvironmentValueDebugData? value) {
224+
_environmentValue = value;
225+
notifyListeners();
226+
}
227+
215228
AuthenticatedUserDebugData? get authenticatedUser => _authenticatedUser;
216229
set authenticatedUser(AuthenticatedUserDebugData? value) {
217230
_authenticatedUser = value;
@@ -229,6 +242,7 @@ class VariableDebugData extends ChangeNotifier {
229242
_globalProperty = null;
230243
_appState = null;
231244
_appConstant = null;
245+
_environmentValue = null;
232246
_authenticatedUser = null;
233247
_widgetClass = null;
234248
notifyListeners();
@@ -394,6 +408,16 @@ class VariableDebugData extends ChangeNotifier {
394408
parentSectionType: DebugSectionType.authenticatedUser,
395409
),
396410
),
411+
narrowModalSection(
412+
context,
413+
sectionTitle: 'Environment Values',
414+
childrenNodes: _treeNodeFromJsonMap(
415+
environmentValue?.values,
416+
context,
417+
controller,
418+
parentSectionType: DebugSectionType.environmentValues,
419+
),
420+
),
397421
];
398422
}
399423

pubspec.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ packages:
8585
dependency: "direct main"
8686
description:
8787
path: "."
88-
ref: "v0.1.3"
89-
resolved-ref: "85c30c352df2a141ac364ac72757b36bfbc74fc7"
88+
ref: "v0.1.4"
89+
resolved-ref: bee37587820b37ff59af7f6da61a5ed38a73a4cd
9090
url: "https://github.com/FlutterFlow/debug_panel_proto.git"
9191
source: git
92-
version: "0.1.3"
92+
version: "0.1.4"
9393
devtools_app_shared:
9494
dependency: "direct main"
9595
description:

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
1616
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
1717
# In Windows, build-name is used as the major, minor, and patch parts
1818
# of the product and file versions while build-number is used as the build suffix.
19-
version: 0.1.5
19+
version: 0.1.6
2020

2121
environment:
2222
sdk: ">=3.4.3 <4.0.0"
@@ -37,7 +37,7 @@ dependencies:
3737
debug_panel_proto:
3838
git:
3939
url: https://github.com/FlutterFlow/debug_panel_proto.git
40-
ref: v0.1.3
40+
ref: v0.1.4
4141
easy_debounce: 2.0.1
4242
flutterflow_tree_view:
4343
git:

0 commit comments

Comments
 (0)