2.2.0
What's Changed
Update with pip:
pip3 install -U pywa
- [flows] adding
ScreenDataUpdate
to use inUpdateDataAction
- [flows] using math operators between math objs
- [flows] renaming
ActionNext
toNext
andActionNextType
toNextType
from pywa.types.flows import *
FlowJSON(
version="6.0",
screens=[
Screen(
id="DEMO_SCREEN",
data=[
is_txt_visible := ScreenData( # Declaring a data object
key="is_txt_visible",
example=False,
),
],
layout=Layout(
children=[
TextBody(
text="You checked the box!",
visible=is_txt_visible.ref, # Using the data
),
OptIn(
label="Show the text",
name="show_txt",
on_select_action=UpdateDataAction(
payload=[is_txt_visible.update(True)] # Updating the data
),
on_unselect_action=UpdateDataAction(
payload=[is_txt_visible.update(False)]
),
),
]
),
)
],
)
Full Changelog: 2.1.0...2.2.0