Skip to main content

linked inputs for flet framework

Project description

Linked Inputs

This module Interconnects a couple of flet inputs, actually, it combines the value of the inputs and manages them. This module can be used to make "pin inputs" and so on.

Instalation

first of all get the project from pypi or github:

cloning form github

clone https://github.com/naderidev/linkedinputs

installing using pip

$ pip install linkedinputs

Usage

LinkedInputs

The LinkedInputs class is the mother class and the basic form of the module.

this class just have the input type rule.

Properties

  • page
  • inputs : the list of Inputs to be connected
  • accept_type : an instance of AcceptTypes which specifies the content type of inputs
  • on_change: on inputs value changed. actually, it returns the value of each input in a list
  • on_error: on user entered the wrong value type
  • on_complete: on all inputs filled
  • place: a Row or Column control without any child controls

Methods

  • errors: only returns the error of each input in a list

  • flash_errors(): returns the errors then clears the errors

  • value: returns the value of each input and also it has a setter which you can set a specific value for each input. for example:

    ...
    linkedinputs.value = ['124' , '457' , '478']
    ...
    

    this is an example is when you have 3 inputs which they require ONLY_NUMBER

  • string_value: combines the value of inputs and returns it as a string

RegularLinkedInputs

the RegularLinkedInputs class has defined new rules (like accept_length) for the LinkedInputs class and ordered it.

Properties

  • all LinkedInputs properties
  • accept_length: the value lenght of each input
  • one_by_one: o to the next input on current, filled

an example of RegularLinkedInputs:

source avliable in examples/bankcard_example.py BankCard exmaple In this example when you enter 6 numbers, the associated bank name is displayed (the banks are Iranian)

PinInputT1

the PinInputT1 is using RegularLinkedInputs and it is used to making password inputs

Properties

  • page
  • accept_type : an instance of AcceptTypes which specifies the content type of inputs
  • correct_answer: the correct password for validating
  • on_complete: on all inputs filled
  • accept_length: the value lenght of each input

Methods

  • all RegularLinkedInputs methods
  • is_correct: is password correct

Note: if you want to customize the piniput inputs just ceate a class and extend PinInputT1 then override pin_inputs() method with your own inputs. for example:

class MyPinInput(PinInputT1):
    def pin_inputs(self):
        return [
            TextField(
                ...
            ) for _ in range(...)
        ]

an example of PinInputT1:

source avliable in examples/pininput_t1_example.py PinInput exmaple

Hope this package be useful for you :)

Donating

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

linkedinputs-0.0.2.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

linkedinputs-0.0.2-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file linkedinputs-0.0.2.tar.gz.

File metadata

  • Download URL: linkedinputs-0.0.2.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for linkedinputs-0.0.2.tar.gz
Algorithm Hash digest
SHA256 8964d5aa295d3456bdda3b48b66445bcfb72189da8d159a3eada3eca426a3c21
MD5 d182a56efe4fcd80750587c38510c69d
BLAKE2b-256 b4b950ed079c753b451a49496fea70d8862e909235d42df5e1c1e52870ea52df

See more details on using hashes here.

File details

Details for the file linkedinputs-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: linkedinputs-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for linkedinputs-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9dad01b34fa1a2047e82d94cf39a9ec3c3bca02162f37f358e51efbd5c300e65
MD5 400a19eb662a189883b098fc25a60225
BLAKE2b-256 42c8d0eeef080688a86ace275c89bfa7b170ef0158e60da499cdcec1c9dd2ca1

See more details on using hashes here.

Supported by

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