How I receive a number on Textfield Input in FLET?

im learning Flet to build apps with python, how do i receive a user parameter on TextField but has a Number (int or float), because is STR by standart. here´s the code

`quantity = TextField(“How many company´s you want to add? “)

list = list()
company = dict()
user = dict()
list_companies = list()

# Informs the values ​​of each company
def btn_empresas(e):
    for position in range(1, quantity + 1):
        company ["value"] = TextField(f"What is the VALUE of the company's RESERVOIR {position}: ")
        company ["index"] = TextField(f"Enter the INDEX of the company {position}: ")
        company ["volume"] = TextField(f"What is the VOLUME of the company {position}: ")
        list.append(company.copy())
        Text(f"You added the company {position}")`

Hey there, im learning Flet to build apps with python, how do i receive a user parameter on TextField but has a Number (int or float), because is STR by standart. here´s the code

`quantity = TextField(“How many company´s you want to add? “)

list = list()
company = dict()
user = dict()
list_companies = list()

# Informs the values ​​of each company
def btn_empresas(e):
    for position in range(1, quantity + 1):
        company ["value"] = TextField(f"What is the VALUE of the company's RESERVOIR {position}: ")
        company ["index"] = TextField(f"Enter the INDEX of the company {position}: ")
        company ["volume"] = TextField(f"What is the VOLUME of the company {position}: ")
        list.append(company.copy())
        Text(f"You added the company {position}")`

I saw on Docs about KeyboardType but I didn’t understandset keyboartype to NUMBER

The goal is use the user number input to set how many company’s will me add on the program.

Leave a Comment