Flython class

Flython let's you combine the power of Python with Dart. It's meant to be used for creating powerful backend and logic code for beautiful Flutter apps, but it doesn't depend on Flutter and can be used in pure Dart code. Make sure to subclass and use. See the package home page for an example.

Constructors

Flython()

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

finalize() → void
Force kill Python instance. Ideally, your application should implement an exit command that gracefully exits Python.
initialize(String pythonCommand, String mainApp, bool debugMode) Future<bool>
Initializes Flython. pythonCommand is the actual Python executable, or command callable from any terminal. On Windows, for instance, if Python installation folder is in PATH, pythonCommand is set to python.exe mainApp is the path to the main Python script. If the provided path does not contain a script, then a new one will be created using the default contents below:
log(String text) → void
Log anything into the log file. Works only if Flython class (or subclass) is initialized in debug mode.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
runCommand(dynamic command) Future
Sends a command to Python and returns the result. Try to avoid using this command directly in your applications. Instead, call it inside a method with proper input and output types.
sysVersion() Future
An example command that returns Python system version. Same as running sys.version in Python.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

cmdSysVersion → const int
Python system version command code. This command code is part of the base Flython class mainly for demonstration purposes.