Skip to content

Instantly share code, notes, and snippets.

@sbis04
Created September 9, 2020 11:38
Show Gist options
  • Save sbis04/5d269293242bc74d19d3e49f1b31ac97 to your computer and use it in GitHub Desktop.
Save sbis04/5d269293242bc74d19d3e49f1b31ac97 to your computer and use it in GitHub Desktop.
FlatButton(
color: Colors.blueGrey,
hoverColor: Colors.blueGrey[700],
highlightColor: Colors.blueGrey[800],
onPressed: _isProcessing
? null
: () async {
setState(() {
_isProcessing = true;
});
await signOut().then((result) {
print(result);
Navigator.of(context).pushReplacement(
MaterialPageRoute(
fullscreenDialog: true,
builder: (context) => HomePage(),
),
);
}).catchError((error) {
print('Sign Out Error: $error');
});
setState(() {
_isProcessing = false;
});
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15),
),
child: Padding(
padding: EdgeInsets.only(
top: 8.0,
bottom: 8.0,
),
child: _isProcessing
? CircularProgressIndicator()
: Text(
'Sign out',
style: TextStyle(
fontSize: 14,
color: Colors.white,
),
),
),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment