diff --git a/packages/flutter/lib/foundation.dart b/packages/flutter/lib/foundation.dart index 65cc88cdc2..0ace04d91f 100644 --- a/packages/flutter/lib/foundation.dart +++ b/packages/flutter/lib/foundation.dart @@ -52,7 +52,6 @@ export 'src/foundation/object.dart'; export 'src/foundation/observer_list.dart'; export 'src/foundation/platform.dart'; export 'src/foundation/print.dart'; -export 'src/foundation/profile.dart'; export 'src/foundation/serialization.dart'; export 'src/foundation/stack_frame.dart'; export 'src/foundation/synchronous_future.dart'; diff --git a/packages/flutter/lib/src/foundation/profile.dart b/packages/flutter/lib/src/foundation/profile.dart deleted file mode 100644 index 189714f722..0000000000 --- a/packages/flutter/lib/src/foundation/profile.dart +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2014 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'basic_types.dart'; -import 'constants.dart'; - -/// DEPRECATED. `function` cannot be tree-shaken out of release builds. -/// -/// Instead use: -/// -/// ```dart -/// if (!kReleaseMode) { -/// function(); -/// } -/// ``` -@Deprecated( - 'Use `if (!kReleaseMode) { function(); }` instead. ' - 'This feature was deprecated after v1.3.9.' -) -void profile(VoidCallback function) { - if (kReleaseMode) - return; - function(); -} diff --git a/packages/flutter/test/foundation/profile_test.dart b/packages/flutter/test/foundation/profile_test.dart deleted file mode 100644 index 3bea75e463..0000000000 --- a/packages/flutter/test/foundation/profile_test.dart +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2014 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/foundation.dart'; -import '../flutter_test_alternative.dart'; - -void main() { - // TODO(devoncarew): This test - while very nice - isn't testing what we really want to know: - // that the code in the `profile` closure is omitted in release mode. - test('profile invokes its closure in debug or profile mode', () { - int count = 0; - profile(() { // ignore: deprecated_member_use_from_same_package - count++; - }); - // We run our tests in debug mode, so kReleaseMode will always evaluate to - // false... - expect(count, kReleaseMode ? 0 : 1); - }); -}