3

I try to specify an entrypoint function in a specific file to launch a Flutter screen from my iOS APP, I follow the doc but get an error:

Dart Error: Dart_LookupLibrary: library 'hh.dart' not found.

This is my code in Xcode:

flutterEngine.run(withEntrypoint: "hhPage", libraryURI: "hh.dart")

and partial directory structure in the flutter module:

lib/
├─ main.dart
└─ hh.dart

1 Answers1

2

The doc is not correct or out of date. According to the doc comment of libraryURI argument, we need to specify a string including its package name, like "package:your_package/hh.dart".

flutterEngine.run(withEntrypoint: "hhPage", libraryURI: "package:your_package_name/hh.dart")

Additionally, hh.dart has to be imported in main.dart to contain the file in the app.

scenee
  • 339
  • 3
  • 11