Skip to content

Disable text wrapping on multitext TextField #4132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
IdkWhatToCallMe123 opened this issue Oct 10, 2024 · 2 comments
Closed
1 task done

Disable text wrapping on multitext TextField #4132

IdkWhatToCallMe123 opened this issue Oct 10, 2024 · 2 comments
Assignees

Comments

@IdkWhatToCallMe123
Copy link

IdkWhatToCallMe123 commented Oct 10, 2024

Duplicate Check

Describe the requested feature

I want to be able to disable text wrapping on multitext Textfield

Suggest a solution

No response

Screenshots

No response

Additional details

No response

@ndonkoHenri
Copy link
Contributor

ndonkoHenri commented Oct 10, 2024

Flutter seems not to have a direct solution for this.
However, with the help of this SO thread, I came up with this:

import flet as ft


def main(page: ft.Page):
    page.add(
        ft.ListView(
            expand=True,
            horizontal=True,
            controls=[
                ft.Container(
                    width=1000,
                    content=ft.TextField(
                        hint_text="Enter your text here",
                        keyboard_type=ft.KeyboardType.MULTILINE,
                        text_vertical_align=ft.VerticalAlignment.START,
                        border=ft.InputBorder.UNDERLINE,
                        filled=True,
                        fit_parent_size=True,
                    ),
                )
            ],
        )
    )


ft.app(target=main)

You can't try it right now, as it makes use of a prop which will be available when #4105 gets merged.

@ndonkoHenri
Copy link
Contributor

You can give the above code a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants