-
QuestionHi, I need put two icons in one TextButton, one at the beginning of the button, one at the end and in the middle of the button text. I already tried with two buttons a textButton and an IconButton but there is a space in the middle. I need the home icon to be on the left side with the text and the second icon on the right side. Code sampleimport flet
from flet import*
class Herramientas(UserControl):
def __init__(self, text, icon, on_click):
super().__init__()
self.button=Container(
Row(
alignment=MainAxisAlignment.SPACE_BETWEEN,
controls=[
TextButton(
text=text,
icon=icon,
on_click=on_click,
icon_color='#17F1FF',
style=ButtonStyle(
shape={
'':RoundedRectangleBorder(radius=0)
}
)
),
IconButton(
icon= icons.ARROW_FORWARD_IOS_ROUNDED,
icon_color='#8DF1A9',
icon_size=24,
tooltip=text
)
]
)
)
def build(self):
return self.button Error messageNo response ------------------------------------------------------
|
Beta Was this translation helpful? Give feedback.
Answered by
tehphilb
Sep 26, 2023
Replies: 1 comment
-
I hope I have understood your question correctly. In my opinion, you can achieve this with a row. See the code below.
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
AngelCard
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I hope I have understood your question correctly. In my opinion, you can achieve this with a row. See the code below.