Skip to content

Commit

Permalink
Migrate to ScaffoldMessenger (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
Piinks authored Oct 13, 2020
1 parent c566ec2 commit d71e04b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/src/views/profile_editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ class _AvatarEditorState extends State<AvatarEditor> with AutomaticKeepAliveClie
@override
void cancel() {
setState(() { _busy = false; });
Scaffold.of(context).showSnackBar(const SnackBar(content: Text('Avatar may have changed on the server already.')));
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('Avatar may have changed on the server already.')));
}

void _saveImage(ImageSource source) async {
Expand Down Expand Up @@ -420,7 +420,7 @@ class _ProfileFieldState extends State<ProfileField> with AutomaticKeepAliveClie
@override
void cancel() {
if (_updating)
Scaffold.of(context).showSnackBar(SnackBar(content: Text('${widget.title} may have changed on the server already.')));
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('${widget.title} may have changed on the server already.')));
_field.text = _probableServerContents;
setState(() { _currentlyUploadingValue = null; _saved = false; _error = null; });
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/widgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ class _ChatLineState extends State<ChatLine> {
void _handleCopy() async {
await Clipboard.setData(ClipboardData(text: widget.messages.join('\n')));
if (mounted)
Scaffold.of(context).showSnackBar(const SnackBar(content: Text('Copied to clipboard')));
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('Copied to clipboard')));
}

void _handleLongPress() async {
Expand Down

0 comments on commit d71e04b

Please sign in to comment.