This file contains hidden or 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
GlobalKey<ScaffoldState> scaffoldKey = new GlobalKey(); | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
key: scaffoldKey, | |
... | |
scaffoldKey.currentState.showSnackBar(SnackBar(content: Text("some text"))); |
This file contains hidden or 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
var text = "some text"; | |
final snackBar = SnackBar( | |
content: Text("Snack: $text"), | |
action: SnackBarAction( | |
label: 'Undo', | |
onPressed: () { | |
// Some code to undo the change! | |
}, | |
), | |
); |
This file contains hidden or 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
<Window x:Class="WpfApp1.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
mc:Ignorable="d" | |
Title="MainWindow" Height="450" Width="800"> | |
<Window.Resources> | |
<Style TargetType="ComboBox"> | |
<Setter Property="Template"> |
NewerOlder