From 4c3b12855d09619f57dfe88603d33a0dd7448664 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Wed, 22 Nov 2023 12:40:33 +0100 Subject: [PATCH] Enable extension in profile builds --- drift/lib/src/runtime/devtools/devtools.dart | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drift/lib/src/runtime/devtools/devtools.dart b/drift/lib/src/runtime/devtools/devtools.dart index 30ec368d5..92dcfa894 100644 --- a/drift/lib/src/runtime/devtools/devtools.dart +++ b/drift/lib/src/runtime/devtools/devtools.dart @@ -13,11 +13,10 @@ import 'service_extension.dart'; import 'shared.dart'; const _releaseMode = bool.fromEnvironment('dart.vm.product'); -const _profileMode = bool.fromEnvironment('dart.vm.profile'); -// Avoid pulling in a bunch of unused code to describe databases and to make -// them available through service extensions on release builds. -const _enable = !_releaseMode && !_profileMode; +// This code is only used for the Drift DevTools extension. Avoid including it +// in release builds. +const _enable = !_releaseMode; void postEvent(String type, Map data) { developer.postEvent('drift:$type', data);