I'm trying to implement a button that when the user press the button the user will login throw firebase and the button should show Circular Progress Indicator while firebase logging complete. for some reason the Progress Indicator now showing.
I tried to replace
await SignUpController.instance.registerUser(number);
with
await Future.delayed(Duration(seconds: 2));
and that shows the Circular Progress Indicator.
Rx<bool> isLoading = false.obs;
///...
SizedBox(
height: 40,
width: double.infinity,
child: ElevatedButton(
onPressed: () async {
isLoading.value = true;
await SignUpController.instance.registerUser(number);
isLoading.value = false;
},
child: Obx(
() => !isLoading.value
? Text(
"Continue",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.normal),
)
: CircularProgressIndicator(),
))),