The main direction Flet documentation points you to is the usage of UserControls when trying to make custom widgets/controls. UserControl itself inherits from Stack and also comes with a build method that can be used to return something other than a Stack-like.
But if so, why not just inherit from, say, a Container? The code I'm using is this:
class ArrowButton(Container):
def __init__(self, arrow_icon: Icons):
super().__init__(
height=100,
width=100,
bgcolor=Colors.WHITE,
border_radius=500,
content=Icon(
name=arrow_icon,
size=100,
color=Colors.BLACK,
)
)
I can also add methods to change the state, so I don't see why I would specifically need UserControl + its build method. In fact, I have a different project where I built a custom tab system (similar to a web browser) where all custom classes (4 of them) all inherit from Container and whole thing works precisely as intended.
So yeah, what kind of purpose/use case would necessitate the usage of UserControl instead of some other widget? Is there some kind of Flutter-specific nuance I'm missing here?