Skip to content

Commit a21c93d

Browse files
authored
Fix boolean flag parsing in gradle. Track 'trackWidgetCreation' as property of the build. (#16901)
1 parent c7ee37a commit a21c93d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/flutter_tools/gradle/flutter.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ class FlutterPlugin implements Plugin<Project> {
258258

259259
Boolean previewDart2Value = false
260260
if (project.hasProperty('preview-dart-2')) {
261-
previewDart2Value = project.property('preview-dart-2')
261+
previewDart2Value = project.property('preview-dart-2').toBoolean()
262262
}
263263
String[] fileSystemRootsValue = null
264264
if (project.hasProperty('filesystem-roots')) {
@@ -270,8 +270,9 @@ class FlutterPlugin implements Plugin<Project> {
270270
}
271271
Boolean trackWidgetCreationValue = false
272272
if (project.hasProperty('track-widget-creation')) {
273-
trackWidgetCreationValue = project.property('track-widget-creation')
273+
trackWidgetCreationValue = project.property('track-widget-creation').toBoolean()
274274
}
275+
275276
String extraFrontEndOptionsValue = null
276277
if (project.hasProperty('extra-front-end-options')) {
277278
extraFrontEndOptionsValue = project.property('extra-front-end-options')
@@ -282,7 +283,7 @@ class FlutterPlugin implements Plugin<Project> {
282283
}
283284
Boolean preferSharedLibraryValue = false
284285
if (project.hasProperty('prefer-shared-library')) {
285-
preferSharedLibraryValue = project.property('prefer-shared-library')
286+
preferSharedLibraryValue = project.property('prefer-shared-library').toBoolean()
286287
}
287288
String targetPlatformValue = null
288289
if (project.hasProperty('target-platform')) {

packages/flutter_tools/lib/src/bundle.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ Future<void> build({
8585
..add(mainPath);
8686
final Map<String, String> properties = <String, String>{
8787
'entryPoint': mainPath,
88+
'trackWidgetCreation': trackWidgetCreation.toString(),
8889
};
8990
return new Fingerprint.fromBuildInputs(properties, compilerInputPaths);
9091
}

0 commit comments

Comments
 (0)