Skip to content

Instantly share code, notes, and snippets.

View satr's full-sized avatar

Sergey Smolnikov satr

View GitHub Profile
GlobalKey<ScaffoldState> scaffoldKey = new GlobalKey();
@override
Widget build(BuildContext context) {
return Scaffold(
key: scaffoldKey,
...
scaffoldKey.currentState.showSnackBar(SnackBar(content: Text("some text")));
@satr
satr / flutter_snakbar.dart
Last active December 3, 2018 19:29
Flutter SnakBar
var text = "some text";
final snackBar = SnackBar(
content: Text("Snack: $text"),
action: SnackBarAction(
label: 'Undo',
onPressed: () {
// Some code to undo the change!
},
),
);
@satr
satr / MainWindow.xaml
Created August 31, 2018 06:51
WPF ComboBox with a title in the popup
<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">