run method
Starts running the Flutter engine, optionally specifying an entry point.
entryPoint
represents the name of a top-level function in the Dart
library containing the app's main()
.
If entryPoint
is not provided, it defaults to main()
.
Returns true
if the engine starts successfully; otherwise, returns
false
.
Implementation
bool run(String entryPoint) {
if (engine == nullptr) {
stderr.writeln('Cannot run an engine that failed creation.');
return false;
}
if (hasBeenRun) {
stderr.writeln('Cannot run an engine more than once.');
return false;
}
final runSucceeded = flutter.FlutterDesktopEngineRun(engine, nullptr) != 0;
if (!runSucceeded) {
stderr.writeln('Failed to start engine.');
}
hasBeenRun = true;
return runSucceeded;
}