Nodejs class
A Flutter interface for starting and communicating with embedded Node.js projects.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
onMessageReceived
→ Stream<
Map< String, dynamic> > -
A stream of messages received from the Node.js environment.
no setter
Static Methods
-
getCurrentABIName(
) → Future< String?> - Returns the current ABI (Application Binary Interface) name used by the native layer.
-
getNodeJsProjectPath(
) → Future< String?> - Returns the file path to the Node.js project directory.
-
getPlatformVersion(
) → Future< String?> - Returns the platform version (e.g., Android/iOS version info).
-
sendMessage(
String tag, String message) → Future< void> - Sends a message from Flutter to the Node.js environment.
-
start(
{String fileName = "main.js", bool redirectOutputToLogcat = true}) → Future< void> - Starts the Node.js project from a given entry file.
-
startService(
String script, {String title = "Node Service", String content = "Running", bool redirectOutputToLogcat = true}) → Future< void> - Starts a Node.js script as a background (foreground actually) service with notification support (Android).
-
startWithScript(
String script, {bool redirectOutputToLogcat = true}) → Future< void> - Starts the Node.js engine by directly running a JavaScript string.