The dart:io library contains a packageRoot API:
/// This returns `null`, as `packages/` directories are no longer supported.
///
@Deprecated('packages/ directory resolution is not supported in Dart 2')
static String? get packageRoot => null; // TODO(mfairhurst): remove this
Similarily in the isolate API:
/// The package root of the current isolate, if any.
///
/// This getter returns `null`, as the `packages/` directory is not supported
/// in Dart 2.
@Deprecated('packages/ directory resolution is not supported in Dart 2.')
external static Future<Uri?> get packageRoot;
As the deprecation comments state, this is not only deprecated but non-functional in Dart 2, and is hardcoded to return null. We should go ahead and remove it.
The
dart:iolibrary contains apackageRootAPI:Similarily in the isolate API:
As the deprecation comments state, this is not only deprecated but non-functional in Dart 2, and is hardcoded to return null. We should go ahead and remove it.