Skip to content

Instantly share code, notes, and snippets.

@Zambrella
Created September 29, 2019 11:46
Show Gist options
  • Save Zambrella/cec4db9256f32ea3177cfa19798e9cc9 to your computer and use it in GitHub Desktop.
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
// 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