Giter Club home page Giter Club logo

Comments (6)

FeodorFitsner avatar FeodorFitsner commented on June 29, 2024

Could you please share a code sample demonstrating the issue?

from website.

RezaOptimotive avatar RezaOptimotive commented on June 29, 2024

for me this gives me the error module flet does not have attribute MainAxisAlignment

import flet as ft

def main(page: ft.Page):
    page.title = "Flet counter example"
    page.vertical_alignment = ft.MainAxisAlignment.CENTER

    txt_number = ft.TextField(value="0", text_align=ft.TextAlign.RIGHT, width=100)

    def minus_click(e):
        txt_number.value = str(int(txt_number.value) - 1)
        page.update()

    def plus_click(e):
        txt_number.value = str(int(txt_number.value) + 1)
        page.update()

    page.add(
        ft.Row(
            [
                ft.IconButton(ft.icons.REMOVE, on_click=minus_click),
                txt_number,
                ft.IconButton(ft.icons.ADD, on_click=plus_click),
            ],
            alignment=ft.MainAxisAlignment.CENTER,
        )
    )

ft.app(target=main)

and changing the second line in the main function to page.vertical_alignment = "center" creates the effect that the demo demonstrates and resolves the issue.

alignment at the end of the method function inside the Row component also gives the error which needs to be change to the string "center"

I have noticed that the code in the examples repository runs error-free, but the documentation in the website is not consistent with those code examples.

from website.

FeodorFitsner avatar FeodorFitsner commented on June 29, 2024

What version of Flet module do you have installed? It looks like it's not the recent one.

from website.

FeodorFitsner avatar FeodorFitsner commented on June 29, 2024

Please upgrade to the latest version and give it another try.

from website.

RezaOptimotive avatar RezaOptimotive commented on June 29, 2024

My apologies, you're right. I'm not sure how this happened as I did run pip install flet just about 2 weeks ago or so.

from website.

FeodorFitsner avatar FeodorFitsner commented on June 29, 2024

No worries, we are releasing quite often these days ;) Thanks for trying Flet!

from website.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.