Closed preetjdp closed 4 years ago
This PR brings in another Abstraction YomButton and its partner YomButtonController .
YomButton
YomButtonController
This is a simple controller based Button, which allows the controller to change the state of the button. The Possible state of the Button are.
enum YomButtonState { ACTIVE, LOADING, ERROR, SUCCESS }
Example:
final YomButtonController yomButtonController = YomButtonController(); YomButton( child: Text('Done'), controller: yomButtonController, onPressed: () { yomButtonController.showLoading(); } ),
Other alternatives would be to write a ton a code each time to get a button with a spinner.
Will have to extend more Widgets (For ex: FAB) with this to reuse more code.
What Does this PR do?.
This PR brings in another Abstraction
YomButton
and its partnerYomButtonController
.Describe In brief the solution / approach you've gone with.
This is a simple controller based Button, which allows the controller to change the state of the button. The Possible state of the Button are.
Example:
Describe alternatives you may have considered
Other alternatives would be to write a ton a code each time to get a button with a spinner.
Additional context / quirks
Will have to extend more Widgets (For ex: FAB) with this to reuse more code.