Remove the old snackbar before showing a new one

This commit is contained in:
Vishesh Handa
2019-01-18 12:57:14 +01:00
parent b322e4806d
commit e6648c183e
2 changed files with 5 additions and 5 deletions

View File

@ -48,7 +48,8 @@ class HomeScreen extends StatelessWidget {
await container.syncNotes(); await container.syncNotes();
} on GitException catch (exp) { } on GitException catch (exp) {
_scaffoldKey.currentState _scaffoldKey.currentState
.showSnackBar(new SnackBar(content: new Text(exp.cause))); ..removeCurrentSnackBar()
..showSnackBar(new SnackBar(content: new Text(exp.cause)));
} }
}), }),
), ),

View File

@ -246,10 +246,9 @@ class OnBoardingScreenState extends State<OnBoardingScreen> {
void _copyKeyToClipboard() { void _copyKeyToClipboard() {
Clipboard.setData(ClipboardData(text: publicKey)); Clipboard.setData(ClipboardData(text: publicKey));
var text = "Public Key copied to Clipboard"; var text = "Public Key copied to Clipboard";
this this._scaffoldKey.currentState
._scaffoldKey ..removeCurrentSnackBar()
.currentState ..showSnackBar(new SnackBar(content: new Text(text)));
.showSnackBar(new SnackBar(content: new Text(text)));
} }
void _launchDeployKeyPage() async { void _launchDeployKeyPage() async {