You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone,
First of all, thank you for developing Flet. I really love Python, and it's amazing to be able to develop apps for iPhone and Android using this language.
I'm currently working on a text adventure RPG, fully accessible to blind users, with music, sound effects, and more. The project is free and open-source — you can check it out here:
👉 https://github.com/Ambro86/AccessibleIphoneApp/
Right now, the game is only available in Italian, but I plan to add more languages soon.
However, I'm facing an issue and hope someone here can help. When I create windows with several buttons (e.g. 6 or 7), everything works fine on Windows. But on iPhone, when using VoiceOver (the built-in screen reader), I notice that some "empty" elements are detected — meaning VoiceOver reads nothing in those spots. These empty elements appear, for example, before the screen title or between sections.
This behavior affects accessibility, which is a top priority for me as a blind developer. I’ve managed to implement everything else — music, game saving, sound effects, color changes, icons, etc. — but this issue is really blocking me.
Is there any workaround or fix to avoid these empty elements from being generated?
I’ve also opened an issue here:
👉 #5417
Thanks a lot in advance for any help you can provide! I really hope there’s a way around this.
Best regards,
Ambro
Code sample
defcrea_vista_gioco(self):
"""Crea la vista principale di gioco"""# Titolo con Semantics senza labeltitolo=ft.Semantics(
container=True,
content=ft.Text(
"AVVENTURA IN CORSO",
size=24,
weight=ft.FontWeight.BOLD,
text_align=ft.TextAlign.CENTER,
color=ft.Colors.AMBER_400,
style=ft.TextThemeStyle.HEADLINE_MEDIUM
)
)
# Ottieni i valori attuali dalle variabili globali se esistonovalore_storia="🎮 Benvenuto nell'Avventura Incrementale!\n Compagni gatti con abilità speciali\n Raccogli risorse e costruisci\n Combatti mostri e sali di livello\n🍽️ Gestisci cibo e acqua per energia\n🎵 Audio immersivo e feedback aptico\n\nPremi 'Inizia Avventura' per cominciare!"ifhasattr(self, 'area_storia') andself.area_storiaandhasattr(self.area_storia, 'value'):
valore_storia=self.area_storia.valuevalore_stats=f" Statistiche Giocatore:\n Livello {self.livello} • {self.vita}/{self.vita_massima} HP • {self.monete} monete\n Attacco: {self.calcola_attacco_totale()} • Difesa: {self.calcola_difesa_totale()}\n EXP: {self.esperienza}/{self.esperienza_necessaria}"ifhasattr(self, 'area_stats') andself.area_statsandhasattr(self.area_stats, 'value'):
valore_stats=self.area_stats.value# Area storia come gruppo semanticoarea_storia_locale=ft.Semantics(
container=True,
content=ft.Container(
content=ft.Text(
valore_storia,
size=14,
color=ft.Colors.AMBER_100
),
bgcolor=ft.Colors.DEEP_PURPLE_900,
border_radius=5,
padding=10,
expand=True
)
)
# Area statistiche come gruppo semantico con TextFieldarea_stats_textfield=ft.TextField(
value=valore_stats,
multiline=True,
read_only=True,
min_lines=4,
max_lines=6,
text_size=14,
color=ft.Colors.CYAN_100,
border_color=ft.Colors.TRANSPARENT,
focused_border_color=ft.Colors.TRANSPARENT,
bgcolor=ft.Colors.TRANSPARENT
)
area_stats_locale=ft.Semantics(
container=True,
content=ft.Container(
content=area_stats_textfield,
bgcolor=ft.Colors.BLUE_GREY_900,
border_radius=5,
padding=10
)
)
# Aggiorna i riferimenti globali per mantenere la sincronizzazioneself.area_storia=area_storia_localeself.area_stats=area_stats_textfield# Punta al TextField per aggiornamenti# Pulsanti di giocopulsanti_gioco= []
# Elemento decorativo per evitare elemento vuotoelemento_decorativo=ft.Semantics(
container=True,
content=ft.Container(height=1, bgcolor=ft.Colors.TRANSPARENT)
)
pulsanti_gioco.append(elemento_decorativo)
# Azioni incrementali senza Semanticsazioni_incrementali=self.azioni_incrementali_possibili()
fori, (testo, funzione, tooltip) inenumerate(azioni_incrementali):
pulsante_incrementale=ft.ElevatedButton(
text=testo,
on_click=funzione,
width=280,
height=50,
bgcolor=ft.Colors.GREEN_600,
color=ft.Colors.WHITE,
tooltip=tooltip,
key=f"azione_{i}_{testo.replace(' ', '_')}"
)
pulsanti_gioco.append(pulsante_incrementale)
# Pulsante cambio areaiflen(self.aree_sbloccate) >1:
pulsante_aree=ft.ElevatedButton(
text="Cambia Area",
on_click=lambdae: self.page.go("/aree"),
width=280,
height=50,
bgcolor=ft.Colors.BLUE_600,
color=ft.Colors.WHITE,
tooltip="Scegli area da esplorare",
key="btn_cambia_area"
)
pulsanti_gioco.append(pulsante_aree)
# Pulsanti di navigazionepulsante_combattimento=ft.ElevatedButton(
text="Combattimento",
on_click=lambdae: self.page.go("/combattimento"),
width=280,
height=50,
bgcolor=ft.Colors.RED_600,
color=ft.Colors.WHITE,
tooltip="Combatti contro i mostri"
)
pulsante_negozio=ft.ElevatedButton(
text="Negozio",
on_click=lambdae: self.page.go("/negozio"),
width=280,
height=50,
bgcolor=ft.Colors.ORANGE_600,
color=ft.Colors.WHITE,
tooltip="Visita il negozio"
)
pulsante_gatti=ft.ElevatedButton(
text="Gatti",
on_click=lambdae: self.page.go("/gatti"),
width=280,
height=50,
bgcolor=ft.Colors.PINK_600,
color=ft.Colors.WHITE,
tooltip="Gestisci i tuoi gatti"
)
pulsanti_gioco.extend([pulsante_combattimento, pulsante_negozio, pulsante_gatti])
# Pulsante bossif (self.area_attualeinself.boss_areeandself.boss_aree[self.area_attuale]["nome"] notinself.boss_sconfittiandself.progressione_area.get(self.area_attuale, 0) >=100):
pulsante_boss=ft.ElevatedButton(
text="Combatti Boss dell'Area!",
on_click=self.combatti_boss,
width=280,
height=50,
bgcolor=ft.Colors.DEEP_PURPLE_600,
color=ft.Colors.WHITE,
tooltip=f"Affronta il boss: {self.boss_aree[self.area_attuale]['nome']}"
)
pulsanti_gioco.append(pulsante_boss)
# Pulsante salvapulsante_salva=ft.ElevatedButton(
text="Salva Partita",
on_click=self.salva_gioco,
width=280,
height=50,
bgcolor=ft.Colors.PURPLE_600,
color=ft.Colors.WHITE,
tooltip="Salva il tuo progresso"
)
pulsanti_gioco.append(pulsante_salva)
# Colonna pulsanti senza Semantics per permettere accesso individualelista_pulsanti=ft.Column(
controls=pulsanti_gioco,
horizontal_alignment=ft.CrossAxisAlignment.CENTER,
spacing=15,
scroll=ft.ScrollMode.AUTO
)
# Controlli di gioco senza label per preservare il contenuto naturalegioco_controls=ft.Column([
area_storia_locale,
area_stats_locale,
lista_pulsanti
], spacing=10, tight=False)
# Pulsante menu come gruppo semanticopulsante_menu=ft.Semantics(
container=True,
content=ft.ElevatedButton(
text="Torna al Menu",
on_click=lambdae: self.page.go("/"),
width=200,
height=50,
bgcolor=ft.Colors.GREY_600,
color=ft.Colors.WHITE,
tooltip="Torna al menu principale"
)
)
# Content principale senza height fisso per evitare contenuto vuotocontent=ft.Column([
titolo,
ft.Container(
content=gioco_controls,
bgcolor=ft.Colors.GREY_800,
border_radius=10,
padding=10,
expand=True# Usa expand invece di height
),
pulsante_menu
], scroll=ft.ScrollMode.AUTO, spacing=30, expand=True)
returnft.View(
"/gioco",
controls=[
# Semantics senza label per evitare elemento vuoto ma preservare contenutoft.Semantics(
container=True,
content=ft.Container(
content=content,
bgcolor=ft.Colors.GREY_900,
padding=20,
expand=True
)
)
],
bgcolor=ft.Colors.GREY_900
)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Question
Hi everyone,
First of all, thank you for developing Flet. I really love Python, and it's amazing to be able to develop apps for iPhone and Android using this language.
I'm currently working on a text adventure RPG, fully accessible to blind users, with music, sound effects, and more. The project is free and open-source — you can check it out here:
👉 https://github.com/Ambro86/AccessibleIphoneApp/
Right now, the game is only available in Italian, but I plan to add more languages soon.
However, I'm facing an issue and hope someone here can help. When I create windows with several buttons (e.g. 6 or 7), everything works fine on Windows. But on iPhone, when using VoiceOver (the built-in screen reader), I notice that some "empty" elements are detected — meaning VoiceOver reads nothing in those spots. These empty elements appear, for example, before the screen title or between sections.
This behavior affects accessibility, which is a top priority for me as a blind developer. I’ve managed to implement everything else — music, game saving, sound effects, color changes, icons, etc. — but this issue is really blocking me.
Is there any workaround or fix to avoid these empty elements from being generated?
I’ve also opened an issue here:
👉 #5417
Thanks a lot in advance for any help you can provide! I really hope there’s a way around this.
Best regards,
Ambro
Code sample
Error message
No response
------------------------------------------------------
Beta Was this translation helpful? Give feedback.
All reactions