coingaming / moon_flutter

Moon Design System for Flutter
https://flutter.moon.io
MIT License
125 stars 14 forks source link

Feature request: Loading button #409

Closed ysfsl closed 4 weeks ago

ysfsl commented 1 month ago

I think it would be good to have a loading button. We can implement it with the current button, but it’s not very useful because if the button is full-width, the loading indicator shows on the left or right side, but not close to the label. We have to configure something for it to work very well.

MoonButton(isLoading: true)

We could use it like this.

Kypsis commented 1 month ago

But this is quite literally the thing we have tried to avoid as much as possible with MDS, falling into the trap of "propitis". The just one more prop approach tends to add up pretty fast to significant maintenance cost.

Since the components are following the concept of using "slots" and you can pass in widgets to that slot, if I understand your use-case correctly you could get the effect you are looking by passing in Align widget that has a loader of your choice as child.