Created
September 29, 2019 11:46
-
-
Save Zambrella/cec4db9256f32ea3177cfa19798e9cc9 to your computer and use it in GitHub Desktop.
Function to return a spinner widget or text depending of the page is still loading
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function to return either a spinner or some text depending on whether a result is available | |
Widget loadingSpinner() { | |
if (loading == true) { | |
return SpinKitDoubleBounce( | |
color: Colors.red, | |
size: 50, | |
); | |
} else { | |
return Text( | |
'$userPercentage%', | |
style: kPrimaryTextStyle.copyWith( | |
decoration: TextDecoration.underline, fontSize: 44), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment