Flut
Bring Flutter to Python
Overview
Flut is a Python project that brings the real Flutter widget system into the Python ecosystem. It is designed to expose Flutter's API as honestly and closely as possible.
Common Use Cases
Flut is a good fit when you are writing a Python application and need a modern desktop UI, when your project needs to stay in the Python ecosystem, or when you want Flutter's widget model without moving your codebase to Dart.
Typical examples include:
- A Python data, automation, or AI tool that needs a polished cross-platform desktop interface.
- Students, researchers, or developers who want to quickly build a desktop proof-of-concept UI while keeping models, inference code, or data pipelines in Python.
- An internal business application whose networking, domain logic, or integrations already live in Python.
- A Python enthusiast who wants a UI application that can be installed through the familiar
pip install appworkflow.
Because Flut follows Flutter's API closely, Flutter examples and AI-generated Flutter code can often be adapted to Flut with only straightforward Python syntax changes. The reverse is also true: if you later decide to migrate to Flutter and Dart, you can retain your entire UI structure and design work.
Please take a look at the catalog app, and Rocky — a Python-based desktop AI agent.
True Flutter
Flutter code maps almost 1:1 from Dart to Python.
// Flutter (Dart)
Container(
padding: EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.circular(8),
),
child: Text('Hello'),
)
# Flut (Python)
Container(
padding=EdgeInsets.all(16),
decoration=BoxDecoration(
color=Colors.blue,
borderRadius=BorderRadius.circular(8),
),
child=Text('Hello'),
)
Under the hood, the real Flutter widget system is used. Because Flut closely mirrors Flutter's API, coding agents can transfer their knowledge of Flutter patterns and generate Flut code naturally.
State-of-the-Art asyncio Integration
Flut provides a true async integration, bridging asyncio with the Flutter UI thread in a design that exactly matches Flutter. Thread safety and event loop conflicts are handled internally.
No Performance Surprises
The majority of projects using Flut will enjoy near identical performance to Flutter. FFI between Python and Dart does bring additional communication overhead, but the cost is fixed.
Installation
pip install flut
Prebuilt wheels are available for Windows (x64), macOS (x64, arm64), and Linux (x64).
Building from source is also supported and requires the Flutter SDK.
Usage
Create a file app.py:
from flut import run_app
from flut.flutter.widgets import StatelessWidget, StatefulWidget, State, Text, Center, Column, Icon
from flut.flutter.material import MaterialApp, Scaffold, AppBar, FloatingActionButton, Icons, ThemeData, ColorScheme, Colors, Theme
from flut.flutter.rendering import MainAxisAlignment
class MyApp(StatelessWidget):
def build(self, context):
return MaterialApp(
title="Flut Demo",
theme=ThemeData(
colorScheme=ColorScheme.fromSeed(seedColor=Colors.deepPurple),
),
home=MyHomePage(title="Flut Demo Home Page"),
)
class MyHomePage(StatefulWidget):
def __init__(self, title):
super().__init__()
self.title = title
def createState(self):
return _MyHomePageState()
class _MyHomePageState(State[MyHomePage]):
def initState(self):
self._counter = 0
def _incrementCounter(self):
def _update():
self._counter += 1
self.setState(_update)
def build(self, context):
return Scaffold(
appBar=AppBar(
title=Text(self.widget.title),
backgroundColor=Theme.of(context).colorScheme.inversePrimary,
),
body=Center(
child=Column(
mainAxisAlignment=MainAxisAlignment.center,
children=[
Text("You have pushed the button this many times:"),
Text(
f"{self._counter}",
style=Theme.of(context).textTheme.headlineMedium,
),
],
),
),
floatingActionButton=FloatingActionButton(
onPressed=self._incrementCounter,
tooltip="Increment",
child=Icon(Icons.add),
),
)
if __name__ == "__main__":
run_app(MyApp())
Run it:
python app.py
For async support:
import asyncio
from flut import run_app_async
# ... your app code ...
if __name__ == "__main__":
asyncio.run(run_app_async(MyApp()))
For a more complete example, see the catalog app.
Flutter Parity
Flut is a project that brings Flutter to Python. Some features are not applicable in this context: whether due to platform limitations, overlap with Python's own ecosystem, being tied to the Dart development workflow, or simply due to its challenging nature. The following are out of scope, listed from lowest to highest priority for future consideration:
- Web Support
- Mobile Support
- Plugins
- Flutter DevTools
- Isolates
- Platform Channels
- Streams/StreamBuilder
- Non-State Mixins
The following are implemented with compromises:
- InheritedWidget Uses
visitAncestorElements+dependOnInheritedElementinstead of type-based lookup, resulting in O(depth) lookup vs Flutter's O(1). Negligible for typical widget trees. - Shortcuts / Actions O(depth) action lookup vs Flutter's O(1). Negligible for typical widget trees.
- showDialog wraps the builder in a StatelessWidget proxy so the dialog's widget tree is built through the standard Dart-initiated build path, enabling callbacks in dialog children to work correctly.
- Python defined
StatelessWidget/StatefulWidget/InheritedWidgetare wrapped in an outerStatelessWidgetwhose inner host is keyed by the fully-qualified Python class name.
Build
cd flut/.flutter
flutter build windows/macos/linux --no-tree-shake-icons
License
MIT
Disclaimer
Flut is an independent project and is not endorsed by, sponsored by, or affiliated with Google LLC. Flutter is a trademark of Google LLC.
Metadata
Release files for flut 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| flut-0.0.9.tar.gz | 602.1 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flut-0.0.9-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| flut-0.0.9-py3-none-manylinux1_x86_64.whl | Python 3 | none | Linux glibc 2.5+ x86-64 | Details |
| flut-0.0.9-py3-none-macosx_12_0_universal2.whl | Python 3 | none | macOS 12.0+ universal2 (ARM64, x86-64) | Details |
Total release size: 84.7 MB
Release files / flut-0.0.9.tar.gz
| Download URL | flut-0.0.9.tar.gz |
|---|---|
| Size | 602.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e05b8930f9f770196df348f452bb358ff138649f3d33af2e055394fd86f382cf
|
|
BLAKE2b-256 checksum How to use checksums |
11fe736dbb8bf798daed696d4dad2d9bab975fa17186f7f6dcf99bcb57ee4cea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 15, 2026.
Transparency logRelease files / flut-0.0.9-py3-none-win_amd64.whl
| Download URL | flut-0.0.9-py3-none-win_amd64.whl |
|---|---|
| Size | 13.7 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6ea96c649dbd278eff1ff8a91caf44faec09ff8cba2a084295ee458f4d97e35e
|
|
BLAKE2b-256 checksum How to use checksums |
2dc86c1354cc2f29e68534993ab177fd24f08554dfc33c4a57f1f93ac730329a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 15, 2026.
Transparency logRelease files / flut-0.0.9-py3-none-manylinux1_x86_64.whl
| Download URL | flut-0.0.9-py3-none-manylinux1_x86_64.whl |
|---|---|
| Size | 11.3 MB |
| Tags | Linux glibc 2.5+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
8a0a696bab6300cdd69c0b7ef2cdb09a00841076239c7d00180fec5a6704e289
|
|
BLAKE2b-256 checksum How to use checksums |
37fddd8ce469e6e5a073c731cfacff143be9a406b8675ae1f8bb70a5135541ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 15, 2026.
Transparency logRelease files / flut-0.0.9-py3-none-macosx_12_0_universal2.whl
| Download URL | flut-0.0.9-py3-none-macosx_12_0_universal2.whl |
|---|---|
| Size | 59.1 MB |
| Tags | Python 3 macOS 12.0+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
32a42534dffa209ec190ea83be45139d9013014ce3e6b7b06064d88910155b63
|
|
BLAKE2b-256 checksum How to use checksums |
385bb6d4b65c51f9427b0ad6635daeef1227f5156a56355d00b8fca659c09dbd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 15, 2026.
Transparency log