Flutter but Python
Project description
Flut
Flutter, but in Python
Status
This project is in Technical Preview.
- APIs are subject to change.
- Not ready for production use.
Installation
pip install flut
That's it! Windows (x64), macOS (x64, arm64), and Linux (x64) have prebuilt wheels.
You can build from source as well, you will need the Flutter SDK installed.
Usage
Create a file app.py:
from flut import run_app
from flut.flutter.widgets import StatelessWidget, StatefulWidget, State, Text, Center, Column, Icon, MainAxisAlignment
from flut.flutter.material import MaterialApp, Scaffold, AppBar, FloatingActionButton, Icons, ThemeData, ColorScheme, Colors, Theme
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()))
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flut-0.0.0a4.tar.gz.
File metadata
- Download URL: flut-0.0.0a4.tar.gz
- Upload date:
- Size: 314.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9efb5ed57ec2d0df6374af6698372d4258a7583065afc6d9259990376d1aa06c
|
|
| MD5 |
cee8ac1a717d570a906a10d7557daebe
|
|
| BLAKE2b-256 |
82e1cd084ff2f594de51d0866c904af31e320491dfa99d5a6ce23d22117d25ba
|
Provenance
The following attestation bundles were made for flut-0.0.0a4.tar.gz:
Publisher:
publish.yml on yangyuan/flut
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flut-0.0.0a4.tar.gz -
Subject digest:
9efb5ed57ec2d0df6374af6698372d4258a7583065afc6d9259990376d1aa06c - Sigstore transparency entry: 871032735
- Sigstore integration time:
-
Permalink:
yangyuan/flut@c3cf6bf47744eaa88814e9ae67d1f05a6979bf20 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/yangyuan
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c3cf6bf47744eaa88814e9ae67d1f05a6979bf20 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file flut-0.0.0a4-py3-none-win_amd64.whl.
File metadata
- Download URL: flut-0.0.0a4-py3-none-win_amd64.whl
- Upload date:
- Size: 11.4 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4af65d6853188e839258b2d4667fa21daf05d0c1e1d148c2293adc8bf54a3cb
|
|
| MD5 |
0cfff78f5a2232779e8e6e29e7341cb6
|
|
| BLAKE2b-256 |
cb5270c0dd2ecf7c21c7d702612aa00930c00db9b899c667411726913f0f77c9
|
Provenance
The following attestation bundles were made for flut-0.0.0a4-py3-none-win_amd64.whl:
Publisher:
publish.yml on yangyuan/flut
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flut-0.0.0a4-py3-none-win_amd64.whl -
Subject digest:
a4af65d6853188e839258b2d4667fa21daf05d0c1e1d148c2293adc8bf54a3cb - Sigstore transparency entry: 871032890
- Sigstore integration time:
-
Permalink:
yangyuan/flut@c3cf6bf47744eaa88814e9ae67d1f05a6979bf20 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/yangyuan
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c3cf6bf47744eaa88814e9ae67d1f05a6979bf20 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file flut-0.0.0a4-py3-none-manylinux1_x86_64.whl.
File metadata
- Download URL: flut-0.0.0a4-py3-none-manylinux1_x86_64.whl
- Upload date:
- Size: 15.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fba8e2f204959f5eac7e33ba66885ad9039a938bed7c1b04b46c7a6a02c2edb
|
|
| MD5 |
ed4d62c0047e6fefb9bbb69933335df0
|
|
| BLAKE2b-256 |
e904ce18bf59f3e60de9b464a146dc87b60a79ffc0eb0b95d0d32872ad02848e
|
Provenance
The following attestation bundles were made for flut-0.0.0a4-py3-none-manylinux1_x86_64.whl:
Publisher:
publish.yml on yangyuan/flut
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flut-0.0.0a4-py3-none-manylinux1_x86_64.whl -
Subject digest:
2fba8e2f204959f5eac7e33ba66885ad9039a938bed7c1b04b46c7a6a02c2edb - Sigstore transparency entry: 871032806
- Sigstore integration time:
-
Permalink:
yangyuan/flut@c3cf6bf47744eaa88814e9ae67d1f05a6979bf20 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/yangyuan
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c3cf6bf47744eaa88814e9ae67d1f05a6979bf20 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file flut-0.0.0a4-py3-none-macosx_10_14_universal2.whl.
File metadata
- Download URL: flut-0.0.0a4-py3-none-macosx_10_14_universal2.whl
- Upload date:
- Size: 50.5 MB
- Tags: Python 3, macOS 10.14+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8e55480da855a430bc9f0633c3ff9950e5d21d71e505d323fdd1f3f76a8870f
|
|
| MD5 |
ed4518afaae415faca458401e13ec3a3
|
|
| BLAKE2b-256 |
b6acfda01a0457c0fa36d8e84503026aa5afa24b9a1d34ddf757fc287d7a99fb
|
Provenance
The following attestation bundles were made for flut-0.0.0a4-py3-none-macosx_10_14_universal2.whl:
Publisher:
publish.yml on yangyuan/flut
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flut-0.0.0a4-py3-none-macosx_10_14_universal2.whl -
Subject digest:
b8e55480da855a430bc9f0633c3ff9950e5d21d71e505d323fdd1f3f76a8870f - Sigstore transparency entry: 871032954
- Sigstore integration time:
-
Permalink:
yangyuan/flut@c3cf6bf47744eaa88814e9ae67d1f05a6979bf20 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/yangyuan
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c3cf6bf47744eaa88814e9ae67d1f05a6979bf20 -
Trigger Event:
workflow_dispatch
-
Statement type: