Flet is a library for front-end development which simplifies the Flutter model and exposes a simple imperative API. Initially available for Python, other languages are in the works. https://flet.dev/
Questions tagged [python-flet]
14 questions
1
vote
2 answers
Image disappear when I pick a file with Flet Python
I'm trying to make a GUI with flet, i am displaying an image, a button and a text field in the interface, but when i pick a file with FilePickerResultEvent, my image disappear. I follow the example of FilePicker of flet. It happens if i select any…

jariasca
- 33
- 4
1
vote
2 answers
how do we change views in flet ? I get an error -> signal only works in main thread of the main interpreter
Here is the code for the same. I have two functions, one is main and other i named as main2.
How do we change the view from main to main2?
import flet
from flet import Checkbox, ElevatedButton, Row,Text, TextField,sleep,Column
from flet import (
…

Abhay Gaur
- 21
- 7
0
votes
2 answers
Python Flet vertical alignment for column of controls
I'm trying to learn Flet (Python) by implementing a simple game with a rectangular field. A player makes a move by pressing buttons on his side. So, I want to place such buttons closer to his home (left-top corner for the first player and…

Serge Sotnyk
- 123
- 2
- 11
0
votes
4 answers
Python Flet cannot align text to center
Hello i am a beginner in Flet module my goal is center the text.
According to documentation there is a text_align property in text widget.
I tried to use it but not worked.
My code:
import flet as ft
def main(page: ft.Page):
page.title =…

Heisenberg
- 11
- 6
0
votes
1 answer
Python Flet AttributeError: module 'flet_core.page' has no attribute 'controls'
In summary, I am at the very beginning of the project.
What I'm trying to do is use a custom 'navigation rail' for navigation between pages.Now there is a problem. When I use the custom navigation rail alone, the program works, but when I want to…

Hasancan Çakıcıoğlu
- 232
- 2
- 10
0
votes
0 answers
how to dynamically add rows in flet python datatable?
I found a piece of code on the internet for kivymd, where I can add or remove text field values to the data table by pressing the Add button (as shown below).
But is this possible for Flet Python? How?
Even I have appended all the rows of the data…

Cheng Gong
- 1
- 1
0
votes
1 answer
How to add record in datatable flet python?
I want the user to enter the values and press the plus button to display all the values in the TextField in the data table and in my code to access these records through a list.
In the picture below, the data table is created again from the…

Navrang
- 41
- 4
0
votes
1 answer
How to delete the values of flet python text fields after clicking the button?
I use Flet Python framework
And I want to delete its values after clicking on the button and store them in the data table
def main(page: ft.Page):
def btn_click(e):
if not sstid.value:
sstid.error_text = "err"
…

Navrang
- 41
- 4
0
votes
0 answers
Building views on route change: Why should I use page.go(...) inside of view pop instead of just updating the page and editing the page.route?
import flet as ft
def main(page: ft.Page):
page.title = "Routes Example"
def route_change(route):
page.views.clear()
page.views.append(
View(
"/",
[
…

Khabir
- 16
- 3
0
votes
0 answers
How do I troubleshoot when the app doesn't work as expected?
Windows app not working as it did when run from IDE
I am looking to allow the user to select excel files and then evaluate basic information from the file. It works fine in the app that opens from running in the IDE (JupyterLab) but after packaging…

CaptainKaladin
- 11
- 3
0
votes
1 answer
How to access dimensions of widget at runtime?
How do I can have access to a widget dimensions (width, height) in flet (python) at runtime or from other widget in the page?
I tried to access to the
widget.width
property directly but I believe it doesn't have read permissions.

Rodolfo
- 96
- 7
0
votes
1 answer
How to open filedialog to retrieve file path in Flet (Python)?
How can I open a filedialog in flet-python to retrieve a file path? I tried with other libraries (tkinter creates a new event loop, easygui throws the windows to the back of all other windows, wx needs to create a loop too).
I needed just that, to…

Rodolfo
- 96
- 7
0
votes
1 answer
Update image on button click
Can someone explain to me how do I update a property of an element from a function called from another element, like in the example below?
In this example, I created a flet app which shows 4 elements. The two elements at the top are images and the…

Rodolfo
- 96
- 7
-1
votes
0 answers
How to call Python method from Flutter Dart without using dartpy or star flute
Thing is my application is very complicated and I have an entire algorithm written on python ready, but before I implement it I want to develop a relation between Python and Dart.
I have created virtual Python environment inside utils directory…

Sohaib Malik
- 9
- 2