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();
} on GitException catch (exp) {
_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() {
Clipboard.setData(ClipboardData(text: publicKey));
var text = "Public Key copied to Clipboard";
this
._scaffoldKey
.currentState
.showSnackBar(new SnackBar(content: new Text(text)));
this._scaffoldKey.currentState
..removeCurrentSnackBar()
..showSnackBar(new SnackBar(content: new Text(text)));
}
void _launchDeployKeyPage() async {