Skip to content

Commit

Permalink
Enable extension in profile builds
Browse files Browse the repository at this point in the history
  • Loading branch information
simolus3 committed Nov 22, 2023
1 parent 340462e commit 4c3b128
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drift/lib/src/runtime/devtools/devtools.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<Object?, Object?> data) {
developer.postEvent('drift:$type', data);
Expand Down

0 comments on commit 4c3b128

Please sign in to comment.