Skip to main content

A custom Flet TextField that only accepts numerical input (int or float).

Project description

numberfield_flet

My take of creating a number input field in Flet.

  • Supports both float and integer inputs
  • Supports user-defined on_change callbacks

Install it from PyPI

pip install numberfield-flet

Usage

import flet as ft
from numberfield_flet import NumberField

def user_defined_on_change(e):
    print(f"User-defined on_change event: {e.control.value}")


def main(page: ft.Page):
    page.title = "Number Inputter"
    custom_text_field = NumberField(on_change=user_defined_on_change, input_type="float",
                                    label="Enter a float number here: ")
    page.add(custom_text_field)

Development

Email me if you have any questions!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

numberfield_flet-1.0.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

numberfield_flet-1.0.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file numberfield_flet-1.0.0.tar.gz.

File metadata

  • Download URL: numberfield_flet-1.0.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.4

File hashes

Hashes for numberfield_flet-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fc75161e3ca5434a58674762ba8ff9ac4215479803f199a28c6bf6ef207055f3
MD5 8a7feb010227a1162e77bc8e18e7c9b4
BLAKE2b-256 53b673a1699c02732e87cf1f8f276d33c50b3ca22ada857742c31c5e1629e9ae

See more details on using hashes here.

File details

Details for the file numberfield_flet-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for numberfield_flet-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 77d57001891c4b728bb90c24947a351c46e5c7351b24a9004dc5fde2a2dbeb03
MD5 32bd99a617b50e6acb2a4452102ccea0
BLAKE2b-256 1648fc808a40e720563475e96eddacb910c52fd119a6906e7431d8e8fa81bb80

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page