loadResource function

Future<_GradleResource> loadResource({
  1. required Uri uri,
  2. required String filename,
  3. required String targetRelativeToRoot,
})

Load resource files from lib/res folder.

Implementation

Future<_GradleResource> loadResource({
  required Uri uri,
  required String filename,
  required String targetRelativeToRoot,
}) =>
    Isolate.resolvePackageUri(uri).then((pathToSource) {
      return _GradleResource(
        pathToSource: Platform.isWindows
            ? pathToSource!.path.replaceFirst("/", "")
            : pathToSource!.path,
        filename: filename,
        targetRelativeToRoot: targetRelativeToRoot,
      );
    });